[material requests] [tests]

This commit is contained in:
Rushabh Mehta
2013-07-08 12:08:06 +05:30
parent a2a1ec765b
commit 886c9ef5d1
4 changed files with 13 additions and 14 deletions

View File

@@ -34,6 +34,9 @@ class BuyingController(StockController):
def validate(self):
super(BuyingController, self).validate()
if self.doc.supplier and not self.doc.supplier_name:
self.doc.supplier_name = webnotes.conn.get_value("Supplier",
self.doc.supplier, "supplier_name")
self.validate_stock_or_nonstock_items()
self.validate_warehouse_belongs_to_company()
@@ -47,7 +50,7 @@ class BuyingController(StockController):
for fieldname, val in self.get_default_address_and_contact("supplier").items():
if not self.doc.fields.get(fieldname) and self.meta.get_field(fieldname):
self.doc.fields[fieldname] = val
self.set_missing_item_details(get_item_details)
def set_supplier_defaults(self):