Skip to content

Commit d7303d3

Browse files
authored
fix: don't try to create item barcode if it already exists on save (#330)
1 parent d164646 commit d7303d3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

beam/beam/doctype/handling_unit/handling_unit.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ def autoname(self):
1212
self.handling_unit_name = self.name = str(uuid.uuid4().int >> 64)
1313

1414
def validate(self):
15+
if frappe.db.exists("Item Barcode", {"barcode": self.name, "parent": self.name}):
16+
return
1517
barcode = frappe.new_doc("Item Barcode")
1618
barcode.parenttype = "Handling Unit"
1719
barcode.barcode_type = "Code128"

0 commit comments

Comments
 (0)