Merge branch 'master' of github.com:webnotes/erpnext

This commit is contained in:
Anand Doshi 2013-07-24 16:49:47 +05:30
commit 3d8a69b6a6
2 changed files with 16 additions and 14 deletions

View File

@ -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", "="]]
}
})

View File

@ -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