[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
This commit is contained in:
qdp-odoo
2018-06-20 17:18:21 +02:00
parent 27825cbf13
commit 6424111f7a
+1 -3
View File
@@ -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,