diff --git a/addons/account/account_analytic_line.py b/addons/account/account_analytic_line.py index fa150b291dc..a93dc70b2fb 100644 --- a/addons/account/account_analytic_line.py +++ b/addons/account/account_analytic_line.py @@ -80,7 +80,10 @@ 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 - + if prod_id: + unit = prod.uom_id.id + if j_id.type == 'purchase': + unit = prod.uom_po_id.id if j_id.type <> 'sale': a = prod.product_tmpl_id.property_account_expense.id if not a: @@ -127,6 +130,7 @@ class account_analytic_line(osv.osv): return {'value': { 'amount': result, 'general_account_id': a, + 'product_uom_id': unit } } @@ -155,4 +159,4 @@ class res_partner(osv.osv): res_partner() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: