Skip to content

[16.0][FIX] sale_stock_picking_blocking: Do not compute blocking_id on create()#3906

Merged
OCA-git-bot merged 1 commit intoOCA:16.0from
Therp:16.0-sale_stock_picking_blocking_fix
Sep 26, 2025
Merged

[16.0][FIX] sale_stock_picking_blocking: Do not compute blocking_id on create()#3906
OCA-git-bot merged 1 commit intoOCA:16.0from
Therp:16.0-sale_stock_picking_blocking_fix

Conversation

@ntsirintanis
Copy link
Copy Markdown

This tackles this bug:

#3815

for version 16.0

@ntsirintanis ntsirintanis changed the title [FIX] sale_stock_picking_blocking: Do not compute blocking_id on create() [16.0][FIX] sale_stock_picking_blocking: Do not compute blocking_id on create() Sep 25, 2025
Copy link
Copy Markdown

@NL66278 NL66278 left a comment

Choose a reason for hiding this comment

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

👍 LGTM

return True

@api.model_create_multi
def create(self, vals_list):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@ntsirintanis Could you try adding precompute=True to the field instead ?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@rousseldenis thank you very very much, it works. But why?

Copy link
Copy Markdown
Contributor

@rousseldenis rousseldenis Sep 25, 2025

Choose a reason for hiding this comment

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

Because... it precomputes field value before creating record in DB. 😅

https://github.com/odoo/odoo/blob/16.0/odoo/fields.py#L232

@NL66278
Copy link
Copy Markdown

NL66278 commented Sep 25, 2025

@ntsirintanis Please squash commits, as the second completely undoes the first and then adds the concise solution.

@ntsirintanis ntsirintanis force-pushed the 16.0-sale_stock_picking_blocking_fix branch from 17bdd74 to 6ce9bc5 Compare September 26, 2025 07:07
@rousseldenis
Copy link
Copy Markdown
Contributor

/ocabot merge patch

@OCA-git-bot
Copy link
Copy Markdown
Contributor

Hey, thanks for contributing! Proceeding to merge this for you.
Prepared branch 16.0-ocabot-merge-pr-3906-by-rousseldenis-bump-patch, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit bc03b9e into OCA:16.0 Sep 26, 2025
15 checks passed
@OCA-git-bot
Copy link
Copy Markdown
Contributor

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

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.

[18.0] sale_stock_picking_blocking saving the SO the first time removes blocking reason

4 participants