Files
Odoo-Modules/fusion_plating/fusion_plating_configurator/migrations/19.0.18.11.0/post-migrate.py
gsinghpal 6b7b44264a changes
2026-05-10 10:25:12 -04:00

22 lines
869 B
Python

# -*- coding: utf-8 -*-
# Copyright 2026 Nexa Systems Inc.
"""Drop the redundant ``revision_number`` Integer column on fp.part.catalog.
The model historically carried two revision fields:
* ``revision`` (Char, required) — the customer's actual revision label
* ``revision_number`` (Integer) — an internal counter
The Integer counter duplicated information already in ``revision`` and
got out of sync whenever the customer used a non-numeric scheme
(A/B/C, A1/A2, "ECO-2024-014" etc.). This migration drops the column.
``action_create_revision`` and the auto-rev path on 3D-model upload now
use ``_bump_revision_label`` which best-effort bumps the alphanumeric
label and lets the user adjust to the customer's actual scheme.
"""
def migrate(cr, version):
cr.execute("""
ALTER TABLE fp_part_catalog DROP COLUMN IF EXISTS revision_number;
""")