Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
3 ตอบกลับ
9100 มุมมอง

I created two action for same objects using 5,0,0 but in the second view I want to hide the create and edit button in tree and form view.

Is there any other way?

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi Nivas M,

Try adding the below context in your second action,

<field name="context">{'edit': 0,'create': 0}</field>
Eg:

<record id="action_resignation_stages" model="ir.actions.act_window">
<field name="name">Overview</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">hr.resignation.stage</field>
<field name="view_mode">kanban</field>
<field name="context">{'edit': 0,'create': 0}</field>
</record>

Hope it Helps,
Kiran K

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Use 

<field name="context">{'create':False,'edit':False}field>

It will hide create and edit option in all the views in the action.

อวตาร
ละทิ้ง

Suspect karma faking detected for the user !!

คำตอบที่ดีที่สุด

you can do this for tree and form view

<form string="new form" create="false" edit="false">
                    <field name="name"/>
                </form>


อวตาร
ละทิ้ง
ผู้เขียน

Hi Sahar,
This will hide create and edit button in both menus.
I used same form view in two different actions and I want to hide create and edit buttons only in second action form view alone not in first action form view.
Is there any other way?

Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ก.ค. 25
2243
2
ก.ค. 25
7728
2
ก.ค. 25
4141
2
ก.ค. 25
3902
2
มิ.ย. 25
2521