ERP: unique index item_code, dokumentasi README, migration script update
This commit is contained in:
@@ -1,6 +1,12 @@
|
||||
import re
|
||||
|
||||
# Migration: isi code kategori & item_code produk untuk data existing
|
||||
env.cr.execute(
|
||||
"CREATE UNIQUE INDEX IF NOT EXISTS product_template_item_code_uniq "
|
||||
"ON product_template (item_code) WHERE item_code IS NOT NULL"
|
||||
)
|
||||
env.cr.commit()
|
||||
|
||||
cats = env['product.category'].search([])
|
||||
for c in cats:
|
||||
if not c.code:
|
||||
|
||||
Reference in New Issue
Block a user