Skip to content

Comments

[17.0][OU-ADD] product_pricelist_supplierinfo: Migration scripts#2212

Open
pedrobaeza wants to merge 1 commit intoOCA:17.0from
Tecnativa:17.0-ou_add-product_pricelist_supplierinfo
Open

[17.0][OU-ADD] product_pricelist_supplierinfo: Migration scripts#2212
pedrobaeza wants to merge 1 commit intoOCA:17.0from
Tecnativa:17.0-ou_add-product_pricelist_supplierinfo

Conversation

@pedrobaeza
Copy link
Member

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.

@Tecnativa TT61036

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
@pedrobaeza pedrobaeza added this to the 17.0 milestone Feb 17, 2026
@OCA-git-bot
Copy link
Contributor

Hi @luisg123v,
some modules you are maintaining are being modified, check this out!

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants