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
Original file line number Diff line number Diff line change
@@ -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")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure about this?

I think this could be a source of functional discrepancies, new lines will start having this default but only in migrated databases that went through this migration script. What do you think about setting as default at field declaration instead?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I'm sure, as this is only for migrated DBs. Users of these DBs are used to create pricelist items without having to mark any check for having that behavior, and if this default is not put, they will have differences between the old and new pricelist items. If they are aware, they will ask for removing it, or they will uncheck it when needed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If changing this default now, current users of 17 will have a change of behavior comparable to the migrated users.