fix: not checking all fields
`break` will break out of the loop without checking remaining fields.
diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py
index b665eb8..d09a4aa 100644
--- a/erpnext/stock/doctype/item/item.py
+++ b/erpnext/stock/doctype/item/item.py
@@ -965,9 +965,7 @@
if values:
for field in fields:
if cstr(self.get(field)) != cstr(values.get(field)):
- if not self.check_if_linked_document_exists(field):
- break # no linked document, allowed
- else:
+ if self.check_if_linked_document_exists(field):
frappe.throw(_("As there are existing transactions against item {0}, you can not change the value of {1}").format(self.name, frappe.bold(self.meta.get_label(field))))
def check_if_linked_document_exists(self, field):