c2c-oerpscenario team mailing list archive
-
c2c-oerpscenario team
-
Mailing list archive
-
Message #02996
[Bug 570409] Re: How to implement nested loops in RML reports
Hello Nhomar,
I would like to convert this bug to a question because the issue is
simply about properly understanding how to create nested repetitions
(repeatIn loops) in a SXW/RML report.
However Launchpad keeps crashing during the conversion, so I will close
the bug for now, feel free to create a corresponding Question or even
FAQ about it.
As a reminder, one2many or many2many fields cannot be displayed directly
in a report, so you need to use a trick like:
1. Join() the values, e.g:
[[ ",".join([x['ref'] for x in line['invoice']['payment_ids']]) or 'n/a' ]]
2. Use a nested "repeatIn" structure.
For a nested repeatIn you need to know that repeatIn works on 3 levels by default: table rows, sections, or whole document.
So for you text to be actually repeated (instead of showing the last value only) you need to put it inside a nested Table Row or Section.
If the default bevahior of repeatIn does not work for your case, you can
also add another parameter to repeatIn() which specifies the RML tag
that should be repeated. You need to be familiar with RML and RML
conversion to use this features, or analyze the converted RML to find
out what tag you can use, like 'para'.
Ultimately you should really look at existing reports for example,
because there are standard OpenERP reports using all these tricks.
Thanks!
** Changed in: openobject-server
Status: New => Invalid
--
How to implement nested loops in RML reports
https://bugs.launchpad.net/bugs/570409
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
Status in OpenObject Server: Invalid
Bug description:
Hello.
We are improving the Overdue Report, and we need to show the payments associated to a move line. We in the line make this.
[[ line['invoice']['payment_ids'] ]]
And the report print somthing like this:
[browse_record(account.move.line,
6687),
browse_record(account.move.line,
6686),
browse_record(account.move.line,
6685),
browse_record(account.move.line,
3582),
browse_record(account.move.line,
3338)]
If you can see is a list of objects, for this reason in the line i iterate with "repeatIn" function, then the result is:
blank line
blank line
..
..
...
browse_record(account.move.line,
3338)
How you can see only is showing me the last element on the list....
The generical structure is exactly the same of overdue.rml report in the account module. The problem is that my client needs to send to his customer the Invoice information and not the Accounting information.
I mean:
-------------------------------------------
LIST OF PARTNERS OBJECT
------------------------------------------
LIST OF LINES RELATED TO THIS PARTNER:
FIELD1 | FIELD2| FIELDN|invoice.payment_ids
------------------------------------------------------------
L1_DATA | L1_DATA | L1_DATA | payment1
| | | payment2
| | | payment3
| | | payment4
If you can see there are 3 repeatIn
-- one for partners
-- one for lines
-- one for payments
To proof the concept, please make 3 or more partial payments on an demos invoice and you need to left open.
I think this is a bug....
i attach the module developed by us, you should need to change the overdue_res.rml for overdue_res_try.rml on the definition, i attach the module crated for the improve. You can print the example on Partners View "Carta Edo. Cta. Resumido."
Thanks....