Merge pull request #1227 from akhileshdarjee/hotfix
[fix] [minor] update item price on change of item details
This commit is contained in:
commit
e409d0d70b
@ -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, modified=NOW() 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
|
||||
|
@ -44,5 +44,5 @@ class DocType(DocListController):
|
||||
|
||||
def update_item_price(self):
|
||||
webnotes.conn.sql("""update `tabItem Price` set currency=%s,
|
||||
buying_or_selling=%s where price_list=%s""",
|
||||
buying_or_selling=%s, modified=NOW() where price_list=%s""",
|
||||
(self.doc.currency, self.doc.buying_or_selling, self.doc.name))
|
Loading…
x
Reference in New Issue
Block a user