[16.0][ADD] shopfloor_priting_base/mobile#1085
[16.0][ADD] shopfloor_priting_base/mobile#1085rousseldenis wants to merge 18 commits intoOCA:16.0from
Conversation
7b2ac59 to
1c01ec6
Compare
1c01ec6 to
dbb532e
Compare
| @@ -0,0 +1,113 @@ | |||
| /** | |||
| * Copyright 2020 Camptocamp SA (http://www.camptocamp.com) | |||
| * License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). | ||
| */ | ||
|
|
||
| export var LabelPrinterWidget = Vue.component("label-printer", { |
There was a problem hiding this comment.
why not improving the input-number-spinner widget?
|
|
||
| _inherit = "base.shopfloor.service" | ||
|
|
||
| def _printing_for(self, usage): |
There was a problem hiding this comment.
I don't understand what is it used for
There was a problem hiding this comment.
This is needed to get the printing component on flows ones (reception, ...). This allows to reuse a certain logic and also to get specific ones when needed
| """ | ||
| Returns the report to print | ||
| """ | ||
| return self.work.menu.label_print_report_id |
There was a problem hiding this comment.
IMO instead of relying on a fixed report per menu item, we should pass this id into the menu data for the frontend and then the frontend will pas the id of the report to print. This way, the endpoint will work with any report.
Then I don't think we need this endpoint at all since we could use the standard endpoint for printing reports or a similar one.
Just ensure that you can pass the config to the menu or to the scenario.
There was a problem hiding this comment.
Could you elaborate ? What do you mean by into the menu data ?
There was a problem hiding this comment.
I mean: add a field to the menu item and include this info (id + name of report) in the menu item info that is sent to the app.
|
There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. |
…ng printing + add tests
4ad801e to
62ffbc6
Compare
…component should be visible
…red in session at refresh. In previous implementation, the variable was only given in API response but not stored inside session storage. As a refresh does not query odoo again but looks for variables inside session, the value was lost at refresh (and replaced with default false value).
…lobal next state fields
As soon as work context is not loaded yet at service init(), change them to properties to allow dynamic evaluation.
| self, base_response=None, data=None, next_state=None, message=None, popup=None | ||
| ): | ||
| data = data or {} | ||
| data["allow_print_label"] = self._menu.display_print_label_button |
There was a problem hiding this comment.
This implementation depends on PR #1115. That PR fixes the component initialization logic, ensuring self._menu is correctly populated. Without that fix, self._menu remains empty, preventing from accessing the necessary menu context.
- Remove duplicate BaseShopfloorService definition in components/base.py. - Keep the implementation in services/service.py to align with the base.shopfloor.service architecture. - Fixes Pylint R8180 (consider-merging-classes-inherited) where multiple classes were inheriting from the same parent in one module.
…sponse if the option is activated. When the option is not activated, we should not add the key with a false value in the response because changing the schema in that manner breaks unit tests expected outputs.
|
The recent refactoring I made on this PR is to fix The Issue: Previously, the |
|
|
||
| def __init__(self, work_context): | ||
| super().__init__(work_context) | ||
| @property |
There was a problem hiding this comment.
This change is from https://github.com/OCA/wms/pull/1115/changes which I needed as explained above
|
|
||
| With the schema of the data send to the client to transition | ||
| def _states(self) -> dict: | ||
| """Returns a dict mapping next states with the schema |
There was a problem hiding this comment.
I found the previous docstring to be confusing. The return value is not a "list of possible next states", it is a dict mapping next state to its data schema
shopfloor_base/services/validator.py
Outdated
| return self._actions_for("schema_detail") | ||
|
|
||
| def _get_global_fields_schemas(self) -> dict: | ||
| "Returns schemas of fields to be added in all next states data schemas" |
|
|
||
| _name = "shopfloor.printing.action" | ||
| _inherit = "shopfloor.process.action" | ||
| _collection = "shopfloor.printing" |
There was a problem hiding this comment.
What collection would you want? "shopfloor.printing.base"? What value would a new collection bring?
| super().tearDownClass() | ||
|
|
||
| @contextmanager | ||
| def _work_on_actions(self, **params): |
There was a problem hiding this comment.
there's already a work_on_actions in the base module, do we need this?

These modules allow to build base bricks to support printing