From 839b653f6b9273f9e0008ad75c4ae3bd7f0734d6 Mon Sep 17 00:00:00 2001 From: Govind S Menokee Date: Wed, 19 Jun 2019 21:04:35 +0530 Subject: [PATCH 1/2] fix: lead reference changed to dynamic link #17987 --- erpnext/shopping_cart/cart.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/shopping_cart/cart.py b/erpnext/shopping_cart/cart.py index efc128aa0c5..32ea40bd9fb 100644 --- a/erpnext/shopping_cart/cart.py +++ b/erpnext/shopping_cart/cart.py @@ -60,7 +60,7 @@ def place_order(): quotation.flags.ignore_permissions = True quotation.submit() - if quotation.lead: + if quotation.quotation_to == 'Lead' and quotation.party_name: # company used to create customer accounts frappe.defaults.set_user_default("company", quotation.company) From f01baaa56f66e4404a2e3bd049a64eb16fc6d7e3 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 12 Jul 2019 14:27:19 +0530 Subject: [PATCH 2/2] 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()