Skip to Content
Menu
This question has been flagged

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

Avatar
Discard
Related Posts Replies Views Activity
0
Mar 15
10524
4
Jan 24
12293
4
Nov 24
5233
1
Mar 24
393
3
Sep 23
22642