Commit Graph

12 Commits

Author SHA1 Message Date
dzung.tran
80d93bffbc [MIG] stock_vertical_lift: Migration to 14.0 2021-09-17 07:47:34 +07:00
Sébastien Alix
ff4d9bbfad [FIX] stock_vertical_lift: handles multiple move lines on pick
If there is two move lines for the same product in the vertical lift
(stored in2 differents trays for instance), the pick scenario was
failing when the user was processing the first line.

To circumvent this, instead of validating directly the move, we put the line
in its own stock move, then we put the stock move in its own transfer and
validate this one.

Methods used to do that have been copied from the `shopfloor` module,
they probably deserves their own module as they are quite generic.
2021-09-16 20:17:33 +07:00
Simone Orsi
457ee74690 stock_vertical_lift: make pkg compute more solid (#16)
* stock_vertical_lift: make pkg compute more solid

Somehow sometimes you can get a move line without product
while computing product packaging in inventory.

Make it more defensive and skip packaging rendering if no product is
there.
2021-09-16 20:17:33 +07:00
Simone Orsi
6a702b30bb stock_vertical_lift: packaging template more flexible
As the template is not used by JS we can pass full objects to it.
This way we can use any recordset information directly in the template
without having to override the method.
2021-09-16 20:17:33 +07:00
Guewen Baconnier
b878102ca2 Putaway: show rainbow man when all the lines are putaway 2021-09-16 20:17:33 +07:00
Guewen Baconnier
7d78e8b540 Rework workflows using a small state machine
The documentation of the state machine is in
VerticalLiftOperationBase._transitions.
2021-09-16 20:17:33 +07:00
Guewen Baconnier
d1b7a6f47c Execute the barcode scanner method as side-effect method
Instead of going through the onchange machinery.
The intended usage of onchange methods is to update something on the
screen, without side-effects in the database, then let the user save
the form with the proposed changes.

Weirdly, the barcode scanner event triggers an onchange on the field
`_barcode_scanned`.

It doesn't work well with our use case, as the whole form is read-only
and we only care about having the barcode events doing side-effects on
the backend and displaying back the changes.

This particular onchange will then be executed as a normal method, with
side-effects. However, contrarily to other actions on the form, the
frontend does not reload the view after an onchange, as it relies on the
data returned back in the values. As we cannot know which values may
have been changed in the different implementations (location
destination, state, ...), the onchange returns a read with every field.
2021-09-16 20:17:33 +07:00
Guewen Baconnier
d9cbd996b0 [IMP] stock_vertical_lift: black, isort 2021-09-16 20:17:33 +07:00
Guewen Baconnier
cf5848c2c3 Add method to refresh a shuttle screen
Example of usage in an odoo shell, when a screen is open:

>>> self.env['vertical.lift.shuttle'].browse(1)._operation_for_mode().operation_descr = 'foo'
>>> self.env['vertical.lift.shuttle'].browse(1)._send_notification_refresh()
>>> env.cr.commit()

Provided the longpolling is correctly configured with a proxy, the
screen should immediately refresh with 'foo' as operation description.
2021-09-16 20:17:33 +07:00
Guewen Baconnier
abb323ce89 Implement inventory screen 2021-09-16 20:17:33 +07:00
Guewen Baconnier
fcd1c6b766 Add Put-Away workflow 2021-09-16 20:17:33 +07:00
Guewen Baconnier
4d3ce20810 Split the shuttle operations in different models/views
Namely, the pick/put/inventory operations are now split in
different models.

Pick and Put share a model and customize their behavior, which is pretty
similar. The inventory operation will have a different view and
different workflow.

This changes will ease a lot the customization of the different
workflows and views.
2021-09-16 20:17:33 +07:00