Merge pull request #21661 from marination/barcode-update

fix: Item Barcode stays the same after updating.
This commit is contained in:
rohitwaghchaure 2020-05-11 11:01:01 +05:30 committed by GitHub
commit f6c7461eb8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -572,6 +572,13 @@ class Item(WebsiteGenerator):
frappe.throw(_("Barcode {0} is not a valid {1} code").format( frappe.throw(_("Barcode {0} is not a valid {1} code").format(
item_barcode.barcode, item_barcode.barcode_type), InvalidBarcode) item_barcode.barcode, item_barcode.barcode_type), InvalidBarcode)
if item_barcode.barcode != item_barcode.name:
# if barcode is getting updated , the row name has to reset.
# Delete previous old row doc and re-enter row as if new to reset name in db.
item_barcode.set("__islocal", True)
item_barcode.name = None
frappe.delete_doc("Item Barcode", item_barcode.name)
def validate_warehouse_for_reorder(self): def validate_warehouse_for_reorder(self):
'''Validate Reorder level table for duplicate and conditional mandatory''' '''Validate Reorder level table for duplicate and conditional mandatory'''
warehouse = [] warehouse = []