[7.0] moves can have tax amount NULL -> _sum in account.tax.code crashes

Bug #1280308 reported by Leonardo Pistone
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
New
Undecided
Unassigned

Bug Description

Observed in v7.0.

The field tax_amount of the move_line can be NULL (as opposed to 0.0).

If you have all moves with a certain tax code with a tax_amount = NULL, and then open the form view of the tax code from the web interface, it crashes because it is trying to round a NULL.

  File "/home/lpistone/w/oe/server/openerp/osv/osv.py", line 132, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/home/lpistone/w/oe/server/openerp/osv/osv.py", line 199, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/home/lpistone/w/oe/server/openerp/osv/osv.py", line 187, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/home/lpistone/w/oe/server/openerp/osv/orm.py", line 3622, in read
    result = self._read_flat(cr, user, select, fields, context, load)
  File "/home/lpistone/w/oe/server/openerp/osv/orm.py", line 3743, in _read_flat
    res2 = self._columns[f].get(cr, self, ids, f, user, context=context, values=res)
  File "/home/lpistone/w/oe/server/openerp/osv/fields.py", line 1142, in get
    result = self._fnct(obj, cr, uid, ids, name, self._arg, context)
  File "/home/lpistone/w/oe/addons/account/account.py", line 1852, in _sum_year
    where=where, where_params=where_params)
  File "/home/lpistone/w/oe/addons/account/account.py", line 1829, in _sum
    res2[record.id] = round(_rec_get(record), obj_precision.precision_get(cr, uid, 'Account'))
TypeError: a float is required

Thanks!

summary: - moves can have tax amount NULL -> _sum in account.tax.code crashes
+ [7.0] moves can have tax amount NULL -> _sum in account.tax.code crashes
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.