Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
3881 Vistas

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 ?

Avatar
Descartar
Mejor respuesta

<?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>

Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
1
may 21
3166
1
may 24
2989
1
abr 24
26559
1
nov 22
2510
2
jul 22
3205