Ir al contenido
Menú
Se marcó esta pregunta
3 Respuestas
5613 Vistas

Hi,
I need to add a button below the download button in the sale order portal view. But It appears near the download button.My xml code is given below:

<template id="sale_order_portal_id" name="sale_order_portal" inherit_id="sale.sale_order_portal_template">
            <xpath expr="//div[hasclass('o_download_pdf')]" position="inside"
                        <div class="btn-group flex-grow-1 mr-1 mb-1">
                        <a class="btn btn-secondary btn-block o_download_btn"  t-att-href="sale_order.get_portal_url(report_type='pdf', download=True)" title="Download"><i class="fa fa-download"/> Download</a>
                        </div>
               </xpath>
 </template>
Avatar
Descartar
Mejor respuesta

Hi,

Can you try like below code

<template id="sale_order_portal_id" name="sale_order_portal" inherit_id="sale.sale_order_portal_template">
   <xpath expr="//div[hasclass('o_download_pdf')]" position="inside">
       <li class="list-group-item flex-grow-1">
           <div class="o_download_pdf btn-toolbar flex-sm-nowrap">
               <div class="btn-group flex-grow-1 mr-1 mb-1">
               <a class="btn btn-secondary btn-block o_download_btn"  t-att-href="sale_order.get_portal_url(report_type='pdf', download=True)" title="Download"><i class="fa fa-download"/> Download</a>
               </div>
           </div>
       </li>
   </xpath>
</template>

Regards

Avatar
Descartar
Mejor respuesta

Hi,

I am new to Odoo. Is there any way to change the report template type when the download button is clicked, instead of using the default template?"

Avatar
Descartar
Mejor respuesta

Hi Sergio:

That's because the div with the o_download_pdf class also has a flex-sm-nowrap class which is forcing the buttons to be displayed in one line.

Avatar
Descartar