跳至內容
選單
此問題已被標幟
1 回覆
2756 瀏覽次數

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.

頭像
捨棄
最佳答案

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

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
0
4月 24
882
2
10月 23
5275
3
8月 25
2338
1
5月 25
2555
1
4月 25
3517