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.

0

Import data in qweb report

By
Pierre
on 10/20/15, 5:29 AM 466 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



        @api.multi
 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

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: 10/20/15, 5:29 AM
Seen: 466 times
Last updated: 10/21/15, 3:17 AM