[fix] [minor] update item price on change of item details

This commit is contained in:
Akhilesh Darjee 2013-12-23 16:13:42 +05:30
parent 68888a21ec
commit af30c3fdfd

View File

@ -49,6 +49,7 @@ class DocType(DocListController, WebsiteGenerator):
def on_update(self):
self.validate_name_with_item_group()
self.update_website()
self.update_item_price()
def check_warehouse_is_set_for_stock_item(self):
if self.doc.is_stock_item=="Yes" and not self.doc.default_warehouse:
@ -210,6 +211,11 @@ class DocType(DocListController, WebsiteGenerator):
WebsiteGenerator.on_update(self)
def update_item_price(self):
webnotes.conn.sql("""update `tabItem Price` set item_name=%s,
item_description=%s where item_code=%s""",
(self.doc.item_name, self.doc.description, self.doc.name))
def get_page_title(self):
if self.doc.name==self.doc.item_name:
page_name_from = self.doc.name