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

I want to add a button near download in attachment to open a pdf on that button click in new tab. I am not able to extend mail.Attachment template in odoo14. Here is my code:-

<?xml version="1.0" encoding="UTF-8"?>

<templates>

    <t t-extend="mail.Attachment">

     <t>

        <t t-jquery=".o_Attachment_actionDownload" t-operation="inner">

            <span

                  class="fa fa-search ml4 o_attachment_preview"

                  t-att-data-id="attachment.id"

                  t-att-data-url="attachment.url"

                  t-on-click="_onPreviewAttachment"

                  t-attf-title="Preview #{attachment.name} in side panel"/>

      </t>

    </t>

    </t>

</templates>


What changes can make it work ?

아바타
취소
베스트 답변

<?xml version="1.0" encoding="UTF-8"?>

<templates xml:space="preserve">

    <t t-name="mail.AttachmentSlider" 

       t-inherit="mail.Attachment"

       t-inherit-mode="extension"

       owl="1">

        <xpath expr="//div[@class='o_Attachment']" position="inside">

            <span> TEST</span>

        </xpath>

    </t>

</templates>

아바타
취소
관련 게시물 답글 화면 활동
1
5월 21
3437
1
5월 24
3350
1
4월 24
27140
1
11월 22
2723
2
7월 22
3482