Skip to content

Commit

Permalink
[FIX] stock: remove superfluous track visibility messages
Browse files Browse the repository at this point in the history
`_run_move` creates the move, calls `_assign_picking` and then confirms it. The
result is that a draft move is added to a picking and then its state is changed to
confirmed. As the state of the picking is computed across its moves and a manual
call to `message_track` is done when any of its move changes its state, there was
a lot of tracking messages in the picking chatter, especially when you confirm a sale
order (a lot of calls to _run_move).

The thing is that this is unnecessary as stock.move’s `_action_confirm` will call
`_assign_picking` later on AND after having changed its state to “confirmed”. Now
a confirmed move is added to a confirmed picking and no message are posted. This
improves considerably the validation of a massive SO.
  • Loading branch information
sle-odoo authored and amoyaux committed Jan 11, 2018
1 parent 27dd19c commit b7b38ed
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion addons/stock/models/procurement.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ def _run_move(self, product_id, product_qty, product_uom, location_id, name, ori
data = self._get_stock_move_values(product_id, product_qty, product_uom, location_id, name, origin, values, group_id)
# Since action_confirm launch following procurement_group we should activate it.
move = self.env['stock.move'].sudo().create(data)
move._assign_picking()
move._action_confirm()
return True

Expand Down

0 comments on commit b7b38ed

Please sign in to comment.