Skip to content

[18.0][FIX] product_multi_company: keep company_ids on variant write - #1055

Merged
OCA-git-bot merged 1 commit into
OCA:18.0from
ForgeFlow:18.0-fix-product-variant-company-ids
Sep 14, 2026
Merged

OCA-git-bot merged 1 commit into
OCA:18.0from
ForgeFlow:18.0-fix-product-variant-company-ids

Conversation

@LoisRForgeFlow

Copy link
Copy Markdown
Contributor

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.

@OCA-git-bot OCA-git-bot added series:18.0 mod:product_multi_company Module product_multi_company labels Sep 10, 2026
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

Copy link
Copy Markdown
Contributor Author

/ocabot merge patch

@OCA-git-bot

Copy link
Copy Markdown
Contributor

Hey, thanks for contributing! Proceeding to merge this for you.
Prepared branch 18.0-ocabot-merge-pr-1055-by-LoisRForgeFlow-bump-patch, awaiting test results.

@OCA-git-bot
OCA-git-bot merged commit 77d01cb into OCA:18.0 Sep 14, 2026
7 checks passed
@OCA-git-bot

Copy link
Copy Markdown
Contributor

Congratulations, your PR was merged at 96f724b. 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.

4 participants