diff options
| author | Quentin (OpenERP) <qdp-launchpad@openerp.com> | 2013-05-22 11:40:17 +0200 |
|---|---|---|
| committer | Quentin (OpenERP) <qdp-launchpad@openerp.com> | 2013-05-22 11:40:17 +0200 |
| commit | 9fc3014e11444eb82c1f43904a2e7d47e330d4df (patch) | |
| tree | eb8a4da99b89173bdd8dc42e0e7e5d0823276a10 | |
| parent | d08295abf6a4d034356e29f7194909c916e9fbc0 (diff) | |
[FIX] hr_expense: fix in accounting entries generation for tax included in price
bzr revid: qdp-launchpad@openerp.com-20130522094017-b6xibz6b90s4w091
| -rw-r--r-- | addons/hr_expense/hr_expense.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/addons/hr_expense/hr_expense.py b/addons/hr_expense/hr_expense.py index 75f6c7c207e..7299f495cb4 100644 --- a/addons/hr_expense/hr_expense.py +++ b/addons/hr_expense/hr_expense.py @@ -279,7 +279,6 @@ class hr_expense_expense(osv.osv): tax_code_found= False #Calculate tax according to default tax on product - taxes = [] #Taken from product_id_onchange in account.invoice if line.product_id: @@ -316,8 +315,12 @@ class hr_expense_expense(osv.osv): tax_code_found = True res[-1]['tax_code_id'] = tax_code_id res[-1]['tax_amount'] = cur_obj.compute(cr, uid, exp.currency_id.id, company_currency, tax_amount, context={'date': exp.date_confirm}) - - #Will create the tax here as we don't have the access + ## + is_price_include = tax_obj.read(cr,uid,tax['id'],['price_include'],context)['price_include'] + if is_price_include: + ## We need to deduce the price for the tax + res[-1]['price'] = res[-1]['price'] - (tax['amount'] * tax['base_sign'] or 0.0) + #Will create the tax here as we don't have the access assoc_tax = { 'type':'tax', 'name':tax['name'], |
