Skip to content

[19.0][IMP] Update substates properly when state field is computed#1236

Merged
OCA-git-bot merged 1 commit into
OCA:19.0from
camptocamp:19.0-imp-base_substate
Mar 4, 2026
Merged

[19.0][IMP] Update substates properly when state field is computed#1236
OCA-git-bot merged 1 commit into
OCA:19.0from
camptocamp:19.0-imp-base_substate

Conversation

@Camille0907
Copy link
Copy Markdown

@Camille0907 Camille0907 commented Feb 5, 2026

If the state field on which the substate is based is computed, its update does not goes through write or create methods. In that cas we need to take care of the substate in _compute_field_value.

As an example, you can check stock_picking_batch_substate: the batch state is computed in some cases (all picking set to done or cancel).

Unit tests have been adapted to check this case.

@Camille0907 Camille0907 force-pushed the 19.0-imp-base_substate branch from 4f17b6f to 6f2f147 Compare February 6, 2026 10:09
If the state field on which the substate is based is computed, its update does not goes through `write` or `create` methods.
In that cas we need to take care of the substate in ``_compute_field_value``.

As an example, you can check [batch_substate](OCA/stock-logistics-workflow#2244): the batch state is computed in some cases (all picking set to done or cancel).

Unit tests have been adapted to check this case.
@Camille0907 Camille0907 force-pushed the 19.0-imp-base_substate branch from 6f2f147 to 98d9bd2 Compare February 6, 2026 13:58
@OCA-git-bot
Copy link
Copy Markdown
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

Copy link
Copy Markdown
Member

@StefanRijnhart StefanRijnhart left a comment

Choose a reason for hiding this comment

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

/ocabot merge patch

@OCA-git-bot
Copy link
Copy Markdown
Contributor

Hey, thanks for contributing! Proceeding to merge this for you.
Prepared branch 19.0-ocabot-merge-pr-1236-by-StefanRijnhart-bump-patch, awaiting test results.

@OCA-git-bot
Copy link
Copy Markdown
Contributor

Congratulations, your PR was merged at a3bd477. Thanks a lot for contributing to OCA. ❤️

@OCA-git-bot OCA-git-bot merged commit ed4e969 into OCA:19.0 Mar 4, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants