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 position result on the horizontal?

By
Drees Far
on 8/31/15, 6:31 AM 300 views

Friends!!

I am creating a new report in my OpenERP:

Python:

def get_employee_lines(self, context=None):

print ('--------------------MOMO----------------------')

res_list=[]

payslip_line = self.pool.get('hr.payslip')

print payslip_line

obj_ids = payslip_line.search(self.cr, self.uid, [])

print obj_ids

for res in payslip_line.read(self.cr, self.uid, obj_ids, ['id', 'employee_id'], context=False):

print res['employee_id'][1]

obj = {}

obj['name'] = res['employee_id'][1]

res_list.append(obj)

return res_list

RML:


<tr>

<td>

<para style="P9">NOM EMPLOYÉ</para>

</td>

<td>

<para style="P7">[[ repeatIn(get_employee_lines(), 'o') ]]</para>

<para style="P7">[[ o['name'] ]]</para>

</td>

<td>

<para style="P7">

<font color="white"> </font>

</para>

</td>

</tr>

I want to get my result not vertically, i want to get them side by side on the horizontal:

Please help..

0

Drees Far

--Drees Far--
1130
| 5 2 6
Tunis, Tunisia
--Drees Far--
Drees Far
On 9/3/15, 5:39 AM

Guys!!!!

Here is the answer.

First, i had to change the version of my OpenOffice which is v4.1.X.

Second, i used [[ repeatIn(get_employee_lines(example.company_id,example.date_start,example.date_end), 'o', 'td') ]] which Loop on every line and make a new table cell for each line.

So here is the right answer:

<tr>

<td>

<para style="P8">NOM EMPLOYÉ</para>

</td>

<td>

<para style="P7">[[ repeatIn(get_employee_lines(example.company_id,example.date_start,example.date_end), 'o', 'td') ]]</para>

<para style="P7">[[ o['name'] ]]</para>

</td>

</tr>

Best Regards.

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: 8/31/15, 6:31 AM
Seen: 300 times
Last updated: 9/3/15, 5:40 AM