Fixed issue with Customer Contacts in Transaction Documents
diff --git a/erpnext/accounts/party.py b/erpnext/accounts/party.py
index 5de43a0..7c338cd 100644
--- a/erpnext/accounts/party.py
+++ b/erpnext/accounts/party.py
@@ -74,6 +74,15 @@
{party_type.lower(): party.name, "is_primary_contact":1}, "name")
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
out.update(get_contact_details(out.contact_person))
diff --git a/erpnext/buying/doctype/purchase_common/purchase_common.js b/erpnext/buying/doctype/purchase_common/purchase_common.js
index 6e27401..1b7d20a 100644
--- a/erpnext/buying/doctype/purchase_common/purchase_common.js
+++ b/erpnext/buying/doctype/purchase_common/purchase_common.js
@@ -70,10 +70,6 @@
erpnext.utils.get_address_display(this.frm);
},
- contact_person: function() {
- erpnext.utils.get_contact_details(this.frm);
- },
-
buying_price_list: function() {
this.apply_price_list();
},
diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js
index 953800d..0a75dad 100644
--- a/erpnext/public/js/controllers/transaction.js
+++ b/erpnext/public/js/controllers/transaction.js
@@ -282,6 +282,10 @@
get_company_currency: function() {
return erpnext.get_currency(this.frm.doc.company);
},
+
+ contact_person: function() {
+ erpnext.utils.get_contact_details(this.frm);
+ },
currency: function() {
var me = this;
diff --git a/erpnext/selling/sales_common.js b/erpnext/selling/sales_common.js
index 88ef61e..f3cd8a7 100644
--- a/erpnext/selling/sales_common.js
+++ b/erpnext/selling/sales_common.js
@@ -112,10 +112,6 @@
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() {
this.apply_pricing_rule();
},
diff --git a/erpnext/utilities/doctype/contact/contact.py b/erpnext/utilities/doctype/contact/contact.py
index 4158d75..314014f 100644
--- a/erpnext/utilities/doctype/contact/contact.py
+++ b/erpnext/utilities/doctype/contact/contact.py
@@ -66,5 +66,4 @@
"contact_designation": contact.get("designation"),
"contact_department": contact.get("department")
}
-
return out