Skip to content

Commit 667eb5e

Browse files
committed
Merge PR #25 into 18.0
Signed-off-by jbaudoux
2 parents 2a4430f + 654b3ee commit 667eb5e

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

shopfloor_base/services/service.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Copyright 2020 Camptocamp SA (http://www.camptocamp.com)
22
# Copyright 2020 Akretion (http://www.akretion.com)
3+
# Copyright 2026 Michael Tietz (MT Software) <mtietz@mt-software.de>
34
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
45

56
from werkzeug.exceptions import BadRequest
@@ -304,3 +305,23 @@ class BaseShopfloorProcess(AbstractComponent):
304305

305306
_requires_header_menu = True
306307
_requires_header_profile = True
308+
309+
@property
310+
def env(self):
311+
env = super().env()
312+
if (
313+
not hasattr(self, "work")
314+
or not hasattr(self.work, "menu")
315+
or not hasattr(self.work.menu, "picking_type_ids")
316+
):
317+
return env
318+
company = self.work.menu.picking_type_ids.company_id
319+
if not company:
320+
return env
321+
context = dict(self.collection.env.context)
322+
context.update(
323+
{
324+
"allowed_company_ids": company.ids,
325+
}
326+
)
327+
return env(context=context)

0 commit comments

Comments
 (0)