From 4a6c63fadd74035c093a999b677b7b9d49cc69b8 Mon Sep 17 00:00:00 2001 From: Wilson Gomez Date: Wed, 16 Aug 2023 09:21:13 -0500 Subject: [PATCH] minor fix --- app/commons/search_window.py | 5 ++++- app/main.py | 5 +---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/commons/search_window.py b/app/commons/search_window.py index 6a1c247..2506349 100644 --- a/app/commons/search_window.py +++ b/app/commons/search_window.py @@ -377,7 +377,10 @@ class TableModel(QAbstractTableModel): mod_hours = value_obj + timedelta(hours=DELTA_LOCALE) val = mod_hours.strftime('%d/%m/%Y %I:%M %p') elif data['type'] == 'time': - value_obj = datetime.strptime(val, '%Y-%m-%dT%H:%M:%S.%f') + try: + value_obj = datetime.strptime(val, '%Y-%m-%dT%H:%M:%S.%f') + except Exception: + value_obj = datetime.strptime(val, '%Y-%m-%dT%H:%M:%S') mod_hours = value_obj + timedelta(hours=DELTA_LOCALE) val = mod_hours.strftime('%I:%M %p') if data['type'] == 'icon': diff --git a/app/main.py b/app/main.py index 58177eb..5e95bbf 100644 --- a/app/main.py +++ b/app/main.py @@ -4,9 +4,7 @@ import sys import os import logging import base64 -import platform import time -from packaging.version import parse as parse_version from decimal import Decimal from datetime import datetime, timedelta, date from collections import OrderedDict @@ -40,7 +38,6 @@ from .constants import ( SALE_FIELDS, KIND_REST, KIND_RETAIL, DIALOG_REPLY_YES, ) from .dialogs import DialogDeliveryParty -import time try: from app.models import MODELS_RETAIL except: @@ -227,7 +224,7 @@ class AppWindow(FrontWindow): ) self.receipt_order = None # Printing order context - if self.print_order: + if hasattr(self, 'print_order') and self.print_order: self.receipt_order = Receipt(ctx_printing, environment=self.enviroment) self.set_default_printer()