Files
odoo_source/addons/board/static/src
Nicolas Martinelli 6d810c6004 [FIX] board: incorrect type in action.views
- Install the `board` module
- Go to Accounting / Customer / Invoices
- Go to the Pivot view
- Add the view to the Dashboard
- Go to Dashboard
- Click on a cell of the pivot view to open the list view

The list view is the supplier list view instead of the customer list
views.

The root cause of the issue is that in the case of the Dashboard, we
receive an Array of Array, while in the regular access we receive an
Array of Dict. In the former case, the `_findView` returns `false` for
all views despite the fact that the correct list is already provided.

Since the views are `false`, `load_views` chooses the default views for
the model, which are in this case the supplier views.

In the Dashboard, the view is created in:
https://github.com/odoo/odoo/blob/1bdd0cc247d36c869ffdee7d501cb65d36be47a6/addons/board/static/src/js/board_view.js#L267-L274

When switching view, the action is set in:
https://github.com/odoo/odoo/blob/1bdd0cc247d36c869ffdee7d501cb65d36be47a6/addons/web/static/src/js/chrome/action_manager_act_window.js#L895

and the view is created in:
https://github.com/odoo/odoo/blob/1bdd0cc247d36c869ffdee7d501cb65d36be47a6/addons/web/static/src/js/chrome/action_manager_act_window.js#L235

The assumption that a list of dicts is received is used is several
places:
https://github.com/odoo/odoo/blob/7a35515e495d4fb8edbaf252988c8c3c144f4442/addons/web/static/src/js/views/calendar/calendar_view.js#L131
https://github.com/odoo/odoo/blob/7a35515e495d4fb8edbaf252988c8c3c144f4442/addons/web/static/src/js/views/pivot/pivot_view.js#L131
https://github.com/odoo/enterprise/blob/05a78e94073aea88b2314918cadc478a367afef0/web_cohort/static/src/js/cohort_view.js#L93
https://github.com/odoo/enterprise/blob/05a78e94073aea88b2314918cadc478a367afef0/web_grid/static/src/js/grid_view.js#L79-L84

opw-2387417

closes odoo/odoo#62689

X-original-commit: 5fc81820de49b78f70d471d0f9cc99afc874a550
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-12-01 14:02:54 +00:00
..
…