Skip to content

Commit 8bcee03

Browse files
committed
[IMP] l10n_uy_ux: always use line.name in aml
1 parent 7ba4a02 commit 8bcee03

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

l10n_uy_ux/models/account_move.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,25 @@ def _compute_l10n_latam_document_number(self):
302302
name = name.split(" ")[-1]
303303
rec.l10n_latam_document_number = name
304304

305+
def _l10n_uy_edi_get_line_nom_and_desc(self, aml):
306+
"""
307+
Sobreescribimos este método que devuelve el valor de NomItem y DscItem para cada línea del comprobante,
308+
para utilizar siempre la descripción de la línea (aml.name) como está en Odoo nativo, ya que a veces se quiere
309+
modificar el valor a mostrar en la factura manteniendo el producto en la línea.
310+
"""
311+
# B7 NomItem, B8 DscItem
312+
nom_item = aml.name and aml.name[:80] or "-"
313+
description = aml.name and aml.name[80:] or ""
314+
315+
if aml.l10n_uy_edi_addenda_ids:
316+
adenda = [
317+
" {%s}" % addenda.content if addenda.is_legend else " " + addenda.content
318+
for addenda in aml.l10n_uy_edi_addenda_ids
319+
]
320+
description += str(*adenda)
321+
322+
return nom_item, description
323+
305324
# Nuevos metodos
306325

307326
def action_l10n_uy_get_pdf(self):

0 commit comments

Comments
 (0)