mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
[ADD] - Add multi-company to forecasts
This commit is contained in:
18
contract_forecast/migrations/12.0.1.0.1/post-migration.py
Normal file
18
contract_forecast/migrations/12.0.1.0.1/post-migration.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Copyright 2019 ACSONE SA/NV
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
import logging
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def migrate(cr, version):
|
||||
"""Set company_id for all forecasts"""
|
||||
_logger.info("Set company_id for all forecasts")
|
||||
cr.execute("""
|
||||
UPDATE contract_line_forecast_period AS forecast
|
||||
SET company_id=contract.company_id
|
||||
FROM account_analytic_account AS contract
|
||||
WHERE forecast.contract_id=contract.id
|
||||
AND forecast.contract_id IS NOT NULL
|
||||
""")
|
||||
Reference in New Issue
Block a user