From fa16cab0caaf0d5a8800256e57b4e46d06f59689 Mon Sep 17 00:00:00 2001 From: Wilson Gomez Date: Wed, 25 Oct 2023 18:52:57 -0500 Subject: [PATCH] minor fix --- app/dialogs.py | 17 +++++++++-------- app/main.py | 15 ++++++++------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/app/dialogs.py b/app/dialogs.py index 22fb474..4200b0c 100644 --- a/app/dialogs.py +++ b/app/dialogs.py @@ -1945,23 +1945,24 @@ class DialogInfoProduct(QuickDialog): def search(self, values=None): self.ok_button.setDefault(False) - filter = self.input_filter.text() - if not filter: + filter_ = self.input_filter.text() + if not filter_: return domain = [ ('template.salable', '=', True), ('template.account_category', '!=', None), ] - domain.append([ + domain_or = [ 'OR', - ('code', 'ilike', '%' + filter + '%'), - ('name', 'ilike', '%' + filter + '%') - ]) + ('code', 'ilike', '%' + filter_ + '%'), + ('name', 'ilike', '%' + filter_ + '%') + ] + if self.parent._onebarcode_activated: - domain.append(('barcode', 'ilike', '%' + filter + '%')) - + domain_or.append(('barcode', 'ilike', '%' + filter_ + '%')) + domain.append(domain_or) products = self._parent.Product.find(domain, ctx=self._parent.stock_context, fields=['name', 'code', 'description', 'id', 'list_price', diff --git a/app/main.py b/app/main.py index 087c576..77cb02d 100644 --- a/app/main.py +++ b/app/main.py @@ -108,9 +108,9 @@ class AppWindow(FrontWindow): self.reader_thread.sigSetWeight.connect(self.set_weight_readed) if self.server_printer and self.environment == 'restaurant': - timer = QTimer() - timer.timeout.connect(self.verify_print_order_automatic) - timer.start(30000) + self.timer = QTimer() + self.timer.timeout.connect(self.verify_print_order_automatic) + self.timer.start(30000) # self.timer = threading.Timer(30, self.verify_print_order_automatic) # self.timer.start() # atexit.register(self.terminate_timer) @@ -138,6 +138,7 @@ class AppWindow(FrontWindow): self.field_agent = None def verify_print_order_automatic(self): + print('ingresa a validar comand') args = {'shop': self.shop['id']} orders = [] tasks = [] @@ -1831,10 +1832,10 @@ class AppWindow(FrontWindow): def _get_info_consumer(consumer_): consumer = {} if consumer_: - consumer['consumer_name'] = consumer.get('name', None) - consumer['consumer_phone'] = consumer.get('phone', '') - consumer['consumer_address'] = consumer.get('address', '') - consumer['consumer_notes'] = consumer.get('notes', '') + consumer['consumer_name'] = consumer_.get('name', None) + consumer['consumer_phone'] = consumer_.get('phone', '') + consumer['consumer_address'] = consumer_.get('address', '') + consumer['consumer_notes'] = consumer_.get('notes', '') return consumer order = {