Skip to content

Commit 33f3ab5

Browse files
committed
[FIX] l10n_uy_ux: avoid running vendor bills cron on testing mode
1 parent 2e9f4dd commit 33f3ab5

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

l10n_uy_ux/models/l10n_uy_edi_document.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from odoo import api, fields, models
2+
from odoo.addons.server_mode.mode import get_mode
23
from odoo.exceptions import UserError
34
from odoo.tools import safe_eval
45

@@ -155,6 +156,12 @@ def unlink(self):
155156

156157
return True
157158

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():
162+
return
163+
return super().cron_l10n_uy_edi_get_vendor_bills()
164+
158165
# Metodos nuevos
159166

160167
def ux_uy_get_last_invoice_number(self, document_type):

0 commit comments

Comments
 (0)