From f938dc397ddd508ac37c333d690bb66fbef54c40 Mon Sep 17 00:00:00 2001 From: sofiagvaladze Date: Tue, 19 Apr 2022 15:15:06 +0000 Subject: [PATCH] [FIX] board: filter records according to selected companies Before, when we added view to the dashboard, context was saved too, including allowed_company_ids. As a result when we checked the same view from the dashboard, the displayed records corresponded to the active companies during the time the view was saved and not the current ones - the companies that are currently ticked from the multi-company widget. After the fix, the displayed records in dashboard, correspond to the currently active companies. task - 2809597 closes odoo/odoo#94105 X-original-commit: 9f854262a197782793d329487792a09a101a1a38 Signed-off-by: Yannick Tivisse (yti) --- addons/board/controllers/main.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/addons/board/controllers/main.py b/addons/board/controllers/main.py index 1686706bb52..e6ab692c01b 100644 --- a/addons/board/controllers/main.py +++ b/addons/board/controllers/main.py @@ -21,6 +21,10 @@ class Board(Controller): board_arch = ElementTree.fromstring(board_view['arch']) column = board_arch.find('./board/column') if column is not None: + # We don't want to save allowed_company_ids + # Otherwise on dashboard, the multi-company widget does not filter the records + if 'allowed_company_ids' in context_to_save: + context_to_save.pop('allowed_company_ids') new_action = ElementTree.Element('action', { 'name': str(action_id), 'string': name,