In this viewtiverse, the heroes remove the context dependencies for `get_views`, from the views and python fields (such as domain). To reduce inconsistencies and the number of rpc. Current issues: * There may be inconsistencies in views at the JavaScript level. Some overrides modify the behavior of get_views or domains on fields via context keys, therefore by changing the action, the rendering may be different. However, these views are cached. However, the cache key (Javascript) does not reflect the entire context, and requires additional post-processing from the server. * Multiple rpc for the same rendering. get_views being dependent on the context, as soon as it changes, a new rpc is performed. In most cases, when JavaScript needs the same view, there is no change depending on the context, the rpc is useless. * Inconsistency when rendering subviews, some views could be different depending on the context, this context can be modified in the view itself via the context attributes. However, the JavaScript client does not redo an rpc for each change of these sub-contexts. Therefore the result may be inconsistent. Solution: Limit as much as possible the number of context keys provided when calling get_views, and use the context provided as a cache key. The authorized keys are 'lang' and '*_view_ref'. For the cache key, options are added in the get_views method. Instead of using the context, it is inserted into python expressions. This will be evaluated by JavaScript and thus avoids inconsistencies. task-3414108 task-3414068 closes odoo/odoo#135145 Related: odoo/enterprise#47584 Signed-off-by: Raphael Collet <rco@odoo.com>
39 lines
1.3 KiB
XML
39 lines
1.3 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<odoo>
|
|
<data noupdate="1">
|
|
<!--My Dashboard-->
|
|
<record model="ir.ui.view" id="board_my_dash_view">
|
|
<field name="name">My Dashboard</field>
|
|
<field name="model">board.board</field>
|
|
<field name="arch" type="xml">
|
|
<form string="My Dashboard">
|
|
<board style="2-1">
|
|
<column>
|
|
</column>
|
|
</board>
|
|
</form>
|
|
</field>
|
|
</record>
|
|
|
|
<!--My Dashboard Action-->
|
|
<record model="ir.actions.act_window" id="open_board_my_dash_action">
|
|
<field name="name">My Dashboard</field>
|
|
<field name="res_model">board.board</field>
|
|
<field name="view_mode">form</field>
|
|
<field name="context">{'disable_toolbar': True}</field>
|
|
<field name="usage">menu</field>
|
|
<field name="view_id" ref="board_my_dash_view"/>
|
|
</record>
|
|
</data>
|
|
<data>
|
|
|
|
<!--My Dashboard Menu-->
|
|
<menuitem
|
|
id="menu_board_my_dash"
|
|
name="My Dashboard"
|
|
parent="spreadsheet_dashboard.spreadsheet_dashboard_menu_root"
|
|
action="open_board_my_dash_action"
|
|
sequence="100"/>
|
|
</data>
|
|
</odoo>
|