[MERGE] merged bugfix 716107

bzr revid: qdp-launchpad@openerp.com-20110225141114-uxyug5oby21ngm07
This commit is contained in:
Quentin (OpenERP) 2011-02-25 15:11:14 +01:00
commit a56dde158e
1 changed files with 6 additions and 2 deletions

View File

@ -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:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: