Skip to content

Commit a890c32

Browse files
committed
[FIX] l10n_uy_edi_stock: deleted non-searchable field on cron domain
closes #402 Signed-off-by: Katherine Zaoral - kz (#l10n) <kz@adhoc.com.ar>
1 parent 01450c2 commit a890c32

2 files changed

Lines changed: 11 additions & 9 deletions

File tree

l10n_uy_edi_stock/models/stock_picking.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -730,10 +730,7 @@ def uy_stock_action_get_uruware_cfe(self):
730730

731731
def _l10n_uy_edi_stock_cron_update_dgi_status(self, batch_size=10):
732732
"""Cron to update the DGI status of the stock pickings"""
733-
domain = [
734-
("l10n_uy_is_cfe", "=", True),
735-
("l10n_uy_edi_cfe_state", "=", "received"),
736-
]
733+
domain = [("l10n_uy_edi_cfe_state", "=", "received")]
737734
pickings = self.env["stock.picking"].search(domain, limit=batch_size, order="id")
738735
pickings.l10n_uy_edi_action_get_dgi_state()
739736

l10n_uy_ux/models/l10n_uy_edi_document.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
import odoo.tools as tools
12
from odoo import api, fields, models
2-
from odoo.addons.server_mode.mode import get_mode
33
from odoo.exceptions import UserError
44
from odoo.tools import safe_eval
55

@@ -156,11 +156,16 @@ def unlink(self):
156156

157157
return True
158158

159-
def cron_l10n_uy_edi_get_vendor_bills(self):
160-
"""Agregamos chequeo del server mode para evitar que el cron se corra en modo demo, lo cual genera errores al no tener datos de producción"""
161-
if get_mode():
159+
def cron_l10n_uy_edi_get_vendor_bills(self, batch_size=10):
160+
"""Agregamos chequeo para evitar que el cron se corra en runbot, lo cual genera errores al no tener datos de producción
161+
162+
También prevenimos la ejecución si alguna compañía UY tiene configuración incompleta para evitar warnings innecesarios"""
163+
if not tools.config.get("test_enable") and not self.env["ir.config_parameter"].sudo().get_param(
164+
"saas_client.database_uuid", False
165+
):
162166
return
163-
return super().cron_l10n_uy_edi_get_vendor_bills()
167+
168+
return super().cron_l10n_uy_edi_get_vendor_bills(batch_size=batch_size)
164169

165170
# Metodos nuevos
166171

0 commit comments

Comments
 (0)