- make barcode mandatory if child row is added
- check valid barcode only if exists
This commit is contained in:
parent
ff7d73e418
commit
43372d3333
@ -486,6 +486,7 @@ class Item(WebsiteGenerator):
|
|||||||
from stdnum import ean
|
from stdnum import ean
|
||||||
if len(self.barcodes) > 0:
|
if len(self.barcodes) > 0:
|
||||||
for item_barcode in self.barcodes:
|
for item_barcode in self.barcodes:
|
||||||
|
if item_barcode.barcode:
|
||||||
duplicate = frappe.db.sql("""select parent from `tabItem Barcode` where barcode = %s and parent != %s""", (item_barcode.barcode, self.name))
|
duplicate = frappe.db.sql("""select parent from `tabItem Barcode` where barcode = %s and parent != %s""", (item_barcode.barcode, self.name))
|
||||||
if duplicate:
|
if duplicate:
|
||||||
frappe.throw(_("Barcode {0} already used in Item {1}").format(
|
frappe.throw(_("Barcode {0} already used in Item {1}").format(
|
||||||
|
|||||||
@ -38,7 +38,7 @@
|
|||||||
"read_only": 0,
|
"read_only": 0,
|
||||||
"remember_last_selected_value": 0,
|
"remember_last_selected_value": 0,
|
||||||
"report_hide": 0,
|
"report_hide": 0,
|
||||||
"reqd": 0,
|
"reqd": 1,
|
||||||
"search_index": 0,
|
"search_index": 0,
|
||||||
"set_only_once": 0,
|
"set_only_once": 0,
|
||||||
"unique": 1
|
"unique": 1
|
||||||
@ -85,7 +85,7 @@
|
|||||||
"issingle": 0,
|
"issingle": 0,
|
||||||
"istable": 1,
|
"istable": 1,
|
||||||
"max_attachments": 0,
|
"max_attachments": 0,
|
||||||
"modified": "2017-12-10 19:45:08.634821",
|
"modified": "2017-12-10 20:55:23.814039",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Stock",
|
"module": "Stock",
|
||||||
"name": "Item Barcode",
|
"name": "Item Barcode",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user