[FIX] analytic_contract_hr_expense: use the real cost when reinvoicing expenses
bzr revid: qdp-launchpad@openerp.com-20121127125309-t3lp3abnzh2se0zr
This commit is contained in:
parent
6f256d41db
commit
60f1d800a2
|
@ -79,9 +79,8 @@ class account_analytic_account(osv.osv):
|
|||
|
||||
res[account.id] = 0.0
|
||||
for product_id, price, user_id, factor_id, qty, uom, line_name in cr.fetchall():
|
||||
#the amount to reinvoice is the real cost. We don't use the pricelist
|
||||
price = -price
|
||||
if product_id:
|
||||
price = self.pool.get('account.analytic.line')._get_invoice_price(cr, uid, account, product_id, user_id, qty, context)
|
||||
factor = self.pool.get('hr_timesheet_invoice.factor').browse(cr, uid, factor_id, context=context)
|
||||
res[account.id] += price * qty * (100 - factor.factor or 0.0) / 100.0
|
||||
return res
|
||||
|
|
Loading…
Reference in New Issue