[FIX] mrp: perform location chaining for kit exploded moves
authorDenis Ledoux <dle@odoo.com>
Wed, 19 Nov 2014 12:24:32 +0000 (13:24 +0100)
committerDenis Ledoux <dle@odoo.com>
Wed, 19 Nov 2014 13:04:05 +0000 (14:04 +0100)
commit529e920b2cc4673188dd209f91196a35dfdb7790
treef410589576f43846d2eaa1a24c308184761a24a3
parentbb7a9dea8b401f66ab6f4f241f21ecc4123b6b97
[FIX] mrp: perform location chaining for kit exploded moves

This rev. 7307227 ensured to not (re-)set the state 'confirmed' to exploded moves with a more advanced state (for instance, 'assigned')
Nevertheless, the location chaining is performed on the move confirmation, through the action_confirm method of the stock.move model. Besides, the resulting moves of the _action_explode method had the state 'confirmed' on creation, the 'confirmed' state wasn't set by the method 'action_confirm', meaning that the moves were confirmed without having the location chaining done. Allowing moves to go through the action_confirm method even if the state was 'confirmed' or further triggered the location chaining.

Preventing already confirmed moves to go through the action_confirm method prevented the location chaining, thus.

We now create the resulting moves with the 'draft' state, and then confirm them through the procurement workflow signal 'button_confirm'. Thus, the resulting moves are confirmed by going through the action_confirm method, writing the confirmed state and triggering the location chaining at the same time. We then write the 'assigned' state if necessary.

opw-617235
addons/mrp/stock.py