You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
87 lines
4.3 KiB
87 lines
4.3 KiB
<?xml version="1.0" encoding="utf-8"?>
|
|
<odoo>
|
|
<!--Form view of the dashboard block-->
|
|
<record id="dashboard_block_view_form" model="ir.ui.view">
|
|
<field name="name">dashboard.block.view.form</field>
|
|
<field name="model">dashboard.block</field>
|
|
<field name="arch" type="xml">
|
|
<form>
|
|
<sheet>
|
|
<group>
|
|
<group>
|
|
<div>
|
|
<field name="name" class="oe_inline"
|
|
style="font-size: 30px;"
|
|
placeholder="Block Name" required="1"/>
|
|
</div>
|
|
</group>
|
|
</group>
|
|
<group>
|
|
<group>
|
|
<field name="model_id"
|
|
required="[('edit_mode','=', True)]"
|
|
options="{'no_create_edit':True,'no_create': True}"/>
|
|
<field name="client_action_id" invisible="1"/>
|
|
<field name="model_name" invisible="1"/>
|
|
<field name="edit_mode" invisible="1"/>
|
|
<field name="operation"
|
|
required="[('edit_mode','=', True)]"/>
|
|
<field name="measured_field_id"
|
|
required="[('edit_mode','=', True)]"
|
|
options="{'no_create_edit':True, 'no_create': True }"
|
|
domain="[('model_id','=',model_id), ('ttype','in',['float','integer','monetary']), ('store', '=', True)]"/>
|
|
<field name="filter" widget="domain"
|
|
options="{'model': 'model_name'}"/>
|
|
</group>
|
|
</group>
|
|
<group string="Block Information">
|
|
<group>
|
|
<field name="type" required="1"/>
|
|
<field name="graph_type"
|
|
invisible="type == 'tile'"/>
|
|
<field name="fa_icon"
|
|
invisible="type == 'graph'"/>
|
|
<field name="group_by_id" invisible="type == 'tile'"
|
|
options="{'no_create_edit':True, 'no_create': True}"
|
|
required="[('edit_mode','=', True),('type','=','graph')]"
|
|
domain="[('model_id','=',model_id), ('ttype','!=','one2many'), ('store', '=', True)]"/>
|
|
<field name="tile_color"
|
|
invisible="type == 'graph'"
|
|
widget="color"/>
|
|
<field name="val_color"
|
|
invisible="type == 'graph'"
|
|
widget="color"/>
|
|
<field name="text_color"
|
|
invisible="type == 'graph'"
|
|
widget="color"/>
|
|
</group>
|
|
</group>
|
|
</sheet>
|
|
</form>
|
|
</field>
|
|
</record>
|
|
<!--List view of the dashboard block-->
|
|
<record id="dashboard_block_view_list" model="ir.ui.view">
|
|
<field name="name">dashboard.block.view.list</field>
|
|
<field name="model">dashboard.block</field>
|
|
<field name="arch" type="xml">
|
|
<list>
|
|
<field name="name"/>
|
|
<field name="model_id"/>
|
|
<field name="type"/>
|
|
</list>
|
|
</field>
|
|
</record>
|
|
<!-- Action specified for the dashboard block-->
|
|
<record id="dashboard_block_action" model="ir.actions.act_window">
|
|
<field name="name">Dashboard Block</field>
|
|
<field name="type">ir.actions.act_window</field>
|
|
<field name="res_model">dashboard.block</field>
|
|
<field name="view_mode">list,form</field>
|
|
<field name="context">{'default_edit_mode' : True}</field>
|
|
</record>
|
|
<!--Menu Item for the model Dashboard Blocks-->
|
|
<menuitem name="Dashboard Blocks" id="dashboard_block_menu"
|
|
parent="odoo_dynamic_dashboard.menu_dashboard"
|
|
sequence="5" action="dashboard_block_action"/>
|
|
</odoo>
|
|
|