Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
1 Відповісти
2228 Переглядів

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
641
2
жовт. 23
4942
1
трав. 25
1659
1
квіт. 25
2772
1
квіт. 25
3522