Skip to content

Commit

Permalink
Merge pull request #3848 from Tecnativa/11.0-ou-fix-sale-TT42886
Browse files Browse the repository at this point in the history
[11.0][OU-IMP] sale: Auto-create icp from old deposit_product_id_setting field (v10) to new default_deposit_product_id field (v11)
  • Loading branch information
pedrobaeza committed May 3, 2023
2 parents 6f4ee07 + 70539e7 commit 2e0d2ba
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions addons/sale/migrations/11.0.1.1/post-migration.py
Expand Up @@ -131,3 +131,27 @@ def migrate(env, version):
],
)
activate_proforma(env)
# Auto-create icp from old deposit_product_id_setting field (v10)
# to new default_deposit_product_id field (v11)
openupgrade.logged_query(
env.cr,
"""
INSERT INTO ir_config_parameter (
key,
value,
create_uid,
create_date,
write_uid,
write_date
) SELECT 'sale.default_deposit_product_id',
value,
create_uid,
create_date,
write_uid,
write_date
FROM ir_values AS iv
WHERE iv.model = 'sale.config.settings'
AND iv.name = 'deposit_product_id_setting'
LIMIT 1
""",
)

0 comments on commit 2e0d2ba

Please sign in to comment.