[Partial] Fix to add Shipping address in Purchase order
This commit is contained in:
parent
77d23824df
commit
26bb6f37bc
@ -13,6 +13,12 @@ frappe.ui.form.on("Purchase Order", {
|
||||
}
|
||||
});
|
||||
|
||||
frappe.ui.form.on_change("Purchase Order", "company", function(frm){
|
||||
erpnext.utils.get_shipping_address(frm.doc)
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
erpnext.buying.PurchaseOrderController = erpnext.buying.BuyingController.extend({
|
||||
refresh: function(doc, cdt, cdn) {
|
||||
var me = this;
|
||||
|
@ -144,7 +144,6 @@ def get_address_templates(address):
|
||||
else:
|
||||
return name, template
|
||||
|
||||
|
||||
@frappe.whitelist()
|
||||
def get_shipping_address(company):
|
||||
filters = {"company": company, "is_company_address":1}
|
||||
@ -156,5 +155,4 @@ def get_shipping_address(company):
|
||||
frappe.throw(_("Please add addresses for the company"))
|
||||
else:
|
||||
name, address_template = get_address_templates(address_as_dict)
|
||||
|
||||
return address_as_dict.get("name"), frappe.render_template(address_template, address_as_dict)
|
||||
|
Loading…
x
Reference in New Issue
Block a user