[FIX] account: get uom at account invoice creation
For commit c63230d0d
if there is no uom, it should not fail.
closes #6920
This commit is contained in:
parent
c63230d0d0
commit
69f87cd34c
|
@ -1519,11 +1519,10 @@ class account_invoice_line(osv.osv):
|
|||
result.update({'price_unit': res.list_price, 'invoice_line_tax_id': tax_id})
|
||||
result['name'] = res.partner_ref
|
||||
|
||||
result['uos_id'] = res.uom_id.id
|
||||
if uom_id:
|
||||
uom = product_uom_obj.browse(cr, uid, uom_id)
|
||||
if res.uom_id.category_id.id != uom.category_id.id:
|
||||
result['uos_id'] = res.uom_id.id
|
||||
else:
|
||||
if res.uom_id.category_id.id == uom.category_id.id:
|
||||
result['uos_id'] = uom_id
|
||||
|
||||
if res.description:
|
||||
|
|
Loading…
Reference in New Issue