Merge pull request #18576 from deepeshgarg007/taxes_and_totals_v12
fix: Error handling in taxes and totals
diff --git a/erpnext/controllers/taxes_and_totals.py b/erpnext/controllers/taxes_and_totals.py
index b774037..d2db9d0 100644
--- a/erpnext/controllers/taxes_and_totals.py
+++ b/erpnext/controllers/taxes_and_totals.py
@@ -82,7 +82,7 @@
item.net_rate = item.rate
- if not item.qty and self.doc.is_return:
+ if not item.qty and self.doc.get("is_return"):
item.amount = flt(-1 * item.rate, item.precision("amount"))
else:
item.amount = flt(item.rate * item.qty, item.precision("amount"))