Merge pull request #22092 from marination/shippinng-address
fix: Apply shipping rule without address too
This commit is contained in:
commit
b3b5c96749
@ -45,7 +45,9 @@ class ShippingRule(Document):
|
|||||||
shipping_amount = 0.0
|
shipping_amount = 0.0
|
||||||
by_value = False
|
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':
|
if self.calculate_based_on == 'Net Total':
|
||||||
value = doc.base_net_total
|
value = doc.base_net_total
|
||||||
|
@ -917,7 +917,7 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
|
|||||||
|
|
||||||
shipping_rule: function() {
|
shipping_rule: function() {
|
||||||
var me = this;
|
var me = this;
|
||||||
if(this.frm.doc.shipping_rule && this.frm.doc.shipping_address) {
|
if(this.frm.doc.shipping_rule) {
|
||||||
return this.frm.call({
|
return this.frm.call({
|
||||||
doc: this.frm.doc,
|
doc: this.frm.doc,
|
||||||
method: "apply_shipping_rule",
|
method: "apply_shipping_rule",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user