minor fix change save log
This commit is contained in:
parent
4ac3de04dd
commit
e4eb03b4b7
29
app/main.py
29
app/main.py
|
@ -150,8 +150,10 @@ class AppWindow(FrontWindow):
|
|||
for record in records:
|
||||
orders += record['orders'].values()
|
||||
tasks += record['tasks'].values()
|
||||
print('ingresa a impresion', orders)
|
||||
print('ingresa a impresion tasks', tasks)
|
||||
# print('ingresa a impresion orders')
|
||||
# pprint(orders)
|
||||
# print('ingresa a impresion tasks')
|
||||
# pprint(tasks)
|
||||
try:
|
||||
result = self.receipt_order.print_orders(orders)
|
||||
if result:
|
||||
|
@ -1971,16 +1973,18 @@ class AppWindow(FrontWindow):
|
|||
data_station = self.Sale.method_instance('get_data_for_stations', self.sale_id)
|
||||
receipt = Receipt(context={}, environment='restaurant')
|
||||
receipt.print_tasks(data_station.values())
|
||||
result = self.receipt_order.print_orders(orders.values(), reversion)
|
||||
lines_sended = result + lines_ids
|
||||
print(lines_sended, 'this is lines printed')
|
||||
if not reversion and lines_sended:
|
||||
for line in lines:
|
||||
if line['id'] in lines_sended:
|
||||
line['order_sended'] = '✔'
|
||||
self.model_sale_lines.update_record(line)
|
||||
self.Sale.mark_commanded({'lines_ids': lines_sended})
|
||||
return result
|
||||
print(orders, 'validate')
|
||||
return
|
||||
# result = self.receipt_order.print_orders(orders.values(), reversion)
|
||||
# lines_sended = result + lines_ids
|
||||
# print(lines_sended, 'this is lines printed')
|
||||
# if not reversion and lines_sended:
|
||||
# for line in lines:
|
||||
# if line['id'] in lines_sended:
|
||||
# line['order_sended'] = '✔'
|
||||
# self.model_sale_lines.update_record(line)
|
||||
# self.Sale.mark_commanded({'lines_ids': lines_sended})
|
||||
# return result
|
||||
|
||||
def action_source(self):
|
||||
if self._state != 'checkout' and self.sources:
|
||||
|
@ -2155,7 +2159,6 @@ class AppWindow(FrontWindow):
|
|||
|
||||
# dom.append(['payment_method', '!=', 'all_paid'])
|
||||
fields = self.dialog_search_sales.fields_names
|
||||
print(fields, 'this is fields')
|
||||
sales = self.Sale.find(dom, fields=fields, order=[('id', 'DESC')])
|
||||
self.dialog_search_sales.set_from_values(sales)
|
||||
if self.environment == 'retail':
|
||||
|
|
|
@ -225,6 +225,7 @@ class Receipt(object):
|
|||
except Exception:
|
||||
logging.exception(
|
||||
"Warning: Printer error or device not found!")
|
||||
logging.info(f'interface: {self._interface}, device: {self._device}')
|
||||
|
||||
def print_sale(self, sale, type_doc=None, open_box=False):
|
||||
try:
|
||||
|
@ -986,7 +987,7 @@ class Receipt(object):
|
|||
if line.get('id'):
|
||||
lines_printed.append(line['id'])
|
||||
except Exception:
|
||||
traceback.print_exc()
|
||||
logging.exception(f'Error impresion linea de orden {str(line)}')
|
||||
self.print_enter()
|
||||
self.print_enter()
|
||||
if isinstance(order['lines'], list):
|
||||
|
|
|
@ -1,8 +1,23 @@
|
|||
import os
|
||||
import logging
|
||||
|
||||
if os.name == 'posix':
|
||||
homex = 'HOME'
|
||||
dirconfig = '.tryton'
|
||||
temp_log = '/tmp'
|
||||
elif os.name == 'nt':
|
||||
homex = 'USERPROFILE'
|
||||
dirconfig = 'AppData/Local/tryton'
|
||||
temp_log = 'AppData/Local/Temp'
|
||||
|
||||
HOME_DIR = os.getenv(homex)
|
||||
default_dir = os.path.join(HOME_DIR, dirconfig)
|
||||
|
||||
if os.path.exists(default_dir):
|
||||
log_file_path = default_dir + '/presik_pos.log'
|
||||
else:
|
||||
log_file_path = temp_log + '/presik_pos.log'
|
||||
|
||||
log_file_path = os.path.dirname(os.path.abspath(__file__)) + '/presik_pos.log'
|
||||
log_formater = logging.Formatter(
|
||||
'%(asctime)s - %(levelname)s - %(funcName)s - %(name)s - %(message)s',
|
||||
datefmt='%Y-%m-%d %H:%M:%S', style="%")
|
||||
|
|
|
@ -16,12 +16,12 @@ executables = [
|
|||
options = {
|
||||
"build_exe": {
|
||||
"packages": [
|
||||
"tests",
|
||||
"app",
|
||||
"app.printing",
|
||||
"app.commons",
|
||||
"app.css",
|
||||
"app.locale",
|
||||
"app.tests"
|
||||
],
|
||||
"include_msvcr": True, # Incluye las bibliotecas de tiempo de ejecución de MSVC
|
||||
}
|
||||
|
@ -56,6 +56,8 @@ setup(
|
|||
"paramiko",
|
||||
"orjson",
|
||||
"escpos",
|
||||
"PySide6>=6.4.1"
|
||||
"PySide6>=6.4.1",
|
||||
"psutil",
|
||||
"setproctitle",
|
||||
]
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue