[FIX] l10n_it_stock_ddt: trim NumeroDDT for complience

Based on the government documentation, NumeroDDT should be alphanumeric format
and max length 20 characters. Currently it's possible to NumeroDDT larger
than 20 characters which will fail if sent to the authorities.

Now this value will be trimmed to the last 20 characters to respect the
specifications.

opw-3343345

closes odoo/odoo#124873

X-original-commit: f6b4614b7b907a3f45190b0a3c864d458423b6d7
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Thomas Beckers (tbs) <tbs@odoo.com>
This commit is contained in:
Thomas Beckers
2023-06-14 09:39:05 +02:00
parent 40c99636c9
commit 364e13da96
@@ -4,7 +4,7 @@
<xpath expr='//DatiDDT' position="after">
<t t-if="ddt_dict and not record.l10n_it_ddt_id" t-foreach="ddt_dict" t-as="picking">
<DatiDDT>
<NumeroDDT t-esc="picking.l10n_it_ddt_number"/>
<NumeroDDT t-esc="format_alphanumeric(picking.l10n_it_ddt_number[-20:])"/>
<DataDDT t-esc="format_date(picking.date)"/>
<t t-if="len(ddt_dict) > 1" t-foreach="ddt_dict[picking]" t-as="line_ref">
<RiferimentoNumeroLinea t-esc="line_ref"/>