Skip to content
Open
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
14 changes: 10 additions & 4 deletions openupgrade_scripts/scripts/stock/18.0.1.1/end-migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,18 @@


def fill_stock_picking_type_default_locations(env):
picking_types = env["stock.picking.type"].search(
[("default_location_src_id", "=", False)]
# active_test=False: archived picking types need the fill too, otherwise
# the SET NOT NULL on both columns (required since 18.0) keeps failing
picking_types = (
env["stock.picking.type"]
.with_context(active_test=False)
.search([("default_location_src_id", "=", False)])
)
picking_types._compute_default_location_src_id()
picking_types = env["stock.picking.type"].search(
[("default_location_dest_id", "=", False)]
picking_types = (
env["stock.picking.type"]
.with_context(active_test=False)
.search([("default_location_dest_id", "=", False)])
)
picking_types._compute_default_location_dest_id()

Expand Down
Loading