Skip to content

Commit e1c42af

Browse files
[IMP] ir_config_parameter_multi_company: hooks
1 parent 64153a7 commit e1c42af

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

Diff for: ir_config_parameter_multi_company/__manifest__.py

+1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@
1111
"data": ["views/ir_config_parameter_view.xml", "security/parameter_security.xml"],
1212
"images": [],
1313
"installable": True,
14+
"pre_init_hook": "pre_init_hook",
1415
}

Diff for: ir_config_parameter_multi_company/hooks.py

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Copyright 2019 ACSONE SA/NV
2+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
3+
import logging
4+
_logger = logging.getLogger(__name__)
5+
def pre_init_hook(cr):
6+
_logger.info("Pre-creating column company_id for table ir_config_parameter")
7+
cr.execute(
8+
"""
9+
ALTER TABLE ir_config_parameter
10+
ADD COLUMN IF NOT EXISTS company_id INTEGER;
11+
"""
12+
)

0 commit comments

Comments
 (0)