fix: Apply shipping rule without address too

This commit is contained in:
marination 2020-06-03 14:32:07 +05:30
parent 881999d3bf
commit 0c72249403
2 changed files with 4 additions and 2 deletions

View File

@ -45,7 +45,9 @@ class ShippingRule(Document):
shipping_amount = 0.0
by_value = False
self.validate_countries(doc)
if doc.get_shipping_address():
# validate country only if there is address
self.validate_countries(doc)
if self.calculate_based_on == 'Net Total':
value = doc.base_net_total

View File

@ -917,7 +917,7 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
shipping_rule: function() {
var me = this;
if(this.frm.doc.shipping_rule && this.frm.doc.shipping_address) {
if(this.frm.doc.shipping_rule) {
return this.frm.call({
doc: this.frm.doc,
method: "apply_shipping_rule",