Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
3 Trả lời
8320 Lượt xem

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?

Ảnh đại diện
Huỷ bỏ

Why are you creating three act.windows?

Tác giả

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

Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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>

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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>

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 3 15
5723
0
thg 3 15
4030
3
thg 5 20
7455
0
thg 5 15
3480
0
thg 3 15
3827