This question has been flagged
5158 Views

Hi,

I try to create a custom view like kanban, tree, form.

I have a basic default module inherit from res.users with:

__init__.py

__openerp__.py

custom_view.py

custom_view.xml

to do that i have made:

  • add my custom view name to the VIEW_TYPES,

if 'customview' not in base.ir.ir_actions.VIEW_TYPES:
    base.ir.ir_actions.VIEW_TYPES.append(('customview', 'CustomView'))

 

  • After I write my xml file:

<openerp>

    <record id="action_custom_view" model="ir.actions.act_window">
      <field name='name'>Users custom view</field>
      <field name='type'>ir.actions.act_window</field>
      <field name='res_model'>res.users</field>
      <field name='view_type'>form</field>
      <field name='view_mode'>tree,form,customview</field>
    </record>

    <record id="custom_global_view" model="ir.ui.view">
      <field name="name">Custom Global View</field>
      <field name="model">res.users</field>
      <field name="arch" type="xml">
          <customview version="7.0">
              <field name="id"/>
          </customview>
      </field>
    </record>

</openerp>

 

And I have override the fields_view_get method in my custom_view.py file just to see if I get the view_type in input and everithing is ok.

 

Now I want to have the little icon on top of the right when I go into Settings/Users.

What I need to do this ? is this can be handle by Odoo ?

If Odoo can handle it, what I miss in my module ?

 

Thanks.

Avatar
Discard