JayVora-SerpentCS / Jasperreports_odoo

Jasper Reports Engine for Odoo
http://www.serpentcs.com
81 stars 144 forks source link

OPENERP_RELATIONS doesn't work in 8.0 #1

Closed JBF91 closed 9 years ago

JBF91 commented 9 years ago

Hello! I dont know if this is the proper place to say that this Jasper Reports version for branch 8.0 does not support relational fields using OPENER_RELATIONS parameter.

Do I have to use another parameter?

Thank you!

carlosmiras commented 9 years ago

This problem is because Odoo 8.0 use new api models and it doesn't take the fields one2many or many2many like a list.

I replaced this code for fix it: file: jasper_reports/JasperReports/BrowseDataGenerator.py (line 130)

if not isinstance(value, list):
                    self.warning("Field '%s' in model '%s' is not a relation." % (root, self.model))
                    return currentRecords
if not isinstance(value, orm.browse_record_list):
                    self.warning("Field '%s' in model '%s' is not a relation." % (root, self.model))
                    return currentRecords
alejandroperezcosio commented 9 years ago

Thank you Carlos!! your change solves a problem which was killing me.. This change should be applied to the master branch ASAP!

scigghia commented 9 years ago

it works also for me thanks

JayVora-SerpentCS commented 9 years ago

Applied!