[FIX] account_edi_ubl: convert narration to text before setting it in the xml.
closes odoo/odoo#73818 X-original-commit: 20490dc384310c1de4ec5fe02f90af030cc18ca7 Signed-off-by: Laurent Smet <smetl@users.noreply.github.com> Signed-off-by: bfr-o <bfr-o@users.noreply.github.com>
This commit is contained in:
@@ -117,7 +117,7 @@
|
||||
<cbc:ID t-esc="record.name"/>
|
||||
<cbc:IssueDate t-esc="record.invoice_date"/>
|
||||
<cbc:InvoiceTypeCode t-esc="type_code"/>
|
||||
<cbc:Note t-esc="record.narration"/>
|
||||
<cbc:Note t-if="note" t-esc="note"/>
|
||||
<cbc:DocumentCurrencyCode t-esc="record.currency_id.name"/>
|
||||
<cbc:BuyerReference t-esc="record.commercial_partner_id.name"/>
|
||||
<cac:OrderReference t-if="record.invoice_origin">
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
from odoo import api, models, fields, tools, _
|
||||
from odoo.tools import DEFAULT_SERVER_DATE_FORMAT, float_repr
|
||||
from odoo import models, fields
|
||||
from odoo.tools import float_repr, html2plaintext
|
||||
from odoo.tests.common import Form
|
||||
|
||||
from pathlib import PureWindowsPath
|
||||
@@ -195,6 +195,7 @@ class AccountEdiFormat(models.Model):
|
||||
'type_code': 380 if invoice.move_type == 'out_invoice' else 381,
|
||||
'payment_means_code': 42 if invoice.journal_id.bank_account_id else 31,
|
||||
'bank_account': invoice.partner_bank_id,
|
||||
'note': html2plaintext(invoice.narration) if invoice.narration else False,
|
||||
'format_monetary': format_monetary,
|
||||
'customer_vals': {'partner': invoice.commercial_partner_id},
|
||||
'supplier_vals': {'partner': invoice.company_id.partner_id.commercial_partner_id},
|
||||
|
||||
@@ -115,7 +115,7 @@
|
||||
<cbc:IssueDate t-esc="record.invoice_date"/>
|
||||
<cbc:DueDate t-esc="record.invoice_date_due"/>
|
||||
<cbc:InvoiceTypeCode t-esc="type_code"/>
|
||||
<cbc:Note t-esc="record.narration"/>
|
||||
<cbc:Note t-if="note" t-esc="note"/>
|
||||
<cbc:DocumentCurrencyCode t-esc="record.currency_id.name"/>
|
||||
<cbc:TaxCurrencyCode t-if="record.currency_id != record.company_currency_id"
|
||||
t-esc="record.company_currency_id.name"/>
|
||||
|
||||
@@ -76,7 +76,6 @@ class TestL10nBeEdi(AccountEdiTestCommon):
|
||||
<ID>INV/2017/00001</ID>
|
||||
<IssueDate>2017-01-01</IssueDate>
|
||||
<InvoiceTypeCode>380</InvoiceTypeCode>
|
||||
<Note></Note>
|
||||
<DocumentCurrencyCode>Gol</DocumentCurrencyCode>
|
||||
<AccountingSupplierParty>
|
||||
<Party>
|
||||
|
||||
Reference in New Issue
Block a user