[fix] [minor] fetch item and price list details on saving item price

This commit is contained in:
Nabin Hait 2013-10-26 15:06:09 +05:30 committed by Anand Doshi
parent ed3dc56da4
commit dc89acaf05

View File

@ -13,23 +13,18 @@ class DocType:
def __init__(self, d, dl):
self.doc, self.doclist = d, dl
def on_update(self):
def validate(self):
self.check_duplicate_item()
self.update_price_list_details()
self.update_item_details()
self.check_duplicate_item()
def update_price_list_details(self):
self.doc.buying_or_selling = webnotes.conn.get_value("Price List", self.doc.price_list,
"buying_or_selling")
self.doc.currency = webnotes.conn.get_value("Price List", self.doc.price_list,
"currency")
self.doc.buying_or_selling, self.doc.currency = webnotes.conn.get_value("Price List",
self.doc.price_list, ["buying_or_selling", "currency"])
def update_item_details(self):
self.doc.item_name = webnotes.conn.get_value("Item", self.doc.item_code, "item_name")
self.doc.item_description = webnotes.conn.get_value("Item", self.doc.item_code,
"description")
self.doc.item_name, self.doc.item_description = webnotes.conn.get_value("Item",
self.doc.item_code, ["item_name", "description"])
def check_duplicate_item(self):
if webnotes.conn.sql("""select name from `tabItem Price`