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

Hi,

Is it possible to create server action only for specific views? Like the server action should only be shown in form view and not in list view?

Thanks in advance.

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

Hi,In the server action you can specify the view type in binding_view_types.Here's an example for you to check

<record model="ir.actions.server" id="download_contact">
        <field name="name">Download (vCard)</field>
        <field name="model_id" ref="model_res_partner"/>
        <field name="binding_model_id" ref="model_res_partner"/>
<field name="binding_view_types">form</field>
        <field name="state">code</field>
        <field name="code">
            action = {
                'type': 'ir.actions.act_url',
'url': '/web_enterprise/partner/%d/vcard' % record.id,
                'target': 'self',
            }
        </field>
</record>


Hope it helps

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 4 24
865
2
thg 10 23
5263
3
thg 8 25
2309
1
thg 5 25
2541
1
thg 4 25
3512