I want to repeat columns in a rml report using the method 'repeatIn' inside a tag -td- but didn't have success.
I need some help please.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
I want to repeat columns in a rml report using the method 'repeatIn' inside a tag -td- but didn't have success.
I need some help please.
Drees,
For this in .py you need to have something like this:
def your_function_name(self,your_object_passing_from_rml_if_any):
lis=[]
emp_ids = self.pool.get('hr.employee').search(self.cr, self.uid, []) # or whatever criteria to get employee ids
for obj in self.pool.get('hr.employee').browse(self.cr, self.uid, emp_ids):
dic={}
dic['name'] =obj.name
lis.append(dic)
return lis
and in xml:
<para style="Your_style">[[ repeatIn(your_function_name(your_object_declared_above_using_repeatIn_if_any),'obj') ]]</para>
<blockTable colWidths = "100,100,100,100,100,100" style = "Your_style" >
<tr>
<td> [[ obj['name'] ]]
</td>
</tr>
</blocktable>
Hope it helps!
Pawan thanks a lot fir the answer. But the python is ok :) but the problem is with the rml i want to make each employee in a td ( one cell) on the horizontal
Pawan how can i work with [[ repeatIn(o.invoice_line,'l', 'td') ]] : cycle of each line, and for each row of data to create a cell????
pawan are u here please my friend!!!
Drees, i have gone through it, i didn't got anyway out till now to get this done,but of course there must be some.
And regarding this: [[ repeatIn(o.invoice_line,'l', 'td') ]] , this can be used if you are using verion 4.1.X........ if this works, it will surely get your problem solved.
So what can be the solution. Really i am blocked from two days ago. Can you suggest some thing to me as i was accustomed??
Pawan v4.1.X is the version of openoffice or what??
Yes Drees, its openoffice version only!! Did you got any solution ?
No i didnt get any solution. But, are you sure if i change the version o my openoffice it will be ok. i regret if i change and nothing ll change. Look at this link friend: https://www.odoo.com/fr_FR/forum/help-1/question/repeatin-dont-work-inside-a-tag-td-for-repeat-columns-in-rml-reports-18641#answer-18756
pawan my friend are you here please??
Friends!!!
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.
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign upRelated Posts | Replies | Views | Activity | |
---|---|---|---|---|
|
8
May 18
|
7430 | ||
|
0
Apr 18
|
1958 | ||
|
1
Mar 18
|
3526 | ||
|
0
Feb 18
|
2518 | ||
|
1
Sep 15
|
2771 |