
- Added barcode field to stock.lot with automatic generation - Implemented unique barcode generation in format YYMMDDNNNNNNC - Added Luhn check digit for barcode validation - Handles high volume scenarios with sample type prefixes - Collision detection and retry mechanism for uniqueness - Successful test with ephemeral instance restart
11 lines
340 B
Python
11 lines
340 B
Python
import odoo
|
|
|
|
db_name = 'lims_demo'
|
|
registry = odoo.registry(db_name)
|
|
with registry.cursor() as cr:
|
|
env = odoo.api.Environment(cr, 1, {})
|
|
fields = env['stock.lot']._fields.keys()
|
|
print("Stock.lot fields containing 'name' or 'barcode':")
|
|
for f in fields:
|
|
if 'name' in f or 'barcode' in f:
|
|
print(f" - {f}") |