fix: Error on any new doc from Shipping Rule. (#21207)
This commit is contained in:
@@ -82,7 +82,7 @@ class ShippingRule(Document):
|
|||||||
if not shipping_country:
|
if not shipping_country:
|
||||||
frappe.throw(_('Shipping Address does not have country, which is required for this Shipping Rule'))
|
frappe.throw(_('Shipping Address does not have country, which is required for this Shipping Rule'))
|
||||||
if shipping_country not in [d.country for d in self.countries]:
|
if shipping_country not in [d.country for d in self.countries]:
|
||||||
frappe.throw(_('Shipping rule not applicable for country {0}'.format(shipping_country)))
|
frappe.throw(_('Shipping rule not applicable for country {0} in Shipping Address').format(shipping_country))
|
||||||
|
|
||||||
def add_shipping_rule_to_tax_table(self, doc, shipping_amount):
|
def add_shipping_rule_to_tax_table(self, doc, shipping_amount):
|
||||||
shipping_charge = {
|
shipping_charge = {
|
||||||
|
|||||||
@@ -856,7 +856,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) {
|
if(this.frm.doc.shipping_rule && this.frm.doc.shipping_address) {
|
||||||
return this.frm.call({
|
return this.frm.call({
|
||||||
doc: this.frm.doc,
|
doc: this.frm.doc,
|
||||||
method: "apply_shipping_rule",
|
method: "apply_shipping_rule",
|
||||||
|
|||||||
Reference in New Issue
Block a user