- Add sequence field (default 10) to product.category with _order = "sequence, name" - Inherit product.category tree view to add drag-handle widget - Sort category hierarchy and available categories by sequence in controller - Migration 18.0.1.9.0: add sequence column to product_category table - Bump version to 18.0.1.9.0
13 lines
419 B
Python
13 lines
419 B
Python
"""Add sequence field to product.category.
|
|
|
|
Ensures the sequence column exists with a default of 10 for all existing rows.
|
|
The ORM will also handle this on upgrade, but we add it explicitly so the
|
|
column is present before any post-install logic runs.
|
|
"""
|
|
|
|
|
|
def migrate(cr, version):
|
|
cr.execute("""
|
|
ALTER TABLE product_category
|
|
ADD COLUMN IF NOT EXISTS sequence INTEGER NOT NULL DEFAULT 10;
|
|
""")
|