Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 42f671b

Browse files
committedOct 15, 2024·
fix errores tests
1 parent 357e83a commit 42f671b

File tree

4 files changed

+21
-48
lines changed

4 files changed

+21
-48
lines changed
 

‎l10n_uy_currency_update/models/res_currency.py

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import logging
66
_logger = logging.getLogger(__name__)
77

8+
89
class ResCurrency(models.Model):
910

1011
_inherit = "res.currency"

‎l10n_uy_ux/i18n/es.po

-14
Original file line numberDiff line numberDiff line change
@@ -180,11 +180,6 @@ msgstr "CFE archivo xml"
180180
msgid "Cancel"
181181
msgstr "Cancelar"
182182

183-
#. module: l10n_uy_edi
184-
#: model:ir.model.fields,field_description:l10n_uy_edi.field_account_move__l10n_uy_edi_cfe_uuid
185-
msgid "Clave o UUID del CFE"
186-
msgstr ""
187-
188183
#. module: l10n_uy_edi
189184
#: model_terms:ir.ui.view,arch_db:l10n_uy_edi.view_base_partner_update_from_padron_uy_form
190185
msgid "Close"
@@ -744,15 +739,6 @@ msgstr ""
744739
msgid "UCFE Tipo de Notificacion"
745740
msgstr ""
746741

747-
#. module: l10n_uy_edi
748-
#: model:ir.model.fields,help:l10n_uy_edi.field_account_move__l10n_uy_edi_cfe_uuid
749-
msgid ""
750-
"Unique identification per CFE in UCFE. Currently is formed by the "
751-
"concatenation of model name + record id"
752-
msgstr ""
753-
"Identificador único del CFE en el UFCE. Este esta formado por la "
754-
"contanación de el nombre del mdelo y el id del registro"
755-
756742
#. module: l10n_uy_edi
757743
#: model_terms:ir.ui.view,arch_db:l10n_uy_edi.view_base_partner_update_from_padron_uy_form
758744
msgid "Update Automatically"

‎l10n_uy_ux/models/account_move.py

-23
Original file line numberDiff line numberDiff line change
@@ -69,24 +69,6 @@ def l10n_uy_edi_action_download_preview_xml(self):
6969

7070
return super().l10n_uy_edi_action_download_preview_xml()
7171

72-
def _l10n_uy_edi_cfe_A_receptor(self):
73-
# EXTEND l10n_uy_edi
74-
""" Agregamos campos que existen en odoo modulo oficial y queremos enviar en el xml
75-
"""
76-
res = super()._l10n_uy_edi_cfe_A_receptor()
77-
if self._is_uy_resguardo():
78-
res.pop("CompraID", False)
79-
return res
80-
81-
def _l10n_uy_edi_cfe_C_totals(self, tax_details):
82-
# EXTEND l10n_uy_edi
83-
""" A130 Monto Total a Pagar (NO debe ser reportado si de tipo e-resguardo) """
84-
# TODO KZ mover esto a modulo e-resguardo una vez lo tengamos
85-
res = super()._l10n_uy_edi_cfe_A_receptor(tax_details)
86-
if self._is_uy_resguardo():
87-
res.pop("MntPagar")
88-
return res
89-
9072
# New methods
9173

9274
def uy_ux_action_get_uruware_cfe(self):
@@ -166,8 +148,6 @@ def _compute_l10n_latam_document_number(self):
166148
name = name.split(" ")[-1]
167149
rec.l10n_latam_document_number = name
168150

169-
# def _l10n_uy_edi_cfe_F_reference(self):
170-
# # TODO KZ Not sure if FechaCFEref": 2015-01-31, shuould be inform
171151

172152
# Nuevos metodos
173153

@@ -285,6 +265,3 @@ def is_zona_franca(self):
285265

286266
# TODO KZ esto lo tendriamos que mantener para nuestros clientes que tiene el nombre largo como prefijo de
287267
# documento. capaz lo mejor seria hacer un script para poner todo como hace Odoo. Si hacemos eso este metodo se va
288-
289-
# def _uy_cfe_A41_RznSoc(self):
290-
# TODO company register name?

‎l10n_uy_ux/models/l10n_uy_edi_document.py

+20-11
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
import re
2+
import logging
3+
24

35
from odoo import _, api, models
46

57
from odoo.exceptions import UserError
68
from odoo.tools import safe_eval
79

10+
_logger = logging.getLogger(__name__)
11+
812

913
class L10nUyEdiDocument(models.Model):
1014

@@ -14,8 +18,10 @@ class L10nUyEdiDocument(models.Model):
1418

1519
def _get_ws_url(self, ws_endpoint, company):
1620
# EXTEND l10n_uy_edi
17-
""" Si utiliza uruware por contrato externo. modificar para soportar las dos url,
18-
una de testing y una de prod, asi no tiene que configurar el dato cada vez """
21+
""" Si utiliza uruware por Contrato Externo (no el de Odoo) da la posibilidad
22+
de utilizar dos urls en system parametros, uno para test y otro para pod
23+
24+
Asi no tiene que configurar el dato cada vez que lo vayan a usar """
1925
url = super()._get_ws_url(ws_endpoint, company)
2026

2127
if company.l10n_uy_edi_ucfe_env == "demo":
@@ -27,26 +33,29 @@ def _get_ws_url(self, ws_endpoint, company):
2733
query_param = self.env["ir.config_parameter"].sudo().get_param(
2834
"l10n_uy_edi.l10n_uy_edi_ucfe_query_url" + company.l10n_uy_edi_ucfe_env)
2935

36+
pattern = {
37+
"inbox": "https://.*.ucfe.com.uy/inbox.*/cfeservice.svc",
38+
"query": "https://.*.ucfe.com.uy/query.*/webservicesfe.svc",
39+
}
3040
if ws_endpoint == "inbox" and inbox_param:
3141
url = inbox_param
32-
pattern = "https://.*.ucfe.com.uy/inbox.*/cfeservice.svc"
3342
elif ws_endpoint == "query" and query_param:
3443
url = query_param
35-
pattern = "https://.*.ucfe.com.uy/query.*/webservicesfe.svc"
44+
else:
45+
_logger.info("Using Odoo defaults values")
3646

37-
print(" ----- url %s" % url)
38-
return url if re.match(pattern, url, re.IGNORECASE) is not None else False
47+
return url if re.match(pattern[ws_endpoint], url, re.IGNORECASE) is not None else False
3948

4049
def action_update_dgi_state(self):
4150
# EXTEND l10n_uy_edi
4251
""" Permitimos actualizar estado solo si tenemos UUID y solo si esta en esperando respuesta.
43-
si hay error no hay nada que consultar, y si fue aceptado rechazado ya no necesita ser actualizado """
44-
for move in self:
45-
if not move.l10n_uy_edi_cfe_uuid:
52+
Si hay error no hay nada que consultar, y si fue aceptado rechazado ya no necesita ser actualizado """
53+
for doc in self:
54+
if not doc.uuid:
4655
raise UserError(_("Please return a 'UUID CFE Key' in order to continue"))
47-
if move.l10n_uy_edi_cfe_state == "error":
56+
if doc.state == "error":
4857
raise UserError(_("You can not obtain the invoice with errors"))
49-
if move.l10n_uy_edi_cfe_state != "received":
58+
if doc.state != "received":
5059
raise UserError(_("You can not update the state of a accepted/rejected invoice"))
5160

5261
super().action_update_dgi_state()

0 commit comments

Comments
 (0)
Please sign in to comment.