Skip to content

Commit

Permalink
[FIX] l10n_uy_edi: Problemas con la desc del producto de mas de 80 ca…
Browse files Browse the repository at this point in the history
…ract.

Cuando comparamos la descripcion con el NomItem, y la descripcion tiene
mas de 80 caracteres tenemos un problema porque siempre se va a ser diferente.
Con este cambio contemplamos ese limite.

closes ingadhoc#224

Ticket: 78560
Signed-off-by: pablohmontenegro <[email protected]>
  • Loading branch information
mem-adhoc committed Sep 12, 2024
1 parent d87ac51 commit 32dfe55
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions l10n_uy_edi/models/l10n_uy_cfe.py
Original file line number Diff line number Diff line change
Expand Up @@ -1193,20 +1193,18 @@ def _uy_cfe_B7_NomItem(self, line):
if self._is_uy_inv_type_cfe() or self._is_uy_remito_type_cfe():
if line.product_id:
return line.product_id.display_name[:80]
elif line.name:
return line.name[:80]
else:
raise UserError(_('It is not allowed to post an invoice (id: %s) with one or more invoice lines without product and without label.' % line.move_id.id))
return '-'

def _uy_cfe_B8_DscItem(self, line, nomitem):
def _uy_cfe_B8_DscItem(self, line):
"""B8 Descripcion Adicional del ítem. Maximo 1000 caracteres
"""
self.ensure_one()
res = self.get_leyendas('item', line)
if line.product_id.l10n_uy_additional_info:
res.append(line.product_id.l10n_uy_additional_info)
if self._is_uy_inv_type_cfe():
if line.name and line.name != nomitem:
if line.name and line.name != line.product_id.display_name:
res.append(line.name)
elif self._is_uy_remito_type_cfe():
res.append(line.description_picking)
Expand Down Expand Up @@ -1310,7 +1308,7 @@ def _l10n_uy_get_cfe_item_detail(self):
'DescuentoMonto': self._uy_cfe_B13_DescuentoMonto(line)
})
item.update(self._uy_cfe_B11_PrecioUnitario(line, item.get('IndFact')))
item.update(self._uy_cfe_B8_DscItem(line, item.get('NomItem')))
item.update(self._uy_cfe_B8_DscItem(line))
res.append(item)

return res
Expand Down

0 comments on commit 32dfe55

Please sign in to comment.