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

[9.0][FIX]stock_auto_move: fix action_done for automatique moves with lots #367

Closed
wants to merge 26 commits into from

Conversation

zakiuu
Copy link
Contributor

@zakiuu zakiuu commented Sep 14, 2017

The current behavior: the stock_auto_move module allows to tag a movement to be processed automatically. In a situation of chained movements (ex: reception in two steps) with product tracking set to Serial or Lot, the automatic movements can't be processed, and a message error is raised to the user: You have a difference between the quantity on the operation and the quantities specified for the lots.
Technically speaking this issue comes from the fact there is no quantity set on the pack_lot_ids of the operations linked to the movement linked_move_operation_ids.

In this PR I've tried to fix this issue by providing a method that auto fills the quantity on the pack_lot_ids, and also fill the qty_done of the operations using a new method that I've added called _auto_fill_pack_lot_ids_qty defined on the stock.pack.operation model. This method is called from the action_done of the stock.move model.

@zakiuu
Copy link
Contributor Author

zakiuu commented Sep 14, 2017

this PR is based on #359

@zakiuu zakiuu force-pushed the 9.0-fix_stock_auto_move_action_done_zak branch 2 times, most recently from 449f84d to bcef1dc Compare September 14, 2017 17:20
lambda m: m.state == 'assigned' and m.auto_move and
m.product_id.tracking != 'none')
auto_moves_operations = \
auto_moves.mapped('linked_move_operation_ids').\
Copy link
Contributor

Choose a reason for hiding this comment

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

@zakiuu auto_moves.mapped('linked_move_operation_ids.operation_id')

@lmignon
Copy link
Contributor

lmignon commented Sep 15, 2017

@zakiuu You changes makes sens. Can you check to the Travis error

@zakiuu zakiuu force-pushed the 9.0-fix_stock_auto_move_action_done_zak branch from bcef1dc to e1a9397 Compare September 17, 2017 11:33
* The `_apply` method should not be overridden. In case of three step
operation with the last step set to auto move. The override of the
`_apply` method was causing the second move to be automatic as well.
@zakiuu zakiuu force-pushed the 9.0-fix_stock_auto_move_action_done_zak branch from e1a9397 to 9f8dc2f Compare September 28, 2017 08:37
@zakiuu
Copy link
Contributor Author

zakiuu commented Sep 29, 2017

closed by #373

@zakiuu zakiuu closed this Sep 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants