fix: check if shipping rule value exists

This commit is contained in:
Subin Tom 2021-11-10 16:49:12 +05:30
parent 18ae03d967
commit af1fce0419

View File

@ -259,7 +259,7 @@ class calculate_taxes_and_totals(object):
self.doc.round_floats_in(self.doc, ["total", "base_total", "net_total", "base_net_total"])
if hasattr(self.doc, "shipping_rule"):
if hasattr(self.doc, "shipping_rule") and self.doc.shipping_rule:
shipping_rule = frappe.get_doc("Shipping Rule", self.doc.shipping_rule)
shipping_rule.apply(self.doc)