mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-30 17:42:32 +02:00
fix: not able to save item because price list has disabled (#18965)
This commit is contained in:
committed by
Nabin Hait
parent
b53e4404dc
commit
9c428ebfba
@@ -32,10 +32,16 @@ class ItemPrice(Document):
|
||||
|
||||
def update_price_list_details(self):
|
||||
if self.price_list:
|
||||
self.buying, self.selling, self.currency = \
|
||||
frappe.db.get_value("Price List",
|
||||
{"name": self.price_list, "enabled": 1},
|
||||
["buying", "selling", "currency"])
|
||||
price_list_details = frappe.db.get_value("Price List",
|
||||
{"name": self.price_list, "enabled": 1},
|
||||
["buying", "selling", "currency"])
|
||||
|
||||
if not price_list_details:
|
||||
link = frappe.utils.get_link_to_form('Price List', self.price_list)
|
||||
frappe.throw("The price list {0} does not exists or disabled".
|
||||
format(link))
|
||||
|
||||
self.buying, self.selling, self.currency = price_list_details
|
||||
|
||||
def update_item_details(self):
|
||||
if self.item_code:
|
||||
|
||||
Reference in New Issue
Block a user