Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] ir_config_parameter_multi_company: hook to avoid error with CRM #763

Open
wants to merge 1 commit into
base: 16.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ir_config_parameter_multi_company/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
from . import models
from .hooks import pre_init_hook
1 change: 1 addition & 0 deletions ir_config_parameter_multi_company/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@
"data": ["views/ir_config_parameter_view.xml", "security/parameter_security.xml"],
"images": [],
"installable": True,
"pre_init_hook": "pre_init_hook",
}
15 changes: 15 additions & 0 deletions ir_config_parameter_multi_company/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# # Copyright 2019 ACSONE SA/NV
# # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import logging

_logger = logging.getLogger(__name__)


def pre_init_hook(cr):
_logger.info("Pre-creating column company_id for table ir_config_parameter")
cr.execute(
"""
ALTER TABLE ir_config_parameter
ADD COLUMN IF NOT EXISTS company_id INTEGER;
"""
)
Loading