Minh-Hung Nguyen
Minh-Hung Nguyen

Reputation: 1254

Customize dashboard in Odoo/Open ERP

Odoo/openerp 8 supports creating dashboard in which we can add multiple reports into it.
My question is: How can we inherit this dashboard to customize it?
For example, I want to add a button which helps clone the dashboard to another user.
It seems that this dashboard is not a usual FormView.

Upvotes: 3

Views: 5736

Answers (2)

raBinn
raBinn

Reputation: 182

Try to make formview for yourself :-)

This is a good example:

<?xml version="1.0" encoding="UTF-8"?>
<openerp>
 <data>     
    <record model="ir.actions.act_window" id="act_centiro_stocks_tree_pendientes">
        <field name="name">Centiro stock</field>
        <field name="res_model">stock.picking</field>
        <field name="view_type">tree</field> <!-- form -->
        <field name="view_mode">tree</field>
        <field name="domain">[('state', 'not in', ('assigned','done'))]</field>
    </record>
    <record model="ir.actions.act_window" id="act_centiro_stocks_tree_procesados">
        <field name="name">Centiro stock</field>
        <field name="res_model">stock.picking</field>
        <field name="view_type">tree</field> <!-- form -->
        <field name="view_mode">tree</field>
        <field name="domain">[('state', 'in', ('assigned','done'))]</field>
    </record>

    <record model="ir.actions.act_window" id="act_centiro_stocks_graph">
        <field name="name">Operaciones Centiro</field>
        <field name="res_model">gc.operaciones.centiro</field>
        <field name="view_type">form</field>
        <field name="auto_refresh" eval="1" />
        <field name="view_mode">kanban,form</field>
    </record>

    <record model="ir.ui.view" id="board_view_stock_centiro_form">
        <field name="name">Stock Centiro</field>
        <field name="model">board.board</field>
        <field name="type">form</field>
        <field name="arch" type="xml">
            <form string="Centiro Stock Dashboard">
                <hpaned>
                    <child1>
                        <action string="Estado almacén Centiro" name="%(act_centiro_stocks_graph)d" colspan="2" />                            
                    </child1>
                    <child2>
                        <action string="Pedidos pendientes" name="%(act_centiro_stocks_tree_pendientes)d" colspan="2" />    
                        <action string="Pedidos sin ubicar" name="%(act_centiro_stocks_tree_procesados)d" colspan="2" />                          
                    </child2>                   
                </hpaned>
            </form>
        </field>
    </record>

    <record model="ir.actions.act_window" id="open_stock_centiro_board">
        <field name="name">Stock Centiro Dashboard</field>
        <field name="res_model">board.board</field>
        <field name="view_type">form</field>
        <field name="view_mode">form</field>
        <field name="usage">menu</field>
        <field name="view_id" ref="board_view_stock_centiro_form" />
    </record>

    <menuitem id="dashboard_menu" name="Dasboard custom module"
        parent="cabecera_dashboard_custom_module" action="open_stock_centiro_board" />

</data>

Good luck

Upvotes: 1

Mostafa Mohamed
Mostafa Mohamed

Reputation: 846

You can't inherit dashboards in Odoo 8.because dashboards is work like views container not usual view if you want to customize one .. just copy it's code and paste it in your module over again and customize what you need.

Upvotes: 2

Related Questions