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

Jasper Reports (japser_reports) for Odoo 8, problem and solution.

By
Kitti Upariphutthiphong
on 2/15/15, 9:39 AM 2,434 views

First,  thank you Serpent CS for upgrading jasper_reports to work with Odoo 8.

https://github.com/JayVora-SerpentCS/Jasperv8

It works nicely. Except 1 thing, on Sales Order form, it does not disply order lines. I found that despite we have declare, as example, OPENERP_RELATIONS = ["order_line"], as we want to loop through Sales Order's Lines. It still display only the 1st line.

After dig through code, I found the problem in /jasper_reports/JasperReports/BrowseDataGenerator.py -> in the method def generateIds(.....)

Following part of code think "order_line" is not a list (in v8 order_line is recordset), and so it just give log warning and ignore it. 

                if not isinstance(value, list):

                    self.warning("Field '%s' in model '%s' is not a relation." % (root, self.model))

                    return currentRecords

My solution is just comment this part out. And now it works !!!

Hi Kitti, Can you tell me how to declare the jasper report in xml? I hope the syntax is different from v7. It will be useful for many including me

Vivekrajan
on 10/27/15, 8:55 AM
Hi Vivek,

Here is how I did.

<!-- Quotation -->
<record id="nstda_msd_quotation" model="ir.actions.report.xml">
<field name="string">Quotation</field>
<field name="auto">True</field>
<field name="model">sale.order</field>
<field name="jasper_model_id" ref="sale.model_sale_order"/>
<field name="name">Quotation</field>
<field name="report_name">nstda.msd.quotation</field>
<field name="report_rml">nstda_msd_report/jrxml_reports/nstda_msd_quotation.jrxml</field>
<field name="menu">True</field>
<field name="header">False</field>
<field name="jasper_report">True</field>
<field name="jasper_output">pdf</field>
</record>
<record id="nstda_msd_quotation_values" model="ir.values">
<field name="name">Quotation</field>
<field name="model">sale.order</field>
<field name="key2" eval="'client_print_multi'" />
<field name="value_unpickle" eval="'ir.actions.report.xml, ' +str(nstda_msd_quotation)" />
</record>


Kitti

On Tue, Oct 27, 2015 at 7:55 PM, Vivekrajan <vivek-bics-gmail-com@mail.odoo.com> wrote:

Hi Kitti, Can you tell me how to declare the jasper report in xml? I hope the syntax is different from v7. It will be useful for many including me

--
Vivekrajan



--
Mobile: +66-(0)8-1841-7480
Your ERP Partner => www.ecosoft.co.th
Ecosoft Co. LTD, Kitti Upariphutthiphong
on 10/28/15, 9:54 AM
0
Andrea Cometa
On 4/9/15, 11:46 AM

thank you!!!

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: 2/15/15, 9:39 AM
Seen: 2434 times
Last updated: 10/28/15, 9:54 AM