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

Hello,

I have Sales Order model and Sales Order model with additional fields. I use them in different ways.

One sales order must stay default, another have additional fields.


I have created another Menu and Tree View. 

I cannot find how may i change Form View that is beeing opened after clicking "Create" in Tree view. ?


아바타
취소
베스트 답변

You can define different tree view,form view actions for models. Below code may be help you.

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

    <field name="name">Hotel Invoices</field>

    <field name="res_model">account.invoice</field>

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

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

    <field eval="False" name="view_id"/>

    <field name="domain">[('type','in',('out_invoice', 'out_refund')),('is_hotel_invoice','=',True)]</field>

    <field name="context">{'default_type':'out_invoice', 'type':'out_invoice', 'journal_type': 'sale'}</field>

    <field name="search_view_id" ref="account.view_account_invoice_filter"/>

</record>

<record id="action_hotel_invoice_tree1_view1" model="ir.actions.act_window.view">

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

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

    <field name="view_id" ref="your_new_tree_view_id"/>

    <field name="act_window_id" ref="action_hotel_invoice_tree1"/>

</record>

<record id="action_hotel_invoice_tree1_view2" model="ir.actions.act_window.view">

    <field eval="2" name="sequence"/>

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

    <field name="view_id" ref="your_new_form_view_id"/>

    <field name="act_window_id" ref="action_hotel_invoice_tree1"/>

</record>

<menuitem  name="Hotel Invoice" id="menu_hotel_invoices"  action="action_hotel_invoice_tree1"   parent="menu_hotel_reservation"/>' 

아바타
취소
관련 게시물 답글 화면 활동
1
3월 15
4510
0
3월 15
3503
3
8월 25
7320
0
6월 24
1537
0
2월 24
974