mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-07 07:02:54 +00:00
feat(Item Price): validate UOM
This commit is contained in:
@@ -56,6 +56,11 @@ class ItemPrice(Document):
|
|||||||
if not frappe.db.exists("Item", self.item_code):
|
if not frappe.db.exists("Item", self.item_code):
|
||||||
frappe.throw(_("Item {0} not found.").format(self.item_code))
|
frappe.throw(_("Item {0} not found.").format(self.item_code))
|
||||||
|
|
||||||
|
if self.uom and not frappe.db.exists(
|
||||||
|
"UOM Conversion Detail", {"parenttype": "Item", "parent": self.item_code, "uom": self.uom}
|
||||||
|
):
|
||||||
|
frappe.throw(_("UOM {0} not found in Item {1}").format(self.uom, self.item_code))
|
||||||
|
|
||||||
def validate_dates(self):
|
def validate_dates(self):
|
||||||
if self.valid_from and self.valid_upto:
|
if self.valid_from and self.valid_upto:
|
||||||
if getdate(self.valid_from) > getdate(self.valid_upto):
|
if getdate(self.valid_from) > getdate(self.valid_upto):
|
||||||
|
|||||||
Reference in New Issue
Block a user