This question has been flagged
3 Replies
6979 Views

Hi, i'm using OpenERP 7.0.

I've extended res.partner model and I've created custom form and trees in my custom module for a res.partner model. I've created three actions and 1 menu. It works fine, the only thing that is not working is that when I click the menu, an empty forms is being showed, instead of the tree with

    <record id="action_menora_socios" model="ir.actions.act_window">
        <field name="name">Socios</field>
        <field name="res_model">res.partner</field>
        <field name="view_type">form</field>
        <field name="view_mode">tree,form</field>
        <field name="domain">[('apellido','<>',False)]</field>
        <field name="help">Gestionar la base de socios, relaciones, asistencia a cursos y eventos</field>
    </record>

    <record id="action_menora_socios_tree" model="ir.actions.act_window">
        <!-- <field eval="1" name="sequence"/>  -->
        <field name="view_type">tree</field>
        <field name="view_id" ref="view_socios_menora_tree"/>
        <field name="act_window_id" ref="action_menora_socios"/>
    </record>

    <record id="action_menora_socios_tree" model="ir.actions.act_window">
        <!--<field eval="0" name="sequence"/> -->
        <field name="view_type">form</field>
        <field name="view_id" ref="view_socios_menora_form"/>
        <field name="act_window_id" ref="action_menora_socios"/>
    </record>

    <menuitem action="action_menora_socios" id="menu_menora_socios" 
            parent="menora.menu_gestion_socios" sequence="10" groups="base.group_user"/>

Is there something i'm doing wrong?

Avatar
Discard

Why are you creating three act.windows?

Author

Because i need two custom views, one for the form and the other for the tree.

Best Answer

Marcelo Hamra

Here you make a silly mistack on id of record. You give the same id in the ir.actions.act_window (id="action_menora_socios_tree"). Change the one Id as _form and it will work

Avatar
Discard
Best Answer

use sequence in the action of the respective tree and form views  as follows

Dont forget to give a lower sequence number for the tree action(gives it high priority) 

eg for tree action:

            <field name="sequence">1</field>

and for form action

            <field name="sequence">6</field>

Avatar
Discard
Best Answer

use sequence in the action of the respective tree and form views  as follows

Dont forget to give a lower sequence number for the tree action(gives it high priority) 

eg for tree action:

            <field name="sequence">1</field>

and for form action

            <field name="sequence">6</field>

Avatar
Discard