Skip to content

Commit

Permalink
fix: Added filter for dispatch address (frappe#28937)
Browse files Browse the repository at this point in the history
  • Loading branch information
nemesis189 committed Dec 21, 2021
1 parent 92e86f2 commit 98d4176
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions erpnext/public/js/queries.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,13 @@ $.extend(erpnext.queries, {
};
},

dispatch_address_query: function(doc) {
return {
query: 'frappe.contacts.doctype.address.address.address_query',
filters: { link_doctype: 'Company', link_name: doc.company || '' }
};
},

supplier_filter: function(doc) {
if(!doc.supplier) {
frappe.throw(__("Please set {0}", [__(frappe.meta.get_label(doc.doctype, "supplier", doc.name))]));
Expand Down
1 change: 1 addition & 0 deletions erpnext/selling/sales_common.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ erpnext.selling.SellingController = class SellingController extends erpnext.Tran
me.frm.set_query('contact_person', erpnext.queries.contact_query);
me.frm.set_query('customer_address', erpnext.queries.address_query);
me.frm.set_query('shipping_address_name', erpnext.queries.address_query);
me.frm.set_query('dispatch_address_name', erpnext.queries.dispatch_address_query);


if(this.frm.fields_dict.selling_price_list) {
Expand Down

0 comments on commit 98d4176

Please sign in to comment.