Odoo Help


Import data in qweb report

on 10/20/15, 5:29 AM 1,088 views

Hi all,

I created a report using the model event.event .

Any problem, my report running.

Now I would like to import external data to the other model (for example: res.partner)

class SportReport(models.AbstractModel):
    _name = ‘report.sport_event.report_company_sport’

    def _get_company(self):

        browse_reg = self.env[‘res.partner’].browse(self.company)

        return browse_reg

 def render_html(self, data=None):

            report_obj = self.env['report']

            report = report_obj._get_report_from_name('sport_event.report_company_sport')

            docargs = {

                'doc_ids': self._ids,

                'doc_model': report.model,

                'docs': self,
               'get_company': self._get_company,


            return report_obj.render(‘sport_event.report_company_sport', docargs)

In view :

<span t-raw="get_company(o)" />

Error :

QWebException: "" _get_company() takes exactly 1 argument (2given) " while evaluating

About This Community

This platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 10/20/15, 5:29 AM
Seen: 1088 times
Last updated: 10/21/15, 3:17 AM