refactor: msgprint(raise_exception)->frappe.throw
This commit is contained in:
parent
ccbde0efa0
commit
958d485ba4
@ -516,7 +516,7 @@ class Item(WebsiteGenerator):
|
|||||||
|
|
||||||
def validate_item_type(self):
|
def validate_item_type(self):
|
||||||
if self.has_serial_no == 1 and self.is_stock_item == 0 and not self.is_fixed_asset:
|
if self.has_serial_no == 1 and self.is_stock_item == 0 and not self.is_fixed_asset:
|
||||||
msgprint(_("'Has Serial No' can not be 'Yes' for non-stock item"), raise_exception=1)
|
frappe.throw(_("'Has Serial No' can not be 'Yes' for non-stock item"))
|
||||||
|
|
||||||
if self.has_serial_no == 0 and self.serial_no_series:
|
if self.has_serial_no == 0 and self.serial_no_series:
|
||||||
self.serial_no_series = None
|
self.serial_no_series = None
|
||||||
@ -1269,7 +1269,7 @@ def get_uom_conv_factor(uom, stock_uom):
|
|||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def get_item_attribute(parent, attribute_value=''):
|
def get_item_attribute(parent, attribute_value=''):
|
||||||
if not frappe.has_permission("Item"):
|
if not frappe.has_permission("Item"):
|
||||||
frappe.msgprint(_("No Permission"), raise_exception=1)
|
frappe.throw(_("No Permission"))
|
||||||
|
|
||||||
return frappe.get_all("Item Attribute Value", fields = ["attribute_value"],
|
return frappe.get_all("Item Attribute Value", fields = ["attribute_value"],
|
||||||
filters = {'parent': parent, 'attribute_value': ("like", "%%%s%%" % attribute_value)})
|
filters = {'parent': parent, 'attribute_value': ("like", "%%%s%%" % attribute_value)})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user