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

I have a wizard defined. I am able to open the wizard with a menu item, as seen on the screenshot below (Quick Create Project). But how can I override the New button (circled)?



아바타
취소
베스트 답변

Hi,

You can hide the default “New” button and replace it with your own button that opens the wizard.



<record id="view_project_tree_inherit" model="ir.ui.view">

    <field name="name">project.project.tree.inherit</field>

    <field name="model">project.project</field>

    <field name="inherit_id" ref="project.view_project_tree"/>

    <field name="arch" type="xml">

        <!-- Hide default "New" button -->

        <xpath expr="//tree" position="attributes">

            <attribute name="create">false</attribute>

        </xpath>


        <!-- Add custom button to trigger wizard -->

        <xpath expr="//tree" position="after">

            <header>

                <button name="%(your_wizard_action)d"

                        type="action"

                        string="New"

                        class="oe_highlight"/>

            </header>

        </xpath>

    </field>

</record>



Hope it helps.

아바타
취소
관련 게시물 답글 화면 활동
1
9월 25
321
2
8월 25
558
2
8월 25
642
2
8월 25
694
0
8월 25
598