Merge pull request #5466 from rohitwaghchaure/shipping_address_autocomplete_issue
[Fix] Shipping address's get_query not working on autocomplete.
This commit is contained in:
commit
bf3e26dd2d
@ -14,6 +14,26 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({
|
||||
onload: function() {
|
||||
this.setup_queries();
|
||||
this._super();
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
setup_queries: function() {
|
||||
@ -174,25 +194,6 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({
|
||||
|
||||
shipping_address: function(){
|
||||
var me = this;
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
erpnext.utils.get_address_display(this.frm, "shipping_address",
|
||||
"shipping_address_display", is_your_company_address=true)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user