I have modified
item.py by adding following lines to
if self.barcode == "auto": existing = frappe.db.sql("""select barcode from tabItem""", as_list=True) self.barcode = random.choice([item for item in range(1000,10000) if item not in existing])
However, barcode remains as ‘auto’ instead of getting updated. What am I doing wrong?
Here’s the modified file for reference: https://gist.github.com/anonymous/6e69ba4a1ab855ca6a57df73f639c659