From f01baaa56f66e4404a2e3bd049a64eb16fc6d7e3 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 3006c0e1235..e018dd23961 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()