콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
5796 화면

Hello All,

I am facing problems in Qweb report:

Here is my cases.

1) If I am returing report or printing report from methods without parser than it works well.

2) If I have parser of report and returning from method than it is passing wrong model name (wizard model name) on template as doc_model, So having problem on data access of that report.

3) If I want to use combination of both parser and returing report from method for that i have to return data in list of dictionary to access which is not good solution. I want access data from recordset it self.

Is Any one has face this issue? any idea about this issue? Is this limitation or Am I missing somthing.

Regards,

Anil.

 

아바타
취소
작성자 베스트 답변

Hi,

Here is the solutions for this, actually its passing, I found in odoo technical document.

We need to override render_html method in our abstract report class.

class ParticularReport(models.AbstractModel):

_name = 'report.module.report_name'

@api.multi

def render_html(self, data=None):

report_obj = self.env['report']

report = report_obj._get_report_from_name('module.report_name')

docargs = {

'doc_ids': self._ids,

'doc_model': report.model,

'docs': self,

}

return report_obj.render('module.report_name', docargs)


Click here for more reference

아바타
취소