From 38dfccaaa08d4ee8e73e88cc17430e95313591e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Sun, 9 Sep 2012 18:59:19 +0200 Subject: [PATCH] hr_timesheet_invoice: in invoice task work, use the account default tax if the product has no taxes defined lp bug: https://launchpad.net/bugs/1048305 fixed bzr revid: stephane.bidoul@acsone.eu-20120909165919-xgxu45ugq3944gvu --- .../wizard/hr_timesheet_invoice_create.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py b/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py index e33e88203f8..32ae652ca3d 100644 --- a/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py +++ b/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py @@ -122,11 +122,11 @@ class account_analytic_line(osv.osv): else: price = 0.0 - taxes = product.taxes_id - tax = fiscal_pos_obj.map_tax(cr, uid, account.partner_id.property_account_position, taxes) - account_id = product.product_tmpl_id.property_account_income.id or product.categ_id.property_account_income_categ.id - if not account_id: + general_account = product.product_tmpl_id.property_account_income or product.categ_id.property_account_income_categ + if not general_account: raise osv.except_osv(_("Configuration Error!"), _("Please define income account for product '%s'.") % product.name) + taxes = product.taxes_id or general_account.tax_ids + tax = fiscal_pos_obj.map_tax(cr, uid, account.partner_id.property_account_position, taxes) curr_line = { 'price_unit': price, 'quantity': qty, @@ -137,7 +137,7 @@ class account_analytic_line(osv.osv): 'product_id': product_id, 'invoice_line_tax_id': [(6,0,tax)], 'uos_id': uom, - 'account_id': account_id, + 'account_id': general_account.id, 'account_analytic_id': account.id, }