[FIX] stock: receipt transfers almost always ready
Incoming picking should almost never be in a waiting ('confirmed') state. So we check if the location bypasses reservation and that no move is in MTO.
Changing the main_flow_tour because removing the "Waiting" status from incoming picking forms makes it unable to find "Ready" in Mobile UI.
closes odoo/odoo#140180
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
This commit is contained in:
@@ -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):
|
||||
|
||||
@@ -156,7 +156,8 @@
|
||||
<button string="Print Labels" type="object" name="action_open_label_type"/>
|
||||
<button name="%(action_report_delivery)d" string="Print" invisible="state != 'done'" type="action" groups="base.group_user" data-hotkey="o"/>
|
||||
<button name="%(act_stock_return_picking)d" string="Return" invisible="state != 'done'" type="action" groups="base.group_user" data-hotkey="k"/>
|
||||
<field name="state" widget="statusbar" statusbar_visible="draft,confirmed,assigned,done" />
|
||||
<field name="state" widget="statusbar" invisible="picking_type_code != 'incoming'" statusbar_visible="draft,assigned,done"/>
|
||||
<field name="state" widget="statusbar" invisible="picking_type_code == 'incoming'" statusbar_visible="draft,confirmed,assigned,done"/>
|
||||
<button name="action_cancel" invisible="state not in ('assigned', 'confirmed', 'draft', 'waiting')" string="Cancel" groups="base.group_user" type="object" data-hotkey="x"/>
|
||||
</header>
|
||||
<sheet>
|
||||
|
||||
@@ -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'),
|
||||
|
||||
Reference in New Issue
Block a user