Fixed issue with Customer Contacts in Transaction Documents
This commit is contained in:
@@ -74,6 +74,15 @@ def set_contact_details(out, party, party_type):
|
|||||||
{party_type.lower(): party.name, "is_primary_contact":1}, "name")
|
{party_type.lower(): party.name, "is_primary_contact":1}, "name")
|
||||||
|
|
||||||
if not out.contact_person:
|
if not out.contact_person:
|
||||||
|
out.update({
|
||||||
|
"contact_person": None,
|
||||||
|
"contact_display": None,
|
||||||
|
"contact_email": None,
|
||||||
|
"contact_mobile": None,
|
||||||
|
"contact_phone": None,
|
||||||
|
"contact_designation": None,
|
||||||
|
"contact_department": None
|
||||||
|
})
|
||||||
return
|
return
|
||||||
|
|
||||||
out.update(get_contact_details(out.contact_person))
|
out.update(get_contact_details(out.contact_person))
|
||||||
|
|||||||
@@ -70,10 +70,6 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({
|
|||||||
erpnext.utils.get_address_display(this.frm);
|
erpnext.utils.get_address_display(this.frm);
|
||||||
},
|
},
|
||||||
|
|
||||||
contact_person: function() {
|
|
||||||
erpnext.utils.get_contact_details(this.frm);
|
|
||||||
},
|
|
||||||
|
|
||||||
buying_price_list: function() {
|
buying_price_list: function() {
|
||||||
this.apply_price_list();
|
this.apply_price_list();
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -283,6 +283,10 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
|
|||||||
return erpnext.get_currency(this.frm.doc.company);
|
return erpnext.get_currency(this.frm.doc.company);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
contact_person: function() {
|
||||||
|
erpnext.utils.get_contact_details(this.frm);
|
||||||
|
},
|
||||||
|
|
||||||
currency: function() {
|
currency: function() {
|
||||||
var me = this;
|
var me = this;
|
||||||
this.set_dynamic_labels();
|
this.set_dynamic_labels();
|
||||||
|
|||||||
@@ -112,10 +112,6 @@ erpnext.selling.SellingController = erpnext.TransactionController.extend({
|
|||||||
erpnext.utils.get_address_display(this.frm, "shipping_address_name", "shipping_address");
|
erpnext.utils.get_address_display(this.frm, "shipping_address_name", "shipping_address");
|
||||||
},
|
},
|
||||||
|
|
||||||
contact_person: function() {
|
|
||||||
erpnext.utils.get_contact_details(this.frm);
|
|
||||||
},
|
|
||||||
|
|
||||||
sales_partner: function() {
|
sales_partner: function() {
|
||||||
this.apply_pricing_rule();
|
this.apply_pricing_rule();
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -66,5 +66,4 @@ def get_contact_details(contact):
|
|||||||
"contact_designation": contact.get("designation"),
|
"contact_designation": contact.get("designation"),
|
||||||
"contact_department": contact.get("department")
|
"contact_department": contact.get("department")
|
||||||
}
|
}
|
||||||
|
|
||||||
return out
|
return out
|
||||||
|
|||||||
Reference in New Issue
Block a user