started cleanup of address / contact calls - partly fixed for customer, to fix shipping_address, get_pos_values, for all supplier transactions

This commit is contained in:
Rushabh Mehta
2014-01-02 11:47:23 +05:30
parent 3f7e2729bb
commit b09d9dabc5
24 changed files with 508 additions and 565 deletions

View File

@@ -33,9 +33,10 @@ class SellingController(StockController):
self.set_taxes("other_charges", "charge")
def set_missing_lead_customer_details(self):
from erpnext.selling.doctype.customer.customer import get_customer_details
if self.doc.customer:
if not (self.doc.contact_person and self.doc.customer_address and self.doc.customer_name):
for fieldname, val in self.get_customer_defaults().items():
for fieldname, val in get_customer_details(self.doc.customer).iteritems():
if not self.doc.fields.get(fieldname) and self.meta.get_field(fieldname):
self.doc.fields[fieldname] = val