Skip to content

Commit

Permalink
[ADD] l10n_uy_edi: Nuevas disposiciones de DGI
Browse files Browse the repository at this point in the history
Task: 33669
  • Loading branch information
mem-adhoc committed Oct 27, 2023
1 parent 3165d54 commit 196919e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
15 changes: 10 additions & 5 deletions l10n_uy_edi/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,20 @@ def _amount_total_company_currency(self):
# Helpers

def _uy_found_related_cfe(self):
""" return the related/origin cfe of a given cfe """
""" return the related/origin cfe of a given cfe
Segun cambios en formatos de CFE v.24
los cfe relacionados deben estar aceptados por DGI
"""
# next version review to merge this with l10n_ar_edi _found_related_invoice method
self.ensure_one()
res = self.env['account.move']
if self.l10n_latam_document_type_id.internal_type == 'credit_note':
return self.reversed_entry_id
res = self.reversed_entry_id
elif self.l10n_latam_document_type_id.internal_type == 'debit_note':
return self.debit_origin_id
else:
return self.browse()
res = self.debit_origin_id
if res and res.l10n_uy_cfe_state != 'accepted':
raise UserError(_('El comprobante que estas anexando como referencia no es un comprobante valido para DGI(aceptado)'))
return res

def _is_uy_cfe(self):
return bool(self.journal_id.l10n_latam_use_documents and self.company_id.country_code == "UY"
Expand Down
3 changes: 2 additions & 1 deletion l10n_uy_edi/models/l10n_uy_cfe.py
Original file line number Diff line number Diff line change
Expand Up @@ -1146,7 +1146,8 @@ def _l10n_uy_get_cfe_referencia(self):
'Serie': document_number[0],
'NroCFERef': document_number[1],
# 'FechaCFEref': 2015-01-31, TODO inform?
})
})

return res

def action_l10n_uy_get_pdf(self):
Expand Down

0 comments on commit 196919e

Please sign in to comment.