Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
3 Trả lời
5618 Lượt xem

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>
Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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.

Ảnh đại diện
Huỷ bỏ