diff --git a/addons/stock/models/stock_picking.py b/addons/stock/models/stock_picking.py
index 73a4a38f421..c313fbdcf15 100644
--- a/addons/stock/models/stock_picking.py
+++ b/addons/stock/models/stock_picking.py
@@ -635,6 +635,7 @@ class Picking(models.Model):
- Ready: if the picking is ready to be sent so if:
- (a) all quantities are reserved or if
- (b) some quantities could be reserved and the shipping policy is "as soon as possible"
+ - (c) it's an incoming picking
- Done: if the picking is done.
- Cancelled: if the picking is cancelled
'''
@@ -663,11 +664,14 @@ class Picking(models.Model):
else:
picking.state = 'done'
else:
- relevant_move_state = self.env['stock.move'].browse(picking_move_lines[picking_id])._get_relevant_state_among_moves()
- if relevant_move_state == 'partially_available':
+ if picking.location_id.should_bypass_reservation() and all(m.procure_method == 'make_to_stock' for m in picking.move_ids):
picking.state = 'assigned'
else:
- picking.state = relevant_move_state
+ relevant_move_state = self.env['stock.move'].browse(picking_move_lines[picking_id])._get_relevant_state_among_moves()
+ if relevant_move_state == 'partially_available':
+ picking.state = 'assigned'
+ else:
+ picking.state = relevant_move_state
@api.depends('move_ids.state', 'move_ids.date', 'move_type')
def _compute_scheduled_date(self):
diff --git a/addons/stock/views/stock_picking_views.xml b/addons/stock/views/stock_picking_views.xml
index caff4ca6ffe..73facac1bde 100644
--- a/addons/stock/views/stock_picking_views.xml
+++ b/addons/stock/views/stock_picking_views.xml
@@ -156,7 +156,8 @@
-
+
+
diff --git a/odoo/addons/test_main_flows/static/tests/tours/main_flow.js b/odoo/addons/test_main_flows/static/tests/tours/main_flow.js
index 7f75b13fc47..1a82056864b 100644
--- a/odoo/addons/test_main_flows/static/tests/tours/main_flow.js
+++ b/odoo/addons/test_main_flows/static/tests/tours/main_flow.js
@@ -700,7 +700,7 @@ stepUtils.openBurgerMenu(".o_breadcrumb .active:contains('OP/')"),
},
...stepUtils.statusbarButtonsSteps('Confirm Order', _t("Confirm quotation")),
...stepUtils.statusbarButtonsSteps('Receive Products', _t("Receive Product"), ".o_statusbar_status .dropdown-toggle:contains('Purchase Order')"),
-...stepUtils.statusbarButtonsSteps('Validate', _t("Validate"), ".o_statusbar_status .dropdown-toggle:contains('Ready')"),
+...stepUtils.statusbarButtonsSteps('Validate', _t("Validate"), ".o_statusbar_status:contains('Ready')"),
{
trigger: ".o_back_button, .breadcrumb-item:not('.active'):last",
content: _t('go back to the purchase order'),