From 8e5a6081921b110799a9bda1cee0d967d0130852 Mon Sep 17 00:00:00 2001 From: Wilson Gomez Date: Sat, 24 Jun 2023 08:59:10 -0500 Subject: [PATCH] fix bug agent and product_mix --- app/frontwindow.py | 2 +- app/main.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/frontwindow.py b/app/frontwindow.py index 31afbd5..36d4719 100644 --- a/app/frontwindow.py +++ b/app/frontwindow.py @@ -112,7 +112,7 @@ class FrontWindow(QMainWindow): dialog = self.dialog('confirm_exit', response=True) response = dialog.exec_() if response == DIALOG_REPLY_YES: - self.check_empty_sale() + # self.check_empty_sale() This function cancels sale if it has not number logout(self.ctx) if self.active_weighing and self.reader_thread: self.reader_thread.onClose() diff --git a/app/main.py b/app/main.py index bd12710..df67730 100644 --- a/app/main.py +++ b/app/main.py @@ -261,7 +261,7 @@ class AppWindow(FrontWindow): self.Sale.to_quote(args) if sale.get('reservation'): self.Sale.write([sale_id], {'reservation': False}) - if self._sale.get('agent.'): + if hasattr(self, 'field_agent') and self.field_agent: sale, = self.Sale.find([['id', '=', sale_id]], fields=['agent.rec_name', 'commission']) msg = 'Agente: ' + sale['agent.'].get('rec_name') + "\n Comision: " + str(sale['commission']) + "%" dialog = self.dialog('confirm_agent', response=True, widgets=[], extra_message=msg) @@ -2660,8 +2660,8 @@ class AppWindow(FrontWindow): else: self.set_state('add') if self.type_pos_user in ('order', 'salesman'): - self.buttons_stacked.button_to_quote.show() - self.buttons_stacked.button_to_draft.hide() + self.buttons_function.button_to_quote.show() + self.buttons_function.button_to_draft.hide() if self.enviroment == 'restaurant': self.action_source() self.label_input.setFocus() @@ -2790,7 +2790,7 @@ class AppWindow(FrontWindow): self.set_state('add') if record: self._sale_line['product'] = record - if len(record.get('products_mix')) > 0: + if record.get('products_mix') and len(record.get('products_mix')) > 0: self.action_combo(record['code']) def _check_stock_quantity(self, product, request_qty=None):