Skip to content

Commit 64f00fd

Browse files
committed
[FIX] mrp: remove immediate_transfer key on MO creation
Steps to reproduce the bug: - Enable the `Multi-Step Routes` option in the settings - Go to inventory > warehouses > Select 2-step manufacturing - Go to inventory overview > Click on Manufacturing - Create a MO > confirm - Go to the created picking Problem: The state is “ready” instead of “waiting” because the picking is created in immediate transfer: https://github.com/odoo/odoo/blob/fd6aa428ce7b7ab03ba920b1c020f5862f56f731/addons/stock/models/stock_picking.py#L137 So when we compute the state, as the picking is in immediate transfer and the “stock.move” is confirmed, the picking status will be `assigned`('ready') https://github.com/odoo/odoo/blob/8c4819882011ba6bbeefe97931a26a96e60d38a3/addons/stock/models/stock_picking.py#L431 Solution: No need to call `get_action` function to fill the context, we can return the action directly opw-2876050 closes odoo#93204 Signed-off-by: Arnold Moyaux (arm) <[email protected]>
1 parent 0e54d3d commit 64f00fd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

addons/mrp/models/stock_picking.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,10 @@ def _get_mo_count(self):
4646
remaining.count_mo_late = False
4747

4848
def get_mrp_stock_picking_action_picking_type(self):
49-
return self._get_action('mrp.mrp_production_action_picking_deshboard')
49+
action = self.env.ref('mrp.mrp_production_action_picking_deshboard').read()[0]
50+
if self:
51+
action['display_name'] = self.display_name
52+
return action
5053

5154
class StockPicking(models.Model):
5255
_inherit = 'stock.picking'

0 commit comments

Comments
 (0)