Skip to content

[16.0][IMP] shopfloor: multi company - #1290

Merged
OCA-git-bot merged 2 commits into
OCA:16.0from
mt-software-de:16-shopfloor-multi-company
Oct 6, 2026
Merged

OCA-git-bot merged 2 commits into
OCA:16.0from
mt-software-de:16-shopfloor-multi-company

Conversation

@mt-software-de

@mt-software-de mt-software-de commented Oct 2, 2026 •

Copy link
Copy Markdown

Make the shopfloor services work with the companies of the current menu, for the whole request.

This replaces the approach from #1133 (14.0) and its forward port #1142, following the review in #1133 (comment). Instead of overriding env on the base.shopfloor.process component, allowed_company_ids is now set once on the request env in the controller.

shopfloor_base

  • New hook shopfloor.menu._get_allowed_companies(). It returns no companies by default, meaning no restriction.
  • ShopfloorController overrides the new base_rest hook _get_collection_env_context(). It reads the menu from the SERVICE-CTX-MENU-ID header and sets allowed_company_ids to the menu's companies that the user belongs to. If the header is missing or invalid, the context is left untouched; the services still validate the header themselves.

shopfloor

  • _get_allowed_companies() returns the companies of the menu's picking types.

Depends on:

Supersedes #1142.

cc @simahawk @nicolas-delbovier-acsone @jbaudoux

@OCA-git-bot

Copy link
Copy Markdown
Contributor

Hi @simahawk, @sebalix, @mmequignon, @TDu, @jbaudoux,
some modules you are maintaining are being modified, check this out!

@mt-software-de

Copy link
Copy Markdown
Author

@simahawk @jbaudoux if we can agree on this approach, i would prepare the PR's for v18

@simahawk simahawk left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nice, thanks!

@mt-software-de

Copy link
Copy Markdown
Author

cc @nicolas-delbovier-acsone

@mt-software-de
mt-software-de force-pushed the 16-shopfloor-multi-company branch from 5afae3b to c1b855e Compare October 6, 2026 11:05
@mt-software-de

Copy link
Copy Markdown
Author

@jbaudoux This is now ready to merge.

@jbaudoux

jbaudoux commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

/ocabot merge minor

@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-1290-by-jbaudoux-bump-minor, awaiting test results.

@OCA-git-bot
OCA-git-bot merged commit 6f5330b into OCA:16.0 Oct 6, 2026
6 of 7 checks passed
@OCA-git-bot

Copy link
Copy Markdown
Contributor

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

5 participants