This question has been flagged
1 Reply
2969 Views

Hello,

I getting this error after editting on a tax module:

Odoo Server Error
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/odoo/addons/web/controllers/main.py", line 2032, in report_download
    response = self.report_routes(reportname, converter=converter, context=context, **data)
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 515, in response_wrap
    response = f(*args, **kw)
  File "/home/ubuntu/custom_modules/report_xlsx_helper/controllers/main.py", line 56, in report_routes
    reportname, docids, converter, **data
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 515, in response_wrap
    response = f(*args, **kw)
  File "/home/ubuntu/custom_modules/report_xlsx/controllers/main.py", line 49, in report_routes
    reportname, docids, converter, **data
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 515, in response_wrap
    response = f(*args, **kw)
  File "/usr/lib/python3/dist-packages/odoo/addons/web/controllers/main.py", line 1963, in report_routes
    pdf = report.with_context(context).render_qweb_pdf(docids, data=data)[0]
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_actions_report.py", line 734, in render_qweb_pdf
    html = self.with_context(context).render_qweb_html(res_ids, data=data)[0]
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_actions_report.py", line 773, in render_qweb_html
    data = self._get_rendering_context(docids, data)
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_actions_report.py", line 790, in _get_rendering_context
    data.update(report_model._get_report_values(docids, data=data))
AttributeError: 'report.account_bi_tax_report.report_bi_account_tax' object has no attribute '_get_report_values'
This is my models code:

class BiReportAccountTax(models.AbstractModel):
_name = 'report.account_bi_tax_report.report_bi_account_tax'

@api.model
def get_lines(self, options):
taxes = {}
details = {}
sales = []
purchases = []
cashes = []
banks = []
no_types = []
detail = self.env['account.move.line'].search(
[('tax_line_id', '=', None), ('tax_ids', '!=', False), ('date', '>=', options['date_from']),
('date', '<=', options['date_to'])])
May anyone help please in solving this error.

Thanks in advance.

Avatar
Discard
Best Answer

Hi,

If you are defining this report parser file, then you should have a function named _get_report_values in this model.

See: 

https://www.youtube.com/watch?v=JGWc1KjyIBk


So either define the above function in the above model, or change the get_lines function name to _get_report_values.

Thanks

Avatar
Discard