Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
2731 Представления

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

Аватар
Отменить
Related Posts Ответы Просмотры Активность
0
апр. 24
855
2
окт. 23
5258
3
авг. 25
2286
1
мая 25
2533
1
апр. 25
3509