[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')) {
|
if(this.frm.get_field('shipping_address')) {
|
||||||
this.frm.set_query("shipping_address", function(){
|
this.frm.set_query("shipping_address", function(){
|
||||||
if(me.frm.doc.customer){
|
if(me.frm.doc.customer){
|
||||||
return{
|
return {
|
||||||
filters:{
|
query: 'frappe.geo.doctype.address.address.address_query',
|
||||||
"customer": me.frm.doc.customer
|
filters: { link_doctype: 'Customer', link_name: me.frm.doc.customer }
|
||||||
}
|
};
|
||||||
}
|
} else
|
||||||
}
|
return erpnext.queries.company_address_query(me.frm.doc)
|
||||||
else{
|
|
||||||
return{
|
|
||||||
filters:{
|
|
||||||
"is_your_company_address": 1,
|
|
||||||
"company": me.frm.doc.company
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@ -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) {
|
supplier_filter: function(doc) {
|
||||||
if(!doc.supplier) {
|
if(!doc.supplier) {
|
||||||
frappe.throw(__("Please set {0}", __(frappe.meta.get_label(doc.doctype, "supplier", doc.name))));
|
frappe.throw(__("Please set {0}", __(frappe.meta.get_label(doc.doctype, "supplier", doc.name))));
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user