added get_supplier_details and commonified invoice functions

This commit is contained in:
Rushabh Mehta
2014-01-28 17:43:10 +05:30
parent 21d324c597
commit 49dd7bee87
18 changed files with 136 additions and 234 deletions

View File

@@ -35,17 +35,10 @@ class SellingController(StockController):
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 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
self.doc.update_if_not_set(get_customer_details(self.doc.customer))
elif self.doc.lead:
if not (self.doc.customer_address and self.doc.customer_name and \
self.doc.contact_display):
for fieldname, val in self.get_lead_defaults().items():
if not self.doc.fields.get(fieldname) and self.meta.get_field(fieldname):
self.doc.fields[fieldname] = val
self.doc.update_if_not_set(self.get_lead_defaults())
def set_price_list_and_item_details(self):
self.set_price_list_currency("Selling")