From 85535084939a89bc2fbb51ebf7e838e1d7de3c19 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Tue, 17 Feb 2026 09:28:39 +0100 Subject: [PATCH] [OU-ADD] product_pricelist_supplierinfo: Migration scripts When coming from previous versions, where the discount at product.supplierinfo were not taken into account to compute the sales price, you would expect the same for this version, so for this smooth transition, let's set the new flag for ignoring the discount in all the existing lines for preserving the previous behavior, as well as setting it as default for new items. TT61036 --- .../migrations/17.0.2.0.0/post-migration.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 product_pricelist_supplierinfo/migrations/17.0.2.0.0/post-migration.py diff --git a/product_pricelist_supplierinfo/migrations/17.0.2.0.0/post-migration.py b/product_pricelist_supplierinfo/migrations/17.0.2.0.0/post-migration.py new file mode 100644 index 00000000000..d6dc4ccf178 --- /dev/null +++ b/product_pricelist_supplierinfo/migrations/17.0.2.0.0/post-migration.py @@ -0,0 +1,12 @@ +# Copyright 2026 Tecnativa - Pedro M. Baeza +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl-3.0) +from openupgradelib import openupgrade + + +@openupgrade.migrate() +def migrate(env, version): + openupgrade.logged_query( + env.cr, + "UPDATE product_pricelist_item SET no_supplierinfo_discount=True", + ) + env["ir.default"].set("product.pricelist.item", "no_supplierinfo_discount", "true")