Skip to content

Commit 9f85426

Browse files
author
sofiagvaladze
committed
[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#89070 Signed-off-by: Yannick Tivisse (yti) <[email protected]>
1 parent 932ddde commit 9f85426

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

addons/board/controllers/main.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ def add_to_dashboard(self, action_id, context_to_save, domain, view_mode, name='
2121
xml = ElementTree.fromstring(board['arch'])
2222
column = xml.find('./board/column')
2323
if column is not None:
24+
# We don't want to save allowed_company_ids
25+
# Otherwise on dashboard, the multi-company widget does not filter the records
26+
if 'allowed_company_ids' in context_to_save:
27+
context_to_save.pop('allowed_company_ids')
2428
new_action = ElementTree.Element('action', {
2529
'name': str(action_id),
2630
'string': name,

0 commit comments

Comments
 (0)