Skip to Content
Menu
This question has been flagged
3 Replies
5614 Rodiniai

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>
Portretas
Atmesti
Best Answer

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

Portretas
Atmesti
Best Answer

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

Portretas
Atmesti
Best Answer

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.

Portretas
Atmesti