Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[14.0][FIX] account_invoice_report_grouped_by_picking. #326

Merged
merged 1 commit into from
Jul 10, 2024

Conversation

adasatorres
Copy link
Contributor

Hi, i found a error when i printed some account.move report without pickings and with note on line.

Error:
Odoo Server Error

Traceback (most recent call last):
File "/opt/odoo-server/odoo/addons/base/models/qweb.py", line 329, in _compiled_fn
return compiled(self, append, new, options, log)
File "", line 1, in template_account_report_invoice_document_3446
File "", line 2, in body_call_content_3444
File "", line 1, in foreach_3399
AttributeError: 'bool' object has no attribute 'get'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/opt/odoo-server/addons/web/controllers/main.py", line 2107, in report_download
response = self.report_routes(reportname, docids=docids, converter=converter, context=context)
File "/opt/odoo-server/odoo/http.py", line 544, in response_wrap
response = f(*args, **kw)
File "/opt/odoo-server/extra-addons/oca/reporting-engine/report_xlsx/controllers/main.py", line 18, in report_routes
return super(ReportController, self).report_routes(
File "/opt/odoo-server/odoo/http.py", line 544, in response_wrap
response = f(*args, **kw)
File "/opt/odoo-server/addons/web/controllers/main.py", line 2038, in report_routes
pdf = report.with_context(context)._render_qweb_pdf(docids, data=data)[0]
File "/opt/odoo-server/addons/account/models/ir_actions_report.py", line 54, in _render_qweb_pdf
return super()._render_qweb_pdf(res_ids=res_ids, data=data)
File "/opt/odoo-server/odoo/addons/base/models/ir_actions_report.py", line 896, in _render_qweb_pdf
html = self_sudo.with_context(context)._render_qweb_html(res_ids, data=data)[0]
File "/opt/odoo-server/extra-addons/oca/account-financial-reporting/account_financial_report/models/ir_actions_report.py", line 19, in _render_qweb_html
return super(IrActionsReport, obj)._render_qweb_html(docids, data)
File "/opt/odoo-server/odoo/addons/base/models/ir_actions_report.py", line 937, in _render_qweb_html
return self._render_template(self.report_name, data), 'html'
File "/opt/odoo-server/odoo/addons/base/models/ir_actions_report.py", line 672, in _render_template
return view_obj._render_template(template, values)
File "/opt/odoo-server/odoo/addons/base/models/ir_ui_view.py", line 1727, in _render_template
return self.browse(self.get_view_id(template))._render(values, engine)
File "/opt/odoo-server/addons/web_editor/models/ir_ui_view.py", line 28, in _render
return super(IrUiView, self)._render(values=values, engine=engine, minimal_qcontext=minimal_qcontext)
File "/opt/odoo-server/odoo/addons/base/models/ir_ui_view.py", line 1735, in _render
return self.env[engine]._render(self.id, qcontext)
File "/opt/odoo-server/odoo/addons/base/models/ir_qweb.py", line 55, in _render
result = super(IrQWeb, self)._render(id_or_xml_id, values=values, **context)
File "/opt/odoo-server/odoo/addons/base/models/qweb.py", line 254, in _render
self.compile(template, options)(self, body.append, values or {})
File "/opt/odoo-server/odoo/addons/base/models/qweb.py", line 331, in _compiled_fn
raise e
File "/opt/odoo-server/odoo/addons/base/models/qweb.py", line 329, in _compiled_fn
return compiled(self, append, new, options, log)
File "", line 1, in template_account_report_invoice_with_payments_3361
File "", line 2, in body_call_content_3359
File "", line 3, in foreach_3358
File "/opt/odoo-server/odoo/addons/base/models/qweb.py", line 336, in _compiled_fn
raise QWebException("Error to render compiling AST", e, path, node and etree.tostring(node[0], encoding='unicode'), name)
odoo.addons.base.models.qweb.QWebException: 'bool' object has no attribute 'get'
Traceback (most recent call last):
File "/opt/odoo-server/odoo/addons/base/models/qweb.py", line 329, in _compiled_fn
return compiled(self, append, new, options, log)
File "", line 1, in template_account_report_invoice_document_3446
File "", line 2, in body_call_content_3444
File "", line 1, in foreach_3399
AttributeError: 'bool' object has no attribute 'get'

Error to render compiling AST
AttributeError: 'bool' object has no attribute 'get'
Template: account.report_invoice_document
Path: /t/t/div/table/tbody/t[3]/tr[2]
Node:

Subtotal:



Example of account.move object:
image

Summary the next_line variable can be a list with a False inside, you must check that the value of position 0 before using the .get() method, in this line : <tr t-if="lines_group.get('is_last_section_notes') and (not next_line or not next_line[0].get('is_last_section_notes')) and subtotal">"

@pedrobaeza pedrobaeza added this to the 14.0 milestone Jul 10, 2024
Copy link
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, this is the same as #318, but removing my attribution, but no special problem. Take into account for the next time:

/ocabot merge minor

@OCA-git-bot
Copy link
Contributor

Hey, thanks for contributing! Proceeding to merge this for you.
Prepared branch 14.0-ocabot-merge-pr-326-by-pedrobaeza-bump-minor, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit f351d5c into OCA:14.0 Jul 10, 2024
7 checks passed
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at 59a5154. Thanks a lot for contributing to OCA. ❤️

@adasatorres
Copy link
Contributor Author

adasatorres commented Jul 10, 2024

@pedrobaeza I'm sorry, I didn't review on closed PR.

BT-etejeda pushed a commit to BT-etejeda/account-invoice-reporting that referenced this pull request Feb 6, 2025
Syncing from upstream OCA/account-invoice-reporting (17.0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants