コンテンツへスキップ
メニュー
この質問にフラグが付けられました
3 返信
5621 ビュー

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>
アバター
破棄
最善の回答

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

アバター
破棄
最善の回答

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

アバター
破棄
最善の回答

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.

アバター
破棄