From 2a2b13c1d982e2b191900f5ed7cdecf1e6c8d3bb Mon Sep 17 00:00:00 2001 From: niyasraphy Date: Thu, 11 May 2023 13:31:03 +0000 Subject: [PATCH] [IMP] stock: show cancel state only when cancelled before this commit, in the stock move and stock move line form view, the cancelled state is shown in the second position and in the stock move line form view, the cancelled state is always visible. after this commit, the cancelled state will be moved to last position as in all status bar and in the cancelled state in move line will be shown only if the record is in the cancelled state. closes odoo/odoo#121333 Signed-off-by: William Henrotin (whe) --- addons/stock/models/stock_move.py | 5 +++-- addons/stock/views/stock_move_line_views.xml | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/addons/stock/models/stock_move.py b/addons/stock/models/stock_move.py index 40e8c4d19b6..e92b0bf7e2c 100644 --- a/addons/stock/models/stock_move.py +++ b/addons/stock/models/stock_move.py @@ -99,12 +99,13 @@ class StockMove(models.Model): help="Optional: previous stock move when chaining them") picking_id = fields.Many2one('stock.picking', 'Transfer', index=True, states={'done': [('readonly', True)]}, check_company=True) state = fields.Selection([ - ('draft', 'New'), ('cancel', 'Cancelled'), + ('draft', 'New'), ('waiting', 'Waiting Another Move'), ('confirmed', 'Waiting Availability'), ('partially_available', 'Partially Available'), ('assigned', 'Available'), - ('done', 'Done')], string='Status', + ('done', 'Done'), + ('cancel', 'Cancelled')], string='Status', copy=False, default='draft', index=True, readonly=True, help="* New: When the stock move is created and not yet confirmed.\n" "* Waiting Another Move: This state can be seen when a move is waiting for another one, for example in a chained flow.\n" diff --git a/addons/stock/views/stock_move_line_views.xml b/addons/stock/views/stock_move_line_views.xml index b3885c1fc39..aee20c870e3 100644 --- a/addons/stock/views/stock_move_line_views.xml +++ b/addons/stock/views/stock_move_line_views.xml @@ -64,7 +64,7 @@
- +