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

[17.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. #4135

Merged
merged 1 commit into from
Apr 11, 2025

Conversation

herminioelx
Copy link
Contributor

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/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 686, in _render_template
return view_obj._render_template(template, values).encode()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/odoo/odoo/addons/base/models/ir_ui_view.py", line 2061, 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/odoo17/odoo/addons/base/models/ir_qweb.py", line 605, in _render
result = ''.join(rendering)
^^^^^^^^^^^^^^^^^^
File "<1394>", line 34, in template_1394
File "<1394>", line 23, in template_1394_content
File "<1393>", line 3040, in template_1393
File "<1393>", line 3022, in template_1393_content
File "<1393>", line 319, in template_1393_t_call_0
File "<1391>", line 341, in template_1391
File "<1391>", line 142, in template_1391_content
File "<1390>", line 170, in template_1390
File "<1390>", line 116, in template_1390_content
File "<1392>", line 327, in template_1392
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 17.0 milestone Apr 11, 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

OCA-git-bot added a commit that referenced this pull request Apr 11, 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 17.0-ocabot-merge-pr-4135-by-pedrobaeza-bump-patch, awaiting test results.

@etobella
Copy link
Member

Ups, pre-commit is failing, @herminioelx can you check why?

@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 17.0-ocabot-merge-pr-4135-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.

@herminioelx
Copy link
Contributor Author

Ups, pre-commit is failing, @herminioelx can you check why?

Hi Enric, for me it's a nonsense error. The code is exactly the same as the used for the 16.0 branch. In fact I used the same commit.
If it has to fail because of the length of the string, why doesn't it fail in the code of branch 16.0?

… the FacturaE process. If the user does not provide it, document generation fails and module crashes.
@etobella
Copy link
Member

Los pre-commit pueden cambiar entre versiones, por eso se debe revisar los cherry-picks. Ya te lo he arreglado yo

@pedrobaeza
Copy link
Member

Herminio, pre-commit está ahí para asegurar una consistencia de formato entre todas las contribuciones. Instálalo en tu equipo y te olvidas (aunque claro, primero hay que empezar erradicando Windows, ya que ahí se multiplican las dificultades por 10).

/ocabot merge patch

@OCA-git-bot
Copy link
Contributor

Hey, thanks for contributing! Proceeding to merge this for you.
Prepared branch 17.0-ocabot-merge-pr-4135-by-pedrobaeza-bump-patch, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 621c196 into OCA:17.0 Apr 11, 2025
5 of 7 checks passed
@OCA-git-bot
Copy link
Contributor

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

@herminioelx
Copy link
Contributor Author

Herminio, pre-commit está ahí para asegurar una consistencia de formato entre todas las contribuciones. Instálalo en tu equipo y te olvidas (aunque claro, primero hay que empezar erradicando Windows, ya que ahí se multiplican las dificultades por 10).

/ocabot merge patch

Y si usas todavía Windows 7 como yo más :)

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