From 753eddd26f13ba94dab8cf53e270dc32dc9663bf Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Mon, 21 Feb 2011 14:40:35 +0530 Subject: [PATCH] [FIX]Account:analytic line adding product doesnt add the unit of measure lp bug: https://launchpad.net/bugs/716107 fixed bzr revid: ron@tinyerp.com-20110221091035-17bz1yzwslbtd9rs --- addons/account/account_analytic_line.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/addons/account/account_analytic_line.py b/addons/account/account_analytic_line.py index fa150b291dc..2ad40592011 100644 --- a/addons/account/account_analytic_line.py +++ b/addons/account/account_analytic_line.py @@ -80,7 +80,11 @@ class account_analytic_line(osv.osv): j_id = analytic_journal_obj.browse(cr, uid, journal_id, context=context) prod = product_obj.browse(cr, uid, prod_id, context=context) result = 0.0 - + product_uom_id=False + if prod_id: + product_uom_id = prod.uom_id.id + if j_id.type == 'purchase': + product_uom_id = prod.uom_po_id.id if j_id.type <> 'sale': a = prod.product_tmpl_id.property_account_expense.id if not a: @@ -127,6 +131,7 @@ class account_analytic_line(osv.osv): return {'value': { 'amount': result, 'general_account_id': a, + 'product_uom_id':product_uom_id } }