Skip to content

[14.0][IMP] shopfloor_base: Multi company capability#1133

Merged
OCA-git-bot merged 2 commits intoOCA:14.0from
mt-software-de:14-reception-company
Mar 12, 2026
Merged

[14.0][IMP] shopfloor_base: Multi company capability#1133
OCA-git-bot merged 2 commits intoOCA:14.0from
mt-software-de:14-reception-company

Conversation

@mt-software-de
Copy link
Copy Markdown

@mt-software-de mt-software-de commented Feb 17, 2026

Search locations for company of picking type. Create lots with company of picking type.

Depends on #1131

cc @i-vyshnevska @raumschmiede-joshuaL @jbaudoux

@OCA-git-bot
Copy link
Copy Markdown
Contributor

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

Comment thread shopfloor_reception/services/reception.py Outdated
@jbaudoux
Copy link
Copy Markdown
Contributor

cc @nicolas-delbovier-acsone

Copy link
Copy Markdown
Contributor

@jbaudoux jbaudoux left a comment

Choose a reason for hiding this comment

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

Much better :)

@mt-software-de
Copy link
Copy Markdown
Author

Much better :)

yes i think so too.

@mt-software-de
Copy link
Copy Markdown
Author

Much better :)

I will close other PRs.

@mt-software-de mt-software-de changed the title [14.0][IMP] shopfloor_reception: Multi company capability [14.0][IMP] shopfloor_base: Multi company capability Mar 12, 2026
@jbaudoux
Copy link
Copy Markdown
Contributor

/ocabot merge minor

@OCA-git-bot
Copy link
Copy Markdown
Contributor

This PR looks fantastic, let's merge it!
Prepared branch 14.0-ocabot-merge-pr-1133-by-jbaudoux-bump-minor, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 0a3a76a into OCA:14.0 Mar 12, 2026
9 of 11 checks passed
@OCA-git-bot
Copy link
Copy Markdown
Contributor

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

def env(self):
env = super().env()
if (
not hasattr(self, "work")
Copy link
Copy Markdown

@simahawk simahawk Mar 13, 2026

Choose a reason for hiding this comment

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

Sorry, I'm late to the party but TBH I don't like this implementation 😞

There's no need for these checks. Also, the work context will always be initialized properly before you use the env and on such "process" services the menu will always be set. In the context of shopfloor the picking types as well will be always set as it's mandatory on the menu items -> this change should stay in shopfloor if really needed.

A better approach would have been to allow the component to explicitly provide the allowed companies where needed and then override this in shopfloor.

Another place, probably even better, is this https://github.com/OCA/rest-framework/blob/18.0/base_rest/controllers/main.py#L170 where the env is initialized for the whole request and not just for this component.

In the entire application the menu comes from the header HTTP_SERVICE_CTX_MENU_ID which can be used there to inject the right companies.

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.

Thx for your input. No problem i have no problem to change this again. :-)
The checks were only implemented for unittests.

I will check your suggestions.

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.

6 participants