You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
516 B

  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 migrate(cr, version):
  6. """Set company_id for all forecasts"""
  7. _logger.info("Set company_id for all forecasts")
  8. cr.execute("""
  9. UPDATE contract_line_forecast_period AS forecast
  10. SET company_id=contract.company_id
  11. FROM contract_contract AS contract
  12. WHERE forecast.contract_id=contract.id
  13. AND forecast.contract_id IS NOT NULL
  14. """)