odoo/odoo#106910

Created by Logistics, Arnold Moyaux (arm)

Blocked

  • Merge method
  • Review
  • CI
label
odoo-dev:master-remove-autoconfirm-arm
head
8b2ba2cabcc6ac133250d36d6ddd6e94ac17d644
target
master

[REF] stock,mrp: autoconfirm on move instead of picking

Currently there is an issue with the kit. If you create an immediate transfer with a kit, it will have a correct behavior and split it in different moves. However in the code it's not optimal.

It will split the move during the inverse of the field `quantity_done` It means that during the create when you get the move back with `moves = super().create(vals)` it will return an id of a move that doens't exists anymore and we can't get easily the new moves created from the `action_explode`

This commit removes the autoconfirm on the picking level. Instead autoconfirm during the create of the move (the purpose is to return the new sets of moves if an extra processing is required). It continues to confirm on the picking afterward to trigger the scheduler.

It allows to confirm `stock.picking` with a state different than draft and cancel. It's to be able to remove easier the initial move of the kit. We could made a patch to prevent the reservation and let it draft but the feature of being able to delete every move except done ones is a good idea.

Description of the issue/feature this PR addresses:

Current behavior before PR:

Desired behavior after PR is merged:




---
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr