Merge pull request #22092 from marination/shippinng-address

fix: Apply shipping rule without address too
This commit is contained in:
rohitwaghchaure 2020-06-08 10:36:19 +05:30 committed by GitHub
commit b3b5c96749
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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",