mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-31 18:59:08 +00:00
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:
@@ -14,6 +14,26 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({
|
|||||||
onload: function() {
|
onload: function() {
|
||||||
this.setup_queries();
|
this.setup_queries();
|
||||||
this._super();
|
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() {
|
setup_queries: function() {
|
||||||
@@ -174,25 +194,6 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({
|
|||||||
|
|
||||||
shipping_address: function(){
|
shipping_address: function(){
|
||||||
var me = this;
|
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",
|
erpnext.utils.get_address_display(this.frm, "shipping_address",
|
||||||
"shipping_address_display", is_your_company_address=true)
|
"shipping_address_display", is_your_company_address=true)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user