[cleanup] [minor] price list field rename (wip), set default supplier from item, make demo - purchase cycle (wip)

This commit is contained in:
Rushabh Mehta
2013-08-09 15:29:59 +05:30
parent be64070ed9
commit 0b9954059c
25 changed files with 158 additions and 72 deletions

View File

@@ -30,6 +30,7 @@ class BuyingController(StockController):
def set_missing_values(self, for_validate=False):
super(BuyingController, self).set_missing_values(for_validate)
self.set_supplier_from_item_default()
self.set_price_list_currency("Buying")
# set contact and address details for supplier, if they are not mentioned
@@ -40,6 +41,14 @@ class BuyingController(StockController):
self.set_missing_item_details(get_item_details)
def set_supplier_from_item_default(self):
if self.meta.get_field("supplier") and not self.doc.supplier:
for d in self.doclist.get({"doctype": self.tname}):
supplier = webnotes.conn.get_value("Item", d.item_code, "default_supplier")
if supplier:
self.doc.supplier = supplier
break
def get_purchase_tax_details(self):
self.doclist = self.doc.clear_table(self.doclist, "purchase_tax_details")
self.set_taxes("purchase_tax_details", "purchase_other_charges")