From efd655c0eb6471049032112e9b810c7c3c3263a7 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Wed, 17 Feb 2021 16:42:50 +0100 Subject: [PATCH] hr_timesheet_invoice: map accounts based on fiscal position of partner Closes: SYS#3159 --- addons/hr_timesheet_invoice/hr_timesheet_invoice.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/hr_timesheet_invoice/hr_timesheet_invoice.py b/addons/hr_timesheet_invoice/hr_timesheet_invoice.py index 44bc7eb2d7c..ada5cf1cfa8 100644 --- a/addons/hr_timesheet_invoice/hr_timesheet_invoice.py +++ b/addons/hr_timesheet_invoice/hr_timesheet_invoice.py @@ -220,6 +220,7 @@ class account_analytic_line(osv.osv): general_account = product.property_account_income or product.categ_id.property_account_income_categ if not general_account: raise osv.except_osv(_('Error!'), _("Configuration Error!") + '\n' + _("Please define income account for product '%s'.") % product.name) + general_account = account.partner_id.property_account_position.map_account(general_account) taxes = product.taxes_id or general_account.tax_ids tax = self.pool['account.fiscal.position'].map_tax(cr, uid, account.partner_id.property_account_position, taxes, context=context) curr_invoice_line.update({