Skip to content

Conversation

@rousseldenis
Copy link

These modules allow to build base bricks to support printing

@rousseldenis rousseldenis added this to the 16.0 milestone Jul 17, 2025
@rousseldenis rousseldenis force-pushed the 16.0-add-shopfloor_mobile_printing_base-dro branch from 7b2ac59 to 1c01ec6 Compare July 17, 2025 08:44
@rousseldenis rousseldenis force-pushed the 16.0-add-shopfloor_mobile_printing_base-dro branch from 1c01ec6 to dbb532e Compare July 17, 2025 09:02
@@ -0,0 +1,113 @@
/**
* Copyright 2020 Camptocamp SA (http://www.camptocamp.com)

Choose a reason for hiding this comment

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

leftover :)

* License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
*/

export var LabelPrinterWidget = Vue.component("label-printer", {

Choose a reason for hiding this comment

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

why not improving the input-number-spinner widget?

Copy link
Author

Choose a reason for hiding this comment

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

I hesitated


_inherit = "base.shopfloor.service"

def _printing_for(self, usage):

Choose a reason for hiding this comment

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

I don't understand what is it used for

Copy link
Author

Choose a reason for hiding this comment

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

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

Choose a reason for hiding this comment

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

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.

Copy link
Author

Choose a reason for hiding this comment

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

Could you elaborate ? What do you mean by into the menu data ?

Choose a reason for hiding this comment

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

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.

@github-actions
Copy link

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.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Nov 16, 2025
@github-actions github-actions bot closed this Dec 21, 2025
@rousseldenis rousseldenis reopened this Dec 22, 2025
@github-actions github-actions bot removed the stale PR/Issue without recent activity, it'll be soon closed automatically. label Dec 28, 2025
@rousseldenis rousseldenis force-pushed the 16.0-add-shopfloor_mobile_printing_base-dro branch from 4ad801e to 62ffbc6 Compare January 6, 2026 08:29
rousseldenis and others added 7 commits January 7, 2026 20:09
…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).
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
Copy link

@nicolas-delbovier-acsone nicolas-delbovier-acsone Jan 19, 2026

Choose a reason for hiding this comment

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

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.
@nicolas-delbovier-acsone

Improved the UI of the label-printer component. The updated layout provides a more robust and accessible experience on small warehouse scanner screens where space is limited.

image

@nicolas-delbovier-acsone

The recent refactoring I made on this PR is to fix allow_print_label injection to ensure persistent state handling in the frontend.

The Issue: Previously, the allow_print_label flag was injected into the root of the response dictionary rather than inside the specific state data defined in _states(). Because the Shopfloor Vue application dynamically updates its local store based on the next_state payload, any data sent outside of that specific state key was ignored by the frontend’s persistence logic. This caused the flag to be lost upon browser refresh.

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.

4 participants