From b315acb5a7b4c77f7ff5ca677d2c3c6854e13abe Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 12 Jul 2019 14:27:19 +0530 Subject: [PATCH] fix: Calculate taxes and totals only if items added in transaction --- erpnext/controllers/taxes_and_totals.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/erpnext/controllers/taxes_and_totals.py b/erpnext/controllers/taxes_and_totals.py index ebbe3d9d27..8e1510a836 100644 --- a/erpnext/controllers/taxes_and_totals.py +++ b/erpnext/controllers/taxes_and_totals.py @@ -15,6 +15,9 @@ class calculate_taxes_and_totals(object): self.calculate() def calculate(self): + if not len(self.doc.get("items")): + return + self.discount_amount_applied = False self._calculate()