Odoo Help

Welcome!

This community 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.

0

How to create a qweb report with number of pages equal to order lines ?

By
Karthik Arumugam
on 11/11/15, 3:19 AM 422 views

How to create a report with number of pages equal to order lines

For example : i have 4 lines in sale order and i have to print that report 4 times

Any body help me to solve this issue.


2

zbik

--zbik--
5976
| 6 4 7
Lodz, Poland
--zbik--


zbik
On 11/11/15, 4:03 AM

Example:

<template id="report_foo_document">
<t t-foreach="len(o.lines)" t-as="copy">
<t t-call="report.external_layout">
<div class="page">
.....
.....
</div>
</t>
</t>
</template>



Thanks for reply.

Karthik Arumugam
on 11/11/15, 5:51 AM
1

Ahmed M.Elmubarak

--Ahmed M.Elmubarak--
2988
| 5 3 5
Sudan
--Ahmed M.Elmubarak--


Ahmed M.Elmubarak
On 11/11/15, 4:11 AM

Hello,

To achieve this, you need to add an intermediate template to this template: code  

to be called from the translate_doc instead of sale.report_saleorder_lines. then in the second template we'll call sale.report_saleorder_lines template by the numbers of lines. So it'll be like:

<template id="report_saleorder">
<t t-call="report.html_container">
<t t-foreach="doc_ids" t-as="doc_id">
<t t-raw="translate_doc(doc_id, doc_model, 'partner_id.lang', 'sale.report_saleorder_lines')"/>
</t>
</t>
</template>
<template id="report_saleorder_lines">
<t t-call="report.html_container">
<t t-foreach="o.order_line" t-as="l">
<t t-call="sale.report_saleorder_document"/>
</t>
</t>
</template>


This will end up with report copies equal to the lines in the SO.

I hope it'll helps

Regards,

Also the answer of zbik works fine, and more simple than mine. I just didn't see it :)

Ahmed M.Elmubarak
on 11/11/15, 4:18 AM

Thanks for reply.

Karthik Arumugam
on 11/11/15, 5:52 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 11/11/15, 3:19 AM
Seen: 422 times
Last updated: 11/11/15, 4:36 AM