Skip to content
Merged
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
11 changes: 10 additions & 1 deletion addons/point_of_sale/migrations/13.0.1.0.1/post-migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,21 @@ def create_pos_picking_types(env):
env["pos.config"].browse(config_ids),
location_ids
):
config.picking_type_id = config.picking_type_id.copy({
picking_type = config.picking_type_id.copy({
"name": "[OU] {} - {}".format(
config.picking_type_id.name, config.name
),
"default_location_src_id": location_id,
})
# Update via SQL to avoid possible open sessions errors. They shouldn't be open
# but if only is they'd spoil the whole migration
env.cr.execute(
"""
UPDATE pos_config
SET picking_type_id = %s WHERE id = %s
""",
(picking_type.id, config.id),
)


@openupgrade.migrate()
Expand Down