Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.8k views
in Technique[技术] by (71.8m points)

python - Create a Report from POS Session in Odoo 13

I added a custom button in POS to generate a pdf. How can I get the same information when printing the receipt from the standard button.

def print_report(self):
       return self.env.ref('pos_print.pos_ord_session_reprt').report_action(self,data={'name':'POS Order Report'})



 <t t-extend="ReceiptScreenWidget">
       <t t-jquery=".button.print" t-operation="after">
           <div class="button order-print">
               <i class='fa fa-print'></i>
               Print POS Order
           </div>
       </t>
   </t>

 <report
           id="pos_ord_session_reprt"
           string="Pos Order Report"
           model="sale.wizard"
           report_type="qweb-pdf"
           file="pos_print.pos_order_template"
           name="pos_print.pos_order_template"
   />


   <template id="pos_order_template">
       <t t-call="web.html_container">
           <t t-call="web.external_layout">
               <div class="page">
                   <h2 align="center">POS Order Report</h2>

               </div>
           </t>
       </t>
   </template>

Any help please? Thanks.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神解答

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...