From 23a64d7f9dba71ad1df17705b1387c860ad37dd6 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 24 Jul 2013 16:19:54 +0530 Subject: [PATCH 1/2] [minor] removed customer validation between quotation and SO --- selling/doctype/sales_order/sales_order.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/selling/doctype/sales_order/sales_order.py b/selling/doctype/sales_order/sales_order.py index 210e56f04d5..fb04714a078 100644 --- a/selling/doctype/sales_order/sales_order.py +++ b/selling/doctype/sales_order/sales_order.py @@ -166,7 +166,7 @@ class DocType(SellingController): super(DocType, self).validate_with_previous_doc(self.tname, { "Quotation": { "ref_dn_field": "prevdoc_docname", - "compare_fields": [["customer", "="], ["company", "="], ["currency", "="]] + "compare_fields": [["company", "="], ["currency", "="]] } }) From 02a3d7ac129b2af5c932e948651fe19de7bb9d33 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 24 Jul 2013 16:33:30 +0530 Subject: [PATCH 2/2] [minor] [fix] fetching contact details --- utilities/transaction_base.py | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/utilities/transaction_base.py b/utilities/transaction_base.py index 8894cb4b22a..2900bf6ec3b 100644 --- a/utilities/transaction_base.py +++ b/utilities/transaction_base.py @@ -396,20 +396,22 @@ def map_party_contact_details(contact_name=None, party_field=None, party_name=No if not contact_name and party_field: contact_name = get_default_contact(party_field, party_name) - contact = webnotes.conn.sql("""select * from `tabContact` where name=%s""", contact_name, as_dict=True) + if contact_name: + contact = webnotes.conn.sql("""select * from `tabContact` where name=%s""", + contact_name, as_dict=True) - if contact: - contact = contact[0] - out.update({ - "contact_person": contact.get("name"), - "contact_display": " ".join(filter(None, - [contact.get("first_name"), contact.get("last_name")])), - "contact_email": contact.get("email_id"), - "contact_mobile": contact.get("mobile_no"), - "contact_phone": contact.get("phone"), - "contact_designation": contact.get("designation"), - "contact_department": contact.get("department") - }) + if contact: + contact = contact[0] + out.update({ + "contact_person": contact.get("name"), + "contact_display": " ".join(filter(None, + [contact.get("first_name"), contact.get("last_name")])), + "contact_email": contact.get("email_id"), + "contact_mobile": contact.get("mobile_no"), + "contact_phone": contact.get("phone"), + "contact_designation": contact.get("designation"), + "contact_department": contact.get("department") + }) return out