Skip to content

[16.0][FIX] l10n_es_facturae: The city field in the partner is required for the FacturaE process. If the user does not provide it, document generation fails and module crashes. #4130

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

Merged
merged 1 commit into from
Apr 11, 2025

Conversation

herminioelx
Copy link
Contributor

Sorry, my previous pull request had a confusing number of commits.

The change involves modifying the validation process, just to check the existence of some value in the city field for Spanish partners.

Part of the error message in Odoo:

File "/opt/addons/l10n-spain/l10n_es_facturae/reports/report_facturae.py", line 39, in generate_report
xml_facturae, content_type = super().generate_report(
^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/addons/reporting-engine/report_xml/reports/report_report_xml_abstract.py", line 53, in generate_report
result_bin = ir_report._render_template(ir_report.report_name, data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/odoo/odoo/addons/base/models/ir_actions_report.py", line 661, in _render_template
return view_obj._render_template(template, values).encode()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/odoo/odoo/addons/base/models/ir_ui_view.py", line 2135, in _render_template
return self.env['ir.qweb']._render(template, values)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/odoo/odoo/tools/profiler.py", line 294, in _tracked_method_render
return method_render(self, template, values, **options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/odoo/odoo/addons/base/models/ir_qweb.py", line 593, in _render
result = ''.join(rendering)
^^^^^^^^^^^^^^^^^^
File "<1758>", line 34, in template_1758
File "<1758>", line 23, in template_1758_content
File "<1757>", line 3040, in template_1757
File "<1757>", line 3022, in template_1757_content
File "<1757>", line 319, in template_1757_t_call_0
File "<1755>", line 341, in template_1755
File "<1755>", line 142, in template_1755_content
File "<1754>", line 170, in template_1754
File "<1754>", line 116, in template_1754_content
File "<1756>", line 327, in template_1756
odoo.addons.base.models.ir_qweb.QWebException: Error while render the template
TypeError: 'bool' object is not subscriptable
Template: l10n_es_facturae.address_contact
Path: /t/AddressInSpain/Town
Node:

@OCA-git-bot
Copy link
Contributor

Hi @etobella,
some modules you are maintaining are being modified, check this out!

@pedrobaeza pedrobaeza added this to the 16.0 milestone Apr 8, 2025
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.

/ocabot merge patch

Llévalo por favor a 17

OCA-git-bot added a commit that referenced this pull request Apr 8, 2025
Signed-off-by pedrobaeza
@OCA-git-bot
Copy link
Contributor

What a great day to merge this nice PR. Let's do it!
Prepared branch 16.0-ocabot-merge-pr-4130-by-pedrobaeza-bump-patch, awaiting test results.

@OCA-git-bot
Copy link
Contributor

@pedrobaeza your merge command was aborted due to failed check(s), which you can inspect on this commit of 16.0-ocabot-merge-pr-4130-by-pedrobaeza-bump-patch.

After fixing the problem, you can re-issue a merge command. Please refrain from merging manually as it will most probably make the target branch red.

@pedrobaeza
Copy link
Member

@herminioelx no me había dado cuenta que el pre-commit no lo tienes correcto:

https://github.com/OCA/maintainer-tools/wiki/Install-pre-commit

@herminioelx
Copy link
Contributor Author

No tengo ese software y tampoco entiendo que hay mal en el código. ¿El literal en la llamada a ValidationError es muy 'largo'?

@pedrobaeza
Copy link
Member

Ya te he puesto la referencia de cómo instalarlo, pero si no mira en el error, y te pone cómo debería estar el código formateado y replícalo manualmente.

@pedrobaeza
Copy link
Member

Ponlo por favor en un solo commit.

@herminioelx herminioelx force-pushed the 16.0-ciudad branch 3 times, most recently from 8de72de to 838700d Compare April 10, 2025 18:59
… the FacturaE process. If the user does not provide it, document generation fails and module crashes.
@herminioelx herminioelx changed the title [FIX] l10n_es_facturae: The city field in the partner is required for the FacturaE process. If the user does not provide it, document generation fails and module crashes. [16.0][FIX] l10n_es_facturae: The city field in the partner is required for the FacturaE process. If the user does not provide it, document generation fails and module crashes. Apr 10, 2025
@pedrobaeza
Copy link
Member

/ocabot merge patch

@OCA-git-bot
Copy link
Contributor

This PR looks fantastic, let's merge it!
Prepared branch 16.0-ocabot-merge-pr-4130-by-pedrobaeza-bump-patch, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 1a3cb35 into OCA:16.0 Apr 11, 2025
5 of 7 checks passed
@OCA-git-bot
Copy link
Contributor

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

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