Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
3 Odpowiedzi
5622 Widoki

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>
Awatar
Odrzuć
Najlepsza odpowiedź

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

Awatar
Odrzuć
Najlepsza odpowiedź

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

Awatar
Odrzuć
Najlepsza odpowiedź

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.

Awatar
Odrzuć