Skip to content
Snippets Groups Projects
Commit 7c5bf67a authored by Denis Ledoux's avatar Denis Ledoux
Browse files

[FIX] account: unit arg of on_change_unit_amount can be False

parent cd31cbf5
No related branches found
No related tags found
No related merge requests found
......@@ -79,11 +79,13 @@ class account_analytic_line(osv.osv):
prod = product_obj.browse(cr, uid, prod_id, context=context)
result = 0.0
if prod_id:
unit_obj = product_uom_obj.browse(cr, uid, unit, context=context)
if prod.uom_id.category_id.id != unit_obj.category_id.id:
unit_obj = False
if unit:
unit_obj = product_uom_obj.browse(cr, uid, unit, context=context)
if not unit_obj or prod.uom_id.category_id.id != unit_obj.category_id.id:
unit = prod.uom_id.id
if j_id.type == 'purchase':
if prod.uom_po_id.category_id.id != unit_obj.category_id.id:
if not unit_obj or prod.uom_po_id.category_id.id != unit_obj.category_id.id:
unit = prod.uom_po_id.id
if j_id.type <> 'sale':
a = prod.property_account_expense.id
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment