[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) <yti@odoo.com>
This commit is contained in:
sofiagvaladze
2022-06-21 10:17:41 +02:00
parent 055dbc25a4
commit f938dc397d
+4
View File
@@ -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,