fix: add (uom, brand) Item details in an Item Price (#27561)
* fix: add (uom, brand) and update (uom) Item details in an Item Price * fix: order of query interpolation args Co-authored-by: Marica <maricadsouza221197@gmail.com> * fix: named interpolation, remove item price * fix: sql error Co-authored-by: Marica <maricadsouza221197@gmail.com> Co-authored-by: Ankush Menat <ankush@iwebnotes.com>
This commit is contained in:
parent
ad03eb25df
commit
7da777880b
@ -181,6 +181,8 @@ class Item(WebsiteGenerator):
|
|||||||
"doctype": "Item Price",
|
"doctype": "Item Price",
|
||||||
"price_list": price_list,
|
"price_list": price_list,
|
||||||
"item_code": self.name,
|
"item_code": self.name,
|
||||||
|
"uom": self.stock_uom,
|
||||||
|
"brand": self.brand,
|
||||||
"currency": erpnext.get_default_currency(),
|
"currency": erpnext.get_default_currency(),
|
||||||
"price_list_rate": self.standard_rate
|
"price_list_rate": self.standard_rate
|
||||||
})
|
})
|
||||||
@ -634,9 +636,21 @@ class Item(WebsiteGenerator):
|
|||||||
_("An Item Group exists with same name, please change the item name or rename the item group"))
|
_("An Item Group exists with same name, please change the item name or rename the item group"))
|
||||||
|
|
||||||
def update_item_price(self):
|
def update_item_price(self):
|
||||||
frappe.db.sql("""update `tabItem Price` set item_name=%s,
|
frappe.db.sql("""
|
||||||
item_description=%s, brand=%s where item_code=%s""",
|
UPDATE `tabItem Price`
|
||||||
(self.item_name, self.description, self.brand, self.name))
|
SET
|
||||||
|
item_name=%(item_name)s,
|
||||||
|
item_description=%(item_description)s,
|
||||||
|
brand=%(brand)s
|
||||||
|
WHERE item_code=%(item_code)s
|
||||||
|
""",
|
||||||
|
dict(
|
||||||
|
item_name=self.item_name,
|
||||||
|
item_description=self.description,
|
||||||
|
brand=self.brand,
|
||||||
|
item_code=self.name
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
def on_trash(self):
|
def on_trash(self):
|
||||||
super(Item, self).on_trash()
|
super(Item, self).on_trash()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user