[minor] fixes in address filters
This commit is contained in:
parent
cbc49e2989
commit
8271b4c564
@ -21,20 +21,12 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({
|
||||
if(this.frm.get_field('shipping_address')) {
|
||||
this.frm.set_query("shipping_address", function(){
|
||||
if(me.frm.doc.customer){
|
||||
return{
|
||||
filters:{
|
||||
"customer": me.frm.doc.customer
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
return{
|
||||
filters:{
|
||||
"is_your_company_address": 1,
|
||||
"company": me.frm.doc.company
|
||||
}
|
||||
}
|
||||
}
|
||||
return {
|
||||
query: 'frappe.geo.doctype.address.address.address_query',
|
||||
filters: { link_doctype: 'Customer', link_name: me.frm.doc.customer }
|
||||
};
|
||||
} else
|
||||
return erpnext.queries.company_address_query(me.frm.doc)
|
||||
});
|
||||
}
|
||||
},
|
||||
|
@ -68,6 +68,13 @@ $.extend(erpnext.queries, {
|
||||
}
|
||||
},
|
||||
|
||||
company_address_query: function(doc) {
|
||||
return {
|
||||
query: 'frappe.geo.doctype.address.address.address_query',
|
||||
filters: { is_your_company_address: 1, 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))));
|
||||
|
Loading…
x
Reference in New Issue
Block a user