콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다

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
846
2
10월 23
5257
3
8월 25
2267
1
5월 25
2526
1
4월 25
3506