odoo/odoo#196576

Created by Training, Louis Gobert (loug)
Merged at b3f4d00cddf7f6e59e07c3b0e4fc8dfa248ce62f

Statuses:

label
odoo-dev:17.0-l10n_es_edi_facturae-add-missing-certificate-fields-loug
head
444880db8ce9f5a2049bae50b1665b5f3af8811f
merged
4 months ago by Accounting, Ricardo Gomes Rodrigues (rigr)
odoo/odoo
17.0 #196576
saas-17.4 #199852
18.0 #199891
saas-18.1 #199982
saas-18.2 #200007
saas-18.3
master #200045

[FIX] l10n_es_edi_facturae: add missing certificate dields

Certain certificates contain additional fields beyond those currently included (CN, OU, O, C), such as "2.5.4.97" and "L".

Since these additional fields are not incorporated into the issuer name, attempts to validate the signed document on the following sites will result in errors:
- https://face.gob.es/es/facturas/validar-visualizar-facturas
- https://valide.redsara.es/valide/validarFirma/ejecutar.html

These errors typically indicate that the signature is either invalid and that the certificate does not match the values within <KeyInfo>. This discrepancy occurs because all certificate fields are included in the signature, but some are missing from the <X509IssuerName> field.

This fix adds the missing certificate fields to ensure consistency between the signature and the issuer name. Based on my tests, the order of these fields does not affect the validation process.

opw-4484906
opw-4482626