[18.0][FIX] product_multi_company: keep company_ids on variant write - #1055
Merged
OCA-git-bot merged 1 commit intoSep 14, 2026
Merged
Conversation
The product form's header includes an invisible `company_id` field, used as a trick to be able to set that field from the view. When the web client saves, it sends both `company_id` and `company_ids` in the same write call. `product.template.write()` already protects against this collision through `_multicompany_patch_vals`, discarding the redundant `company_id` so its inverse doesn't overwrite `company_ids`. `product.product` doesn't inherit `multi.company.abstract` and lacks this protection, even though it exposes the same fields (related to the template). Saving from the variant form (e.g. reached from the MRP Area Parameters view) silently reverted `company_ids` to a single company.
LoisRForgeFlow
force-pushed
the
18.0-fix-product-variant-company-ids
branch
from
September 10, 2026 14:52
a7bce8f to
f03745a
Compare
LauraCForgeFlow
approved these changes
Sep 14, 2026
AlexPForgeFlow
approved these changes
Sep 14, 2026
Contributor
Author
|
/ocabot merge patch |
Contributor
|
Hey, thanks for contributing! Proceeding to merge this for you. |
Contributor
|
Congratulations, your PR was merged at 96f724b. Thanks a lot for contributing to OCA. ❤️ |
This was referenced Sep 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The product form's header includes an invisible
company_idfield, used as a trick to be able to set that field from the view. When the web client saves, it sends bothcompany_idandcompany_idsin the same write call.product.template.write()already protects against this collision through_multicompany_patch_vals, discarding the redundantcompany_idso its inverse doesn't overwritecompany_ids.product.productdoesn't inheritmulti.company.abstractand lacks this protection, even though it exposes the same fields (related to the template). Saving from the variant form (e.g. reached from the MRP Area Parameters view) silently revertedcompany_idsto a single company.