Skip to content

[15.0][MIG] shopfloor#446

Closed
flachica wants to merge 710 commits into
OCA:15.0from
flachica:15.0-mig-shopfloor
Closed

[15.0][MIG] shopfloor#446
flachica wants to merge 710 commits into
OCA:15.0from
flachica:15.0-mig-shopfloor

Conversation

@flachica

@flachica flachica commented Sep 28, 2022

Copy link
Copy Markdown
Contributor

[WIP] Progresivelly migrating dependencies

I don't know where is the migration issue for this project

Dependencies:

OCA/product-attribute#1151
OCA/product-attribute#1149
OCA/stock-logistics-warehouse#1490
OCA/stock-logistics-workflow#1095
OCA/server-tools#2409
#448
#447
#445

/cc @simahawk

simahawk and others added 30 commits September 28, 2022 15:50
Since version 13.0.3.0.0 of base_rest, we have to setup registries
In the initial implementation of rest_api, the schema validators
had to be returned by methods in the same service as the method, named
after the endpoint's method with a prefix: "_validator_<method>" or
"_validator_return_<method>".

As we have a lot of endpoints methods in some services, we extracted
the validator methods in dedicated components with
"base.shopfloor.validator" and "base.shopfloor.validator.return" usages,
and methods of the same name as the endpoint's method.

With the new API, endpoints are decorated with "@restapi.method" and the
validator is defined there. Example:

    @restapi.method(
        [(["/<int:id>/get", "/<int:id>"], "GET")],
        output_param=restapi.CerberusValidator("_get_partner_schema"),
        auth="public",
    )

For backward compatilibity, base_rest patches the methods not decorated
and sets the "input_param" and "output_param" to call the
"_validator_<method>" or "_validator_return_<method>":

https://github.com/OCA/rest-framework/blob/abd74cd7241d3b93054825cc3e41cb7b693c9000/base_rest/models/rest_service_registration.py#L240-L250

This change adds the extra layer that will call the validator components
when one of these methods is called.

A follow-up commit will replace the getattr by a better fix with a
change in base_rest, but meanwhile, this commit will unblock the OCA/wms
CI.
Before: when moves are processed, we were managing two cases:

- if the current moves to process are all the moves remaining in a
  transfer, we validate the transfer

- if the current moves to process are a subset of available moves of a
  transfer, then we put these moves to process in a new transfer which
  is validated. All remaining moves stay in the current transfer.

After: a third case is added:

- if the current moves to process are equal to all available moves of
  the current picking - but there are still unavailable moves to process -
  then we validate the current transfer as usual, which will create a
  backorder with remaining/unavailable moves.

As this third case is very specific to Shopfloor, it has been
implemented in a new StockAction component (used by all related scenarios).
Now all scenarios use this new component to validate stock moves,
and the `extract_and_action_done` method on `stock.move` can stay generic.
The opportunity was taken to create a new method `split_unavailable_qty`
on `stock.move` to put unavailable qty to a new move and update the
current move to `assigned` (it was done directly in
`extract_and_action_done` before).
Currently translated at 100.0% (235 of 235 strings)

Translation: wms-14.0/wms-14.0-shopfloor
Translate-URL: https://translation.odoo-community.org/projects/wms-14-0/wms-14-0-shopfloor/es_AR/
…idated batch

Unavailable transfers could be part of a batch (following a stock inventory
happening at the same time for instance), as such we have to remove such
transfers from the batch picking when this one is validated.
The transfers will be assigned to a new batch thereafter.
If the user starts to process a line, and for whatever reason he
stops there and restarts the scenario from the beginning, he should
still be able to find/recover the previous line.

For that purpose we are using the `shopfloor_user_id` field on move
lines (already used to manage currently processed lines in the Zone
picking and Location content transfer scenarios).
When a location is scanned and several items are found
ask to scan a package instead of saying that the location is empty.
* active arg can be a callable
* fail only if 'mandatory' arg is True
The warehouse of the picking type only should be used.
* It allows grouping and providing stats per menu/profile (example:
  number of move lines to process for a profile).
* A migration script changes the relation and duplicates a menu if it
  had several profiles
Both 'Single pack transfer' and 'Location content transfer' are fixed.
jbaudoux and others added 26 commits September 28, 2022 15:50
Refactor to reduce method complexity.
In case some pickings are split, only split pickings had unreserved
quantity extracted.
Extract processed move lines in a split order like in the location
content transfer. Set shopfloor user and printed flag on the processed
split order knowing who is working on what.
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: wms-14.0/wms-14.0-shopfloor
Translate-URL: https://translation.odoo-community.org/projects/wms-14-0/wms-14-0-shopfloor/
This option allows to scan product packaging for bulk products
and process the packaging qty.
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: wms-14.0/wms-14.0-shopfloor
Translate-URL: https://translation.odoo-community.org/projects/wms-14-0/wms-14-0-shopfloor/
… package

When picking a move, allow to set a destination package that was already used
for the other lines.
With this option, the lines you process by putting on a package during the
picking process will be put as bulk products at the final destination location.

This is useful if your picking device is emptied at the destination location or
if you want to provide bulk products to the next operation.

Incompatible with: "Pick and pack at the same time"
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: wms-14.0/wms-14.0-shopfloor
Translate-URL: https://translation.odoo-community.org/projects/wms-14-0/wms-14-0-shopfloor/
Currently translated at 100.0% (230 of 230 strings)

Translation: wms-14.0/wms-14.0-shopfloor
Translate-URL: https://translation.odoo-community.org/projects/wms-14-0/wms-14-0-shopfloor/es_AR/
No need to generate moves manually for the package level, it is done
automatically by calling `action_confirm` on its picking right after.
It is already working for package levels containing only one
product/move, but it doesn't for packages having several products.
Fix 'Expected singleton' error when calling the cancel action.
As a package could contain multiple products, a package level could be
linked to multiple moves.
When scanning a location out of the previously selected zone, instead of
sending the user back to the start, keep him on the line selection of
the zone.
The user may end up in the `scan_location` screen with some products to
unload. It can happen when clicking on the back button but also when
there is no lines left to process in the current zone.

This change adds an Unload At Destination button on the `scan_location`
screen which will be display only when the user has some product to
unload.
@github-actions

Copy link
Copy Markdown

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 Jan 29, 2023
@github-actions github-actions Bot closed this Mar 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale PR/Issue without recent activity, it'll be soon closed automatically.

Projects

None yet

Development

Successfully merging this pull request may close these issues.