From 67402bc5ecfb1dd077742137d8d8f222e1d75ff9 Mon Sep 17 00:00:00 2001 From: Ankita Raval Date: Tue, 21 Jan 2020 05:59:59 +0000 Subject: [PATCH] [FIX] stock: Alert should disappear when picking done cancelled In this commit, added a restriction on "json_popover" field so, Alert should disappear when picking is done or cancelled state on list, kanban and form views. task-2178494 X-original-commit: 12ada1bfa3e85c636f5ea85af675dedad3e7e0e4 --- addons/stock/models/stock_move.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/stock/models/stock_move.py b/addons/stock/models/stock_move.py index b8ed6bbdf00..106791b471b 100644 --- a/addons/stock/models/stock_move.py +++ b/addons/stock/models/stock_move.py @@ -1281,7 +1281,7 @@ class StockMove(models.Model): if all(state in ('done', 'cancel') for state in siblings_states): move.move_dest_ids.write({'procure_method': 'make_to_stock'}) move.move_dest_ids.write({'move_orig_ids': [(3, move.id, 0)]}) - self.write({'state': 'cancel', 'move_orig_ids': [(5, 0, 0)]}) + self.write({'state': 'cancel', 'move_orig_ids': [(5, 0, 0)], 'delay_alert_date': False}) return True def _prepare_extra_move_vals(self, qty): @@ -1395,7 +1395,7 @@ class StockMove(models.Model): if len(result_package.quant_ids.filtered(lambda q: not float_is_zero(abs(q.quantity) + abs(q.reserved_quantity), precision_rounding=q.product_uom_id.rounding)).mapped('location_id')) > 1: raise UserError(_('You cannot move the same package content more than once in the same transfer or split the same package into two location.')) picking = moves_todo.mapped('picking_id') - moves_todo.write({'state': 'done', 'date': fields.Datetime.now()}) + moves_todo.write({'state': 'done', 'date': fields.Datetime.now(), 'delay_alert_date': False}) move_dests_per_company = defaultdict(lambda: self.env['stock.move']) for move_dest in moves_todo.move_dest_ids: