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

[16.0][FIX] account_invoice_facturx: crash when name is empty on invoice line #915

Merged
merged 1 commit into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions account_invoice_facturx/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"external_dependencies": {"python": ["factur-x"]},
"data": [
"views/res_partner.xml",
"views/account_move.xml",
"views/res_config_settings.xml",
],
"post_init_hook": "set_xml_format_in_pdf_invoice_to_facturx",
Expand Down
2 changes: 1 addition & 1 deletion account_invoice_facturx/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ def _set_iline_product_information(self, iline, trade_product, ns):
)
product_code.text = iline.product_id.default_code
product_name = etree.SubElement(trade_product, ns["ram"] + "Name")
product_name.text = iline.name
product_name.text = iline.name or _("No invoice line label")
if (
ns["level"] in PROFILES_EN_UP
and iline.product_id
Expand Down
1 change: 0 additions & 1 deletion account_invoice_facturx/static/description/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
Expand Down
24 changes: 24 additions & 0 deletions account_invoice_facturx/views/account_move.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8" ?>
<!--
Copyright 2024 Akretion France (http://www.akretion.com/)
@author: Alexis de Lattre <alexis.delattre@akretion.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<odoo>


<record id="view_move_form" model="ir.ui.view">
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_move_form" />
<field name="arch" type="xml">
<xpath
expr="//page[@id='invoice_tab']/field[@name='invoice_line_ids']/tree/field[@name='name']"
position="attributes"
>
<attribute name="required">1</attribute>
</xpath>
</field>
</record>


</odoo>
Loading