Problem unlink record from calendar

Bug #1279782 reported by Nicola Riolini - Micronaet
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
New
Undecided
Unassigned

Bug Description

Hello I have last openerp v.7.0 updated today (standard openobject-addons)
I see this problem in calendar view hr.timesheet but I prefer report a bug (even if I customize inheriting hr.timesheet)

The problem is that: in calendar view, if I unlink a record with the recycle bin icon, openerp pass ids as integer instead of list of ids so I got a generic error (and no record are erased).

I dig into the code and I see that generic error is a "no iterable object error" when I arrive at this point:

/home/thebrush/lp7/openerp/openerp/addons/hr_timesheet/hr_timesheet.py(81)unlink()
for obj in self.browse(cr, uid, ids, context=context): <<<<<<<<<<<<<

obviously because ids is a integer not a list.
My workaround is create, in my module, a override method of unlink:

    def unlink(self, cr, user, ids, context=None):
        if type(ids) not in (list, tuple):
            ids = [ids]
        return super(hr_analytic_timesheet_extra, self).unlink(cr, user, ids, context)

My bug is for ask if, in calendar, is possibile have unlink call with list (usually there's not problems but, as you see, in some modules like timesheet, there a loop based in list of ids).
Thanks (please feel free to change project if the bug is not in correct one)
Nicola

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.