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.

1

How to display records side by side in Qweb report

By
Abdullah Sofan
on 12/2/14, 2:15 PM 588 views

I wrote this Qweb report to display student IDs for printing:

==============================================================

<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>
        <template id="report_students">
            <t t-call="report.html_container">
            <t t-foreach="docs" t-as="o">
                                <table width="40%">
                                    <tr>
                                        <td>
                                            <img t-att-src="'data:image/png;base64,%s' % o.student_image" style="max-height:4cm; max-width:4cm;"/>
                                        </td>
                                        <td>
                                                <h5 t-field="o.name"/>
                                                <h5 t-field="o.student_number"/>
                                        </td>
                                    </tr>
                                </table>
            </t>
        </t>
        </template>
    </data>
</openerp>

 

=========================================================

Now when I try to print, the records are stacked on top of each other. How can I change the Qweb report so that it displays two records per row?

Thanks in advance

 

 

Can someone help... I am sure it's a very easy task for pros here.

Abdullah Sofan
on 12/3/14, 1:36 AM
2
Sajin Aziz
On 12/3/14, 1:50 AM

try this .

 <t t-foreach="docs" t-as="o">
                <div class="col-xs-6">
                <p> <span t-field="o.name" /> </p>
                </div>
 </t>

Thanks Sajin. Your code works. I really appreciate your help.

Abdullah Sofan
on 12/3/14, 2:24 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: 12/2/14, 2:15 PM
Seen: 588 times
Last updated: 3/16/15, 8:10 AM