콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
3 답글
9928 화면

Here's the thing, i want to go to another tree view of another module when clicking on an element of the first tree view, instead of the predetermined form view. What i tried:

        <record id="view_destination_tree" model="ir.ui.view">
                    <field name="name">delivery.destination</field>
                    <field name="model">delivery.destination</field>
                    <field name="priority">1</field>
                    <field name="arch" type="xml">
                        <tree string="Destinos">
                            <field name="coordenadas" string="Coordenadas"/>
                            <field name="client" string="Cliente"/>
                            <field name="is_default" string="Predeterminado"/>
                        </tree>
                    </field>
        </record>

        <record id="view_clients" model="ir.ui.view">
                    <field name="name">client.dest</field>
                    <field name="model">res.partner</field>
                    <field name="priority">1</field>
                    <field name="arch" type="xml">
                        <tree string="Clientes con Destinos">
                            <field name="name" string="Cliente"/>
                            <field name="has_destination" string="Tiene destino"/>
                        </tree>
                    </field>
        </record>

        <record model="ir.actions.act_window" id="action_clients">

                    <field name="name">Lista de Destinos</field>

                    <field name="res_model">res.partner</field>
                    
                    <field name="view_id" ref="view_clients"/>

                    <field name="view_type">tree</field>

                    <field name="view_mode">tree</field>

        </record>

        <record model="ir.actions.act_window" id="action_tree_destination">

                    <field name="name">Lista de Destinos</field>

                    <field name="res_model">delivery.destination</field>
                    
                    <field name="view_id" ref="view_destination_tree"/>

                    <field name="view_type">tree</field>

                    <field name="view_mode">tree</field>

        </record>

<menuitem id="main_menu_ruta" name="Rutas"/>
            <menuitem id="Rutas" parent="main_menu_ruta" name="Rutas"/>
            <menuitem id="Destinos" parent="Rutas" action="action_tree_destination" name="Destinos"/>

I want to call action_clients when clicking in view_destination_tree. I tried some things but the clicking doesn't get me anywhere.

아바타
취소

Hello,

Please try to this ways:

<button name="%(action_tree_destination)d" string="Open Tree" class="oe_edit_only" type="action"></button>

베스트 답변

Hi,

You can try the code below

<record id="action_tree_destination" model="ir.actions.act_window">
<field name="name">Lista de Destinos</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">delivery.destination</field>
<field name="view_mode">tree,form</field>
<field name="view_ids" eval="[(5, 0, 0),
(0, 0, {'view_mode': 'tree', 'view_id': ref('module_name.view_id')}),
(0, 0, {'view_mode': 'form', 'view_id': ref('module_name.view_id')})]"/>
</record>

Regards

아바타
취소
관련 게시물 답글 화면 활동
2
9월 23
6953
2
3월 23
45605
2
12월 23
56228
0
3월 22
1668
1
10월 19
3855