Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Create custom view like kanban, tree, form, ...

By
Clement Zotti
on 7/31/14, 1:52 PM 822 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.

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 7/31/14, 1:52 PM
Seen: 822 times
Last updated: 3/16/15, 8:10 AM