added get_supplier_details and commonified invoice functions
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user