Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0] shopfloor: location_content_transfer: get_work additional domain and sort key. #917

Merged

Conversation

lmignon
Copy link
Contributor

@lmignon lmignon commented Jul 5, 2024

The initial aim of this PR is to enable the 'location_content_transfer' scenario to be configured more precisely.
It aims to:

  • allow additional criteria to be configured to be applied when the user searches for work to be done (example of use: a menu for processing urgent transfers only)
  • allow you to configure a different sort to be applied to the operations to be performed than the one based on priority. (by location, for example)

When analysing the code, I found that there was an inconsistency between the code used to create the menu counters and the one used to find the transactions in the 'location_content_transfer' scenario. The code in the latter scenario was functionally identical to the one used for menus and zone_picking. Harmonisation work has therefore been carried out to eliminate this inconsistency.

As result, a generic solution has been put in place for scenarios using the 'search_move_line' action to find the operations to be carried out, so that the menus can be used to configure an additional domain to be applied by default and the method for sorting operations.

@OCA-git-bot
Copy link
Contributor

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

@lmignon
Copy link
Contributor Author

lmignon commented Jul 5, 2024

cc @jbaudoux @rousseldenis

@lmignon

This comment was marked as outdated.

@lmignon lmignon force-pushed the 16.shopfloor-location-content-transfer-adv branch 2 times, most recently from af89661 to 6ccbfa5 Compare July 12, 2024 14:07
@rousseldenis rousseldenis force-pushed the 16.shopfloor-location-content-transfer-adv branch 2 times, most recently from e56b453 to e05e7aa Compare July 19, 2024 12:47
Copy link
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.

Some remarks

shopfloor/actions/move_line_search.py Outdated Show resolved Hide resolved
shopfloor/actions/move_line_search.py Outdated Show resolved Hide resolved
shopfloor/actions/move_line_search.py Outdated Show resolved Hide resolved
shopfloor/actions/move_line_search.py Show resolved Hide resolved
shopfloor/services/location_content_transfer.py Outdated Show resolved Hide resolved
shopfloor/static/description/index.html Outdated Show resolved Hide resolved
@lmignon lmignon force-pushed the 16.shopfloor-location-content-transfer-adv branch 2 times, most recently from 30deba0 to e9e1549 Compare July 29, 2024 14:49
@rousseldenis
Copy link
Contributor

@jbaudoux

@rousseldenis rousseldenis added enhancement New feature or request needs review labels Aug 23, 2024
@rousseldenis rousseldenis added this to the 16.0 milestone Aug 23, 2024
Copy link
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.

I still don't get the purpose of enforce_picking_types :/

shopfloor/services/zone_picking.py Show resolved Hide resolved
shopfloor/actions/move_line_search.py Outdated Show resolved Hide resolved
shopfloor/services/location_content_transfer.py Outdated Show resolved Hide resolved
shopfloor/actions/move_line_search.py Outdated Show resolved Hide resolved
shopfloor/actions/move_line_search.py Outdated Show resolved Hide resolved
@lmignon
Copy link
Contributor Author

lmignon commented Oct 10, 2024

@jbaudoux If I remove the possibility to search for picking in an other picking type than the one provided by the menu if specified, I'm no more able to support the use case in the location_content_transfer scenario when content has different picking type than menu, and the menu is configured with the option to unreserve. In such a case, content must be unreserved, new moves created and the previous content re-reserved. That why I need this new enforce_picking_types parameter to also uses the search method in such a case where I don't want to enforce the picking types to the those configured on the menu or passed to the method.

@lmignon lmignon force-pushed the 16.shopfloor-location-content-transfer-adv branch from e9e1549 to 504f3a3 Compare October 10, 2024 16:07
lmignon and others added 7 commits October 10, 2024 18:32
The priority lines count must be the sum of operations linked to a priority move, while the priority pickings count must be the sum of priority pickings.
Ensures opertations assigned to current user are always first when sorting lines
Never return operations from pickings assigned to an other user when the method is called with the parameter 'match_user' set to True
If a location is not provided we take the one from the picking type by default
The scenario now uses the 'search_move_line' action to search for operations to perform when the user requests work. This eliminates duplicate code between the scenario and the 'search_move_line' action.
For scenario using the 'search_move_line' action to get lines
to work on, it's now possible to provide an additional domain
and a custom sort key code when configuring menu using these scenario.
This applies to the location_content_transfer scenario and partialy to
the zone_picking one
@lmignon lmignon force-pushed the 16.shopfloor-location-content-transfer-adv branch 2 times, most recently from b977550 to 62d227b Compare October 11, 2024 11:50
@lmignon
Copy link
Contributor Author

lmignon commented Oct 11, 2024

@jbaudoux Your last comment is now implemented into the last commit.

@jbaudoux
Copy link
Contributor

@jbaudoux Your last comment is now implemented into the last commit.

@lmignon nearly. There are still 2 unresolved comments related to your last changes. Should be obvious

@lmignon lmignon force-pushed the 16.shopfloor-location-content-transfer-adv branch from 62d227b to 6c647b6 Compare October 13, 2024 13:48
@lmignon
Copy link
Contributor Author

lmignon commented Oct 13, 2024

@jbaudoux done

shopfloor/__manifest__.py Outdated Show resolved Hide resolved
To disable the filtering of move line based on specific picking types, the additional parameter ‘enforce_picking_types’ had to be set to True when calling the method 'search_move_lines' of the 'hopfloor.search.move.line' action. The name of this parameter was not really relevant and its meaning conflicted with another parameter ‘enforce_package_types’. To avoid this situation, the semantics of the ‘picking_type’ parameter have been modified so that it can be explicitly stated that the search is not on a particular picking type if an empty recordset is passed as a parameter. Previously, if the parameter was None or an empty recordset, the filtering was forced on the picking types specified into the work context.

Translated with DeepL.com (free version)
@lmignon lmignon force-pushed the 16.shopfloor-location-content-transfer-adv branch from 6c647b6 to d3fc8c3 Compare October 14, 2024 08:21
@jbaudoux
Copy link
Contributor

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

What a great day to merge this nice PR. Let's do it!
Prepared branch 16.0-ocabot-merge-pr-917-by-jbaudoux-bump-nobump, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit ca3b2e8 into OCA:16.0 Oct 14, 2024
7 checks passed
@OCA-git-bot
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants