Odoo Ajuda


1 Resposta

Dasadiya Chaitanya Índia

--Dasadiya Chaitanya--
| 5 2 7
Ahmedabad, Índia
--Dasadiya Chaitanya--

I am passionate and dynamic programmer with simple and honest nature which has better expertise skill and knowledge on product development from the scratch. I am enthusiastic with the work and I would like to spend my valuable time to improve my qualitative work standard and developing carrier towards the hobbies of programming. I love my family, friends and some creative and analytical task, And I would like to spend my whole time with them.

Follow Me :

Linked In ||  Facebook  ||  Twitter 

Skype : dasadiya.chaitanya

Dasadiya Chaitanya Índia
12/07/19 06:50

I have also fixed the issue from my end after tried a lot more attempts

If any one will face the same issue in your future development so that they can also able to fix it quickly.

Create a method into specific model  : (cheque.cheque model) 

def get_invoice_details(self, invoice_ids,cheque):
    for line in invoice_ids:
        if line.is_vendor:

        pay_amt=line.payment_ids.filtered(lambda m: m.cheque_issued_id.id ==cheque.id).amount or 0.00
        for l in line.invoice_line_ids:
            desc+=str(l.product_id.default_code)+',' or ''
    for l in vals:
        if val<=len(vals):
        if val % 9 == 0:
    if container:
    return result

In this method I have set section key with its value into result of list for dictionary where we are using the same section to making the page break perfectly

Call the same method and iterate it into Qweb Template
<t t-foreach="o.get_invoice_details(o.invoice_ids,o)" t-as="line" >
                <div class="page">
                    <div class="col-xs-12">
                                <table style="width:100%">
                                            <th>Invoice Date</th>
                                            <th>Invoice # </th>
                                            <th>Invoice Amt</th>
                                            <th>Description  </th>
                                            <th style="text-align:right">Payment Amt</th>
                                    <t t-foreach="line.get('vals')" t-as="inv">
                                    <tbody class="sale_tbody">
                                                <span t-esc="inv.get('date')" />
                                                <span t-esc="inv.get('invoice_no')" />
                                                <span t-esc="o.decimal_formated_amount(float(inv.get('inv_amt',0.00)))" />

                                                <span t-esc="inv.get('description')" />
                                            <td style="text-align:right">
                                                <span t-esc="o.decimal_formated_amount2(float(inv.get('pay_amt',0.00)))" />                                             

                      <span t-if="line.get('section') % 9 == 0" style="page-break-after: always;">

As per the business logic of get_invoice_details() method which is return the data in list form and then we can user the same and render it into the XML template.

Odoo will manage the page break automatically when the condition will satisfy over the XML template system will automatically bifurcate the page according to source code.

I hope my answer may helpful for you :)

Faça uma Pergunta
Keep Informed
1 seguidor (es)
About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now