minor fix to request in network failed

This commit is contained in:
Wilson Gomez 2023-10-27 13:23:29 -05:00
parent 48829a0a10
commit 30f6bc25f4
1 changed files with 11 additions and 5 deletions

View File

@ -138,12 +138,17 @@ class AppWindow(FrontWindow):
version = compare_versions(self.modules['sale_pos_frontend_rest']['version'], '6.0.7')
if version in ('equal', 'higher'):
if self.tasks_station:
result = self.SaleLine.get_data_command_and_task(args)
try:
result = self.SaleLine.get_data_command_and_task(args)
except Exception:
logger.exception('Error de conexion internet')
orders = result['orders']
tasks = result['tasks']
else:
orders = self.SaleLine.get_data_command(args)
try:
orders = self.SaleLine.get_data_command(args)
except Exception:
logger.exception('Error de conexion internet')
# TODO: for remove this option
else:
logger.warning('The backend sale_pos_frontend_rest is deprecation, update version')
@ -157,7 +162,8 @@ class AppWindow(FrontWindow):
if result:
self.Sale.mark_commanded({'lines_ids': result})
except Exception:
traceback.print_exc()
logger.exception('Error de conexion internet al marcar tareas')
try:
receipt = Receipt(context={}, environment='restaurant')
@ -165,7 +171,7 @@ class AppWindow(FrontWindow):
if any(result_print):
self.SaleLine.mark_tasks_printed({'task_ids': result_print})
except Exception:
traceback.print_exc()
logger.exception('Error de conexion internet al comandado')
timer = QTimer()
timer.singleShot(30000, self.verify_print_order_automatic)
# self.verify_command_order_th.exit(0)