[14.0][IMP] shopfloor_base: Multi company capability#1133
[14.0][IMP] shopfloor_base: Multi company capability#1133OCA-git-bot merged 2 commits intoOCA:14.0from
Conversation
|
Hi @JuMiSanAr, @mmequignon, @guewen, @simahawk, @sebalix, |
a46e1fc to
7682920
Compare
yes i think so too. |
11e29cf to
71e06cd
Compare
I will close other PRs. |
71e06cd to
ef94af8
Compare
d89ae36 to
cd12ac3
Compare
|
/ocabot merge minor |
|
This PR looks fantastic, let's merge it! |
|
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") |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Search locations for company of picking type. Create lots with company of picking type.
Depends on #1131
cc @i-vyshnevska @raumschmiede-joshuaL @jbaudoux