From 6424111f7ac83e4bc68b7267e5d1374251fb3a92 Mon Sep 17 00:00:00 2001 From: qdp-odoo Date: Wed, 20 Jun 2018 17:17:37 +0200 Subject: [PATCH] [FIX] account: cash based taxes mixed with regular ones Previously, the use case where a cash basis tax and a regular one were combined on the same invoice line (for example) was not supported (technically, there's a single boolean for the tax exigibility of the sale/purchase line). Since it appears this is a real need, this have been improved in the generic tax report (in enterprise repo) in revision https://github.com/odoo/enterprise/commit/f7e33b8114d4d649551a155d0ca8cc4f43f1fc01 and this commit fixes the community side, to copy only the base line of the tax exigibile on payments in the cash basis move --- addons/account/models/account_move.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index d9cba8c87ba..931ca912881 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -1449,8 +1449,6 @@ class AccountPartialReconcile(models.Model): if move_date < move.date: move_date = move.date for line in move.line_ids: - #TOCHECK: normal and cash basis taxes shouldn't be mixed together (on the same invoice line for example) as it will - # create reporting issues. Not sure of the behavior to implement in that case, though. if not line.tax_exigible: percentage_before = percentage_before_rec[move.id] percentage_after = line._get_matched_percentage()[move.id] @@ -1500,7 +1498,7 @@ class AccountPartialReconcile(models.Model): if not newly_created_move: newly_created_move = self._create_tax_basis_move() #create cash basis entry for the base - for tax in line.tax_ids: + for tax in line.tax_ids.filtered(lambda t: t.tax_exigibility == 'on_payment'): account_id = self._get_tax_cash_basis_base_account(line, tax) self.env['account.move.line'].with_context(check_move_validity=False).create({ 'name': line.name,