Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: OCA/delivery-carrier
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 3bb4f3955eab44f755cd05c6abb0e8857dca64ed
Choose a base ref
..
head repository: OCA/delivery-carrier
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 428c25ad57fc0e49919b37d1246c7a7467c97a05
Choose a head ref
Showing with 29 additions and 0 deletions.
  1. +29 −0 delivery_dropoff_site/migrations/14.0.1.0.0/pre-migrate.py
29 changes: 29 additions & 0 deletions delivery_dropoff_site/migrations/14.0.1.0.0/pre-migrate.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Copyright 2024 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

import logging

from openupgradelib import openupgrade

_logger = logging.getLogger(__name__)


@openupgrade.migrate()
def migrate(env, version):
_logger.info("Move final_shipping_partner_id from procurement_group to stock_move")
openupgrade.logged_query(
env.cr,
"""
ALTER TABLE stock_move
ADD COLUMN final_shipping_partner_id INTEGER
""",
)
openupgrade.logged_query(
env.cr,
"""
UPDATE stock_move sm
SET final_shipping_partner_id = pg.final_shipping_partner_id
FROM procurement_group pg
WHERE sm.group_id = pg.id
""",
)