Skip to content

[16.0][OU-FIX] stock: keep lots setting enabled - #6065

Open
celm1990 wants to merge 1 commit into
OCA:16.0from
celm1990:16.0-ou-imp-stock-lot-portal-group
Open

celm1990 wants to merge 1 commit into
OCA:16.0from
celm1990:16.0-ou-imp-stock-lot-portal-group

Conversation

@celm1990

@celm1990 celm1990 commented Oct 23, 2026 •

Copy link
Copy Markdown

In v16, the setting group_stock_production_lot is linked to internal and portal users (group="base.group_user,base.group_portal"; see https://github.com/odoo/odoo/blob/e46fb655deed825c8a3557cb7080839daedb2dfe/addons/stock/models/res_config_settings.py#L14), but in v15 it was only linked to internal users. As the setting is only True when all the groups imply stock.group_production_lot, it appears disabled after the migration. Add the implied group to portal users when it was enabled.

Steps to reproduce:
In a v15 database, install the stock module and enable the Lots & Serial Numbers setting:
image

Migrate the database and go to Settings: the Lots & Serial Numbers setting is disabled.
image

The users aren't removed from the group, but having this setting disabled has some implications. For example in V18, after the migration, if you have the product_expiry module installed, it can be uninstalled when you save the settings. See: https://github.com/odoo/odoo/blob/4d8930a92605ee724a15e26805ff5266d56964cf/addons/stock/models/res_config_settings.py#L65

In a fresh database created in v16, you can see that the Portal group has the inherited group Manage Lots / Serial Numbers:
image

But before this commit, the Portal group doesn't have the inherited group:
image

@pedrobaeza @hbrunn @MiquelRForgeFlow could you please review this?

In v16, the setting group_stock_production_lot is linked to internal and
portal users (group="base.group_user,base.group_portal"), but in v15 it
was only linked to internal users. As the setting is only True when all
the groups imply stock.group_production_lot, it appears disabled after
the migration. Add the implied group to portal users when it was enabled.
@OCA-git-bot OCA-git-bot added mod:openupgrade_scripts Module openupgrade_scripts series:16.0 labels Oct 23, 2026
@pedrobaeza

Copy link
Copy Markdown
Member

Isn't this the same as #5926 ?

This branch has not been deployed

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

Labels

mod:openupgrade_scripts Module openupgrade_scripts series:16.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants