File tree Expand file tree Collapse file tree 6 files changed +59
-28
lines changed
Expand file tree Collapse file tree 6 files changed +59
-28
lines changed Original file line number Diff line number Diff line change 11from . import models
2- from .hooks import pre_init_hook
Original file line number Diff line number Diff line change 77 "development_status" : "Beta" ,
88 "category" : "Product" ,
99 "summary" : "This module binds a product packaging to a packaging level" ,
10- "author" : "Camptocamp, " " Odoo Community Association (OCA)" ,
10+ "author" : "Camptocamp, Odoo Community Association (OCA)" ,
1111 "website" : "https://github.com/OCA/product-attribute" ,
1212 "license" : "LGPL-3" ,
1313 "depends" : ["product" , "stock" ],
2121 "installable" : True ,
2222 "auto_install" : False ,
2323 "external_dependencies" : {"python" : ["openupgradelib" ]},
24- "pre_init_hook" : "pre_init_hook" ,
2524}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ <?xml version =' 1.0' encoding =' utf-8' ?>
2+ <odoo >
3+ <record id =" product_packaging_level_default" model =" product.packaging.level" >
4+ <field name =" name" >Default Level</field >
5+ </record >
6+ </odoo >
Original file line number Diff line number Diff line change 1+ # Copyright 2025 ForgeFlow S.L. (https://www.forgeflow.com)
2+ # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
4+ from openupgradelib import openupgrade
5+
6+
7+ @openupgrade .migrate ()
8+ def migrate (env , version ):
9+ openupgrade .load_data (
10+ env , "product_packaging_level" , "16.0.1.0.0/noupdate_changes.xml"
11+ )
12+ openupgrade .delete_record_translations (
13+ env .cr ,
14+ "product_packaging_level" ,
15+ ["product_packaging_level_default" ],
16+ ["name" ],
17+ )
Original file line number Diff line number Diff line change 1+ # Copyright 2022 ACSONE SA/NV
2+ # Copyright 2025 ForgeFlow S.L. (https://www.forgeflow.com)
3+ # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html)
4+ from openupgradelib import openupgrade
5+
6+
7+ @openupgrade .migrate ()
8+ def migrate (env , version ):
9+ if not openupgrade .table_exists (env .cr , "product_packaging_type" ):
10+ return
11+ # Former version of the module is present
12+ openupgrade .rename_models (
13+ env .cr , [("product.packaging.type" , "product.packaging.level" )]
14+ )
15+ openupgrade .rename_tables (
16+ env .cr , [("product_packaging_type" , "product_packaging_level" )]
17+ )
18+ fields = [
19+ (
20+ "product.packaging" ,
21+ "product_packaging" ,
22+ "packaging_type_id" ,
23+ "packaging_level_id" ,
24+ )
25+ ]
26+ openupgrade .rename_fields (env , fields , no_deep = True )
27+ openupgrade .rename_xmlids (
28+ env .cr ,
29+ [
30+ (
31+ "product_packaging_level.product_packaging_type_default" ,
32+ "product_packaging_level.product_packaging_level_default" ,
33+ )
34+ ],
35+ )
You can’t perform that action at this time.
0 commit comments