From 78f5b83d8e307c6bdf9aa071be8f612d5e537f45 Mon Sep 17 00:00:00 2001 From: Charles-Henri Decultot Date: Thu, 22 Feb 2024 19:01:35 +0100 Subject: [PATCH] fix: Don't add taxes twice --- erpnext/controllers/accounts_controller.py | 23 +++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index 3bf144291ee..8c74e10079b 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -852,17 +852,18 @@ class AccountsController(TransactionBase): for row in item_tax_rate: account_head = row.get("account") - self.append( - "taxes", - { - "charge_type": row.get("charge_type") or "On Net Total", - "account_head": account_head, - # Rate is zero by convention when applied from item tax template - "rate": 0, - "description": row.get("description") or account_head, - "included_in_print_rate": row.get("included_in_print_rate", 0), - }, - ) + if not self.get_tax_row(account_head): + self.append( + "taxes", + { + "charge_type": row.get("charge_type") or "On Net Total", + "account_head": account_head, + # Rate is zero by convention when applied from item tax template + "rate": 0, + "description": row.get("description") or account_head, + "included_in_print_rate": row.get("included_in_print_rate", 0), + }, + ) def get_tax_row(self, account_head): for row in self.taxes: -- GitLab