fix: place of supply change when address changes
diff --git a/erpnext/public/js/utils.js b/erpnext/public/js/utils.js
index ea2093e..b4fe412 100755
--- a/erpnext/public/js/utils.js
+++ b/erpnext/public/js/utils.js
@@ -304,6 +304,21 @@
}
frappe.ui.form.make_quick_entry(doctype, null, null, new_doc);
});
+ },
+
+ set_place_of_supply: function(frm){
+ frappe.call({
+ method: "erpnext.regional.india.utils.get_place_of_supply",
+ args: {
+ "party_details": frm.doc,
+ "doctype": frm.doc.doctype
+ },
+ callback: function(r){
+ if(r.message){
+ frm.set_value("place_of_supply", r.message)
+ }
+ }
+ })
}
});
diff --git a/erpnext/regional/india/utils.py b/erpnext/regional/india/utils.py
index dd87f0f..c774cb0 100644
--- a/erpnext/regional/india/utils.py
+++ b/erpnext/regional/india/utils.py
@@ -135,6 +135,7 @@
'''test function'''
return 'overridden'
+@frappe.whitelist()
def get_place_of_supply(party_details, doctype):
if not frappe.get_meta('Address').has_field('gst_state'): return
diff --git a/erpnext/selling/sales_common.js b/erpnext/selling/sales_common.js
index 002cfe4..77bdf29 100644
--- a/erpnext/selling/sales_common.js
+++ b/erpnext/selling/sales_common.js
@@ -117,6 +117,7 @@
customer_address: function() {
erpnext.utils.get_address_display(this.frm, "customer_address");
erpnext.utils.set_taxes_from_address(this.frm, "customer_address", "customer_address", "shipping_address_name");
+ erpnext.utils.set_place_of_supply(this.frm)
},
shipping_address_name: function() {