[fix] item.py
This commit is contained in:
parent
083dabaaf8
commit
8e5dcd06fb
@ -632,10 +632,9 @@ class Item(WebsiteGenerator):
|
|||||||
frappe.throw(_("Item has variants."))
|
frappe.throw(_("Item has variants."))
|
||||||
|
|
||||||
def validate_stock_exists_for_template_item(self):
|
def validate_stock_exists_for_template_item(self):
|
||||||
if self.stock_ledger_created():
|
if self.stock_ledger_created() and self._doc_before_save:
|
||||||
if (self._doc_before_save
|
if (self._doc_before_save.has_variants != self.has_variants
|
||||||
and (self._doc_before_save.has_variants != self.has_variants
|
or self._doc_before_save.variant_of != self.variant_of):
|
||||||
or self._doc_before_save.variant_of != self.variant_of)):
|
|
||||||
frappe.throw(_("Cannot change Variant properties after stock transction. You will have to make a new Item to do this.").format(self.name),
|
frappe.throw(_("Cannot change Variant properties after stock transction. You will have to make a new Item to do this.").format(self.name),
|
||||||
StockExistsForTemplate)
|
StockExistsForTemplate)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user