minor fix exec
This commit is contained in:
parent
d735ffccde
commit
aac950797a
|
@ -218,7 +218,7 @@ class SearchWindow(QDialog):
|
||||||
def execute(self):
|
def execute(self):
|
||||||
self.current_row = None
|
self.current_row = None
|
||||||
self.filter_field.setFocus()
|
self.filter_field.setFocus()
|
||||||
return self.exec()
|
return self.exec_()
|
||||||
|
|
||||||
def show(self):
|
def show(self):
|
||||||
self.clear_filter()
|
self.clear_filter()
|
||||||
|
|
|
@ -968,7 +968,7 @@ class DialogMoneyCount(QuickDialog):
|
||||||
widgets=[grid])
|
widgets=[grid])
|
||||||
self.setWindowTitle('CONTEO DE DINERO')
|
self.setWindowTitle('CONTEO DE DINERO')
|
||||||
|
|
||||||
def exec(self, kind):
|
def exec_(self, kind):
|
||||||
self.kind = kind
|
self.kind = kind
|
||||||
self.exec()
|
self.exec()
|
||||||
|
|
||||||
|
|
|
@ -105,7 +105,7 @@ class FrontWindow(QMainWindow):
|
||||||
|
|
||||||
def closeEvent(self, event):
|
def closeEvent(self, event):
|
||||||
dialog = self.dialog('confirm_exit', response=True)
|
dialog = self.dialog('confirm_exit', response=True)
|
||||||
response = dialog.exec()
|
response = dialog.exec_()
|
||||||
if response == DIALOG_REPLY_YES:
|
if response == DIALOG_REPLY_YES:
|
||||||
# self.check_empty_sale() This function cancels sale if it has not number
|
# self.check_empty_sale() This function cancels sale if it has not number
|
||||||
logout(self.ctx)
|
logout(self.ctx)
|
||||||
|
|
82
app/main.py
82
app/main.py
|
@ -72,7 +72,7 @@ class AppWindow(FrontWindow):
|
||||||
response = self.load_modules()
|
response = self.load_modules()
|
||||||
if response is not True:
|
if response is not True:
|
||||||
d = self.dialog(response)
|
d = self.dialog(response)
|
||||||
d.exec()
|
d.exec_()
|
||||||
super(AppWindow, self).close()
|
super(AppWindow, self).close()
|
||||||
return
|
return
|
||||||
self.setup_sale_line()
|
self.setup_sale_line()
|
||||||
|
@ -263,7 +263,7 @@ class AppWindow(FrontWindow):
|
||||||
msg = 'Agente: ' + result.get('agent.').get('rec_name') + \
|
msg = 'Agente: ' + result.get('agent.').get('rec_name') + \
|
||||||
"\n Comision: " + str(result['commission']) + "%"
|
"\n Comision: " + str(result['commission']) + "%"
|
||||||
dialog = self.dialog('confirm_agent', response=True, widgets=[], extra_message=msg)
|
dialog = self.dialog('confirm_agent', response=True, widgets=[], extra_message=msg)
|
||||||
response = dialog.exec()
|
response = dialog.exec_()
|
||||||
if response == DIALOG_REPLY_NO:
|
if response == DIALOG_REPLY_NO:
|
||||||
self.Sale.write([sale_id], {'state': 'draft'})
|
self.Sale.write([sale_id], {'state': 'draft'})
|
||||||
return
|
return
|
||||||
|
@ -1079,7 +1079,7 @@ class AppWindow(FrontWindow):
|
||||||
sales = self.Sale.find(dom, fields=_SALE_HISTORIC, limit=10)
|
sales = self.Sale.find(dom, fields=_SALE_HISTORIC, limit=10)
|
||||||
for record in sales:
|
for record in sales:
|
||||||
self.model_sale_historic.add_record(record)
|
self.model_sale_historic.add_record(record)
|
||||||
self.dialog_historic_sales.exec()
|
self.dialog_historic_sales.exec_()
|
||||||
|
|
||||||
def check_all_commanded(self):
|
def check_all_commanded(self):
|
||||||
return all([
|
return all([
|
||||||
|
@ -1174,11 +1174,11 @@ class AppWindow(FrontWindow):
|
||||||
def action_tables(self):
|
def action_tables(self):
|
||||||
if self.environment == 'restaurant':
|
if self.environment == 'restaurant':
|
||||||
self.dialog_manage_tables.open_tables()
|
self.dialog_manage_tables.open_tables()
|
||||||
self.dialog_manage_tables.exec()
|
self.dialog_manage_tables.exec_()
|
||||||
|
|
||||||
def action_release_table(self, table_id):
|
def action_release_table(self, table_id):
|
||||||
dialog = self.dialog('release_table', response=True)
|
dialog = self.dialog('release_table', response=True)
|
||||||
response = dialog.exec()
|
response = dialog.exec_()
|
||||||
if response == DIALOG_REPLY_NO:
|
if response == DIALOG_REPLY_NO:
|
||||||
return
|
return
|
||||||
to_drop = {'state': 'available', 'sale': None}
|
to_drop = {'state': 'available', 'sale': None}
|
||||||
|
@ -1208,7 +1208,7 @@ class AppWindow(FrontWindow):
|
||||||
value = int((self._config['tip_rate'] / 100) * total_amount)
|
value = int((self._config['tip_rate'] / 100) * total_amount)
|
||||||
self.field_tip_amount_ask.setText(str(value))
|
self.field_tip_amount_ask.setText(str(value))
|
||||||
|
|
||||||
result = self.dialog_tip_amount.exec()
|
result = self.dialog_tip_amount.exec_()
|
||||||
if result == 0:
|
if result == 0:
|
||||||
self.field_tip_amount_invoice.setChecked(False)
|
self.field_tip_amount_invoice.setChecked(False)
|
||||||
return
|
return
|
||||||
|
@ -1228,7 +1228,7 @@ class AppWindow(FrontWindow):
|
||||||
def action_delivery(self):
|
def action_delivery(self):
|
||||||
if self._state in ['finished']:
|
if self._state in ['finished']:
|
||||||
return
|
return
|
||||||
result = self.dialog_delivery_amount.exec()
|
result = self.dialog_delivery_amount.exec_()
|
||||||
if result == 0:
|
if result == 0:
|
||||||
self.field_delivery_amount_invoice.setChecked(False)
|
self.field_delivery_amount_invoice.setChecked(False)
|
||||||
return
|
return
|
||||||
|
@ -1248,7 +1248,7 @@ class AppWindow(FrontWindow):
|
||||||
def action_salesman_code(self):
|
def action_salesman_code(self):
|
||||||
if self._state in ['checkout']:
|
if self._state in ['checkout']:
|
||||||
return
|
return
|
||||||
result = self.dialog_salesman_code.exec()
|
result = self.dialog_salesman_code.exec_()
|
||||||
code = self.field_salesman_code_ask.text()
|
code = self.field_salesman_code_ask.text()
|
||||||
if result == 0:
|
if result == 0:
|
||||||
# Cancelled the action
|
# Cancelled the action
|
||||||
|
@ -1262,24 +1262,24 @@ class AppWindow(FrontWindow):
|
||||||
return salesman_list[0]
|
return salesman_list[0]
|
||||||
|
|
||||||
def action_delivery_party(self):
|
def action_delivery_party(self):
|
||||||
self.dialog_delivery_party.exec()
|
self.dialog_delivery_party.exec_()
|
||||||
|
|
||||||
def action_delivery_party_panel(self):
|
def action_delivery_party_panel(self):
|
||||||
self.dialog_control_panel.close()
|
self.dialog_control_panel.close()
|
||||||
self.dialog_table_delivery_party.exec()
|
self.dialog_table_delivery_party.exec_()
|
||||||
|
|
||||||
def action_control_panel(self):
|
def action_control_panel(self):
|
||||||
self.dialog_control_panel.exec()
|
self.dialog_control_panel.exec_()
|
||||||
|
|
||||||
def action_reports(self):
|
def action_reports(self):
|
||||||
self.dialog_reports.exec()
|
self.dialog_reports.exec_()
|
||||||
|
|
||||||
def dialog_money_count_accepted(self):
|
def dialog_money_count_accepted(self):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def action_expenses(self):
|
def action_expenses(self):
|
||||||
if self.set_expenses():
|
if self.set_expenses():
|
||||||
self.dialog_expenses.exec()
|
self.dialog_expenses.exec_()
|
||||||
|
|
||||||
def action_open_statement(self):
|
def action_open_statement(self):
|
||||||
self.dialog_money_count.exec('open')
|
self.dialog_money_count.exec('open')
|
||||||
|
@ -1386,16 +1386,16 @@ class AppWindow(FrontWindow):
|
||||||
self.set_amounts()
|
self.set_amounts()
|
||||||
|
|
||||||
def action_table_discount(self):
|
def action_table_discount(self):
|
||||||
self.dialog_auth_discount.exec()
|
self.dialog_auth_discount.exec_()
|
||||||
|
|
||||||
def action_tax(self):
|
def action_tax(self):
|
||||||
self.dialog_tax.exec()
|
self.dialog_tax.exec_()
|
||||||
|
|
||||||
def button_payment_pressed(self):
|
def button_payment_pressed(self):
|
||||||
if self._state not in ('checkout', 'payment'):
|
if self._state not in ('checkout', 'payment'):
|
||||||
self.dialog('add_payment_sale_draft')
|
self.dialog('add_payment_sale_draft')
|
||||||
return
|
return
|
||||||
self.dialog_payment.exec()
|
self.dialog_payment.exec_()
|
||||||
|
|
||||||
def _check_credit_capacity(self, party):
|
def _check_credit_capacity(self, party):
|
||||||
if party['credit_limit_amount']:
|
if party['credit_limit_amount']:
|
||||||
|
@ -1486,12 +1486,12 @@ class AppWindow(FrontWindow):
|
||||||
self.load_sale(sale_id)
|
self.load_sale(sale_id)
|
||||||
|
|
||||||
if sale.get('state') == 'quotation':
|
if sale.get('state') == 'quotation':
|
||||||
self.dialog_payment.exec()
|
self.dialog_payment.exec_()
|
||||||
flag = True
|
flag = True
|
||||||
# dialog_advance.addAction
|
# dialog_advance.addAction
|
||||||
while flag:
|
while flag:
|
||||||
self.dialog_advance.clean()
|
self.dialog_advance.clean()
|
||||||
res = self.dialog_advance.exec()
|
res = self.dialog_advance.exec_()
|
||||||
amount = self.field_amount_ask.text()
|
amount = self.field_amount_ask.text()
|
||||||
reservation = self.field_reservation_ask.isChecked()
|
reservation = self.field_reservation_ask.isChecked()
|
||||||
if res == 0 or (res == 1 and amount.isdigit()):
|
if res == 0 or (res == 1 and amount.isdigit()):
|
||||||
|
@ -1500,7 +1500,7 @@ class AppWindow(FrontWindow):
|
||||||
journal = self.journal
|
journal = self.journal
|
||||||
voucher_number = None
|
voucher_number = None
|
||||||
if journal.get('require_voucher'):
|
if journal.get('require_voucher'):
|
||||||
res = self.dialog_voucher.exec()
|
res = self.dialog_voucher.exec_()
|
||||||
if res == 0:
|
if res == 0:
|
||||||
self.dialog_voucher.close()
|
self.dialog_voucher.close()
|
||||||
return
|
return
|
||||||
|
@ -1540,7 +1540,7 @@ class AppWindow(FrontWindow):
|
||||||
if number:
|
if number:
|
||||||
self.field_invoice_number_ask.setText(number)
|
self.field_invoice_number_ask.setText(number)
|
||||||
self.field_type_ask.set_from_id(type_doc)
|
self.field_type_ask.set_from_id(type_doc)
|
||||||
res = self.dialog_print_invoice.exec()
|
res = self.dialog_print_invoice.exec_()
|
||||||
if res == DIALOG_REPLY_NO:
|
if res == DIALOG_REPLY_NO:
|
||||||
return
|
return
|
||||||
number = self.field_invoice_number_ask.text()
|
number = self.field_invoice_number_ask.text()
|
||||||
|
@ -1624,18 +1624,18 @@ class AppWindow(FrontWindow):
|
||||||
report.open(result)
|
report.open(result)
|
||||||
|
|
||||||
def action_comment(self):
|
def action_comment(self):
|
||||||
self.dialog_comment.exec()
|
self.dialog_comment.exec_()
|
||||||
comment = self.field_comment.toPlainText()
|
comment = self.field_comment.toPlainText()
|
||||||
self.store.update({'comment': comment})
|
self.store.update({'comment': comment})
|
||||||
|
|
||||||
def action_position(self):
|
def action_position(self):
|
||||||
self.field_position_ask.setText(self.store.get('position'))
|
self.field_position_ask.setText(self.store.get('position'))
|
||||||
self.dialog_position.exec()
|
self.dialog_position.exec_()
|
||||||
position = self.field_position_ask.text()
|
position = self.field_position_ask.text()
|
||||||
self.store.update({'position': position})
|
self.store.update({'position': position})
|
||||||
|
|
||||||
def action_agent(self):
|
def action_agent(self):
|
||||||
self.dialog_agent.exec()
|
self.dialog_agent.exec_()
|
||||||
res = self.field_commission_ask.text()
|
res = self.field_commission_ask.text()
|
||||||
commission = float(res or 0)
|
commission = float(res or 0)
|
||||||
self.field_agent_id = self.field_agent_ask.get_id()
|
self.field_agent_id = self.field_agent_ask.get_id()
|
||||||
|
@ -1669,7 +1669,7 @@ class AppWindow(FrontWindow):
|
||||||
'cashier', 'frontend_admin'):
|
'cashier', 'frontend_admin'):
|
||||||
self.dialog('user_without_permission')
|
self.dialog('user_without_permission')
|
||||||
return
|
return
|
||||||
self.dialog_global_discount.exec()
|
self.dialog_global_discount.exec_()
|
||||||
discount = self.field_global_discount_ask.text()
|
discount = self.field_global_discount_ask.text()
|
||||||
if discount and discount.isdigit():
|
if discount and discount.isdigit():
|
||||||
rec = {
|
rec = {
|
||||||
|
@ -1794,7 +1794,7 @@ class AppWindow(FrontWindow):
|
||||||
if self.model_sale_lines.rowCount() == 0 or not sale_id:
|
if self.model_sale_lines.rowCount() == 0 or not sale_id:
|
||||||
return
|
return
|
||||||
|
|
||||||
res = self.dialog_order.exec()
|
res = self.dialog_order.exec_()
|
||||||
if res == DIALOG_REPLY_NO:
|
if res == DIALOG_REPLY_NO:
|
||||||
return False
|
return False
|
||||||
result = None
|
result = None
|
||||||
|
@ -1944,11 +1944,11 @@ class AppWindow(FrontWindow):
|
||||||
|
|
||||||
def action_source(self):
|
def action_source(self):
|
||||||
if self._state != 'checkout' and self.sources:
|
if self._state != 'checkout' and self.sources:
|
||||||
self.dialog_source.exec()
|
self.dialog_source.exec_()
|
||||||
|
|
||||||
def action_payment_term(self):
|
def action_payment_term(self):
|
||||||
if self._state == 'payment' or self.type_pos_user == 'salesman':
|
if self._state == 'payment' or self.type_pos_user == 'salesman':
|
||||||
self.dialog_payment_term.exec()
|
self.dialog_payment_term.exec_()
|
||||||
|
|
||||||
def action_new_sale(self):
|
def action_new_sale(self):
|
||||||
if self._state in ['checkout']:
|
if self._state in ['checkout']:
|
||||||
|
@ -1967,7 +1967,7 @@ class AppWindow(FrontWindow):
|
||||||
|
|
||||||
def _ask_new_sale(self):
|
def _ask_new_sale(self):
|
||||||
dialog = self.dialog('new_sale', response=True)
|
dialog = self.dialog('new_sale', response=True)
|
||||||
res = dialog.exec()
|
res = dialog.exec_()
|
||||||
if res == DIALOG_REPLY_NO:
|
if res == DIALOG_REPLY_NO:
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
@ -1977,7 +1977,7 @@ class AppWindow(FrontWindow):
|
||||||
if self._state == 'disabled':
|
if self._state == 'disabled':
|
||||||
return
|
return
|
||||||
if self.type_pos_user == 'cashier':
|
if self.type_pos_user == 'cashier':
|
||||||
self.dialog_cancel_invoice.exec()
|
self.dialog_cancel_invoice.exec_()
|
||||||
password = self.field_password_for_cancel_ask.text()
|
password = self.field_password_for_cancel_ask.text()
|
||||||
if password != self._password_admin:
|
if password != self._password_admin:
|
||||||
return self.dialog('not_permission_for_cancel')
|
return self.dialog('not_permission_for_cancel')
|
||||||
|
@ -1990,7 +1990,7 @@ class AppWindow(FrontWindow):
|
||||||
sale.get('invoice_number'):
|
sale.get('invoice_number'):
|
||||||
return self.dialog('not_permission_delete_sale')
|
return self.dialog('not_permission_delete_sale')
|
||||||
dialog = self.dialog('cancel_sale', response=True)
|
dialog = self.dialog('cancel_sale', response=True)
|
||||||
response = dialog.exec()
|
response = dialog.exec_()
|
||||||
if response == DIALOG_REPLY_NO:
|
if response == DIALOG_REPLY_NO:
|
||||||
return
|
return
|
||||||
self.Sale.cancel_sale({'id': sale['id']})
|
self.Sale.cancel_sale({'id': sale['id']})
|
||||||
|
@ -2034,7 +2034,7 @@ class AppWindow(FrontWindow):
|
||||||
self._sale_historic = sales
|
self._sale_historic = sales
|
||||||
for record in sales:
|
for record in sales:
|
||||||
self.model_sale_historic.add_record(record)
|
self.model_sale_historic.add_record(record)
|
||||||
self.dialog_historic_sales.exec()
|
self.dialog_historic_sales.exec_()
|
||||||
|
|
||||||
def action_search_sale(self):
|
def action_search_sale(self):
|
||||||
if hasattr(self, 'activate_scale_sync') and self.activate_scale_sync:
|
if hasattr(self, 'activate_scale_sync') and self.activate_scale_sync:
|
||||||
|
@ -2472,7 +2472,7 @@ class AppWindow(FrontWindow):
|
||||||
|
|
||||||
if self._state == 'payment':
|
if self._state == 'payment':
|
||||||
dialog = self.dialog('cant_add_discount')
|
dialog = self.dialog('cant_add_discount')
|
||||||
dialog.exec()
|
dialog.exec_()
|
||||||
return
|
return
|
||||||
if discount:
|
if discount:
|
||||||
self.validate_discount(discount, _line)
|
self.validate_discount(discount, _line)
|
||||||
|
@ -2835,7 +2835,7 @@ class AppWindow(FrontWindow):
|
||||||
salesman = self.store.get('salesman')
|
salesman = self.store.get('salesman')
|
||||||
if self.salesman_required and not salesman:
|
if self.salesman_required and not salesman:
|
||||||
dialog = self.dialog('missing_salesman')
|
dialog = self.dialog('missing_salesman')
|
||||||
dialog.exec()
|
dialog.exec_()
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
@ -2895,7 +2895,7 @@ class AppWindow(FrontWindow):
|
||||||
if self._password_force_assign:
|
if self._password_force_assign:
|
||||||
if (request_qty and qty_ < request_qty) or (qty_ <= 0):
|
if (request_qty and qty_ < request_qty) or (qty_ <= 0):
|
||||||
self.message_bar.set('without_stock_quantity', product['name'])
|
self.message_bar.set('without_stock_quantity', product['name'])
|
||||||
self.dialog_force_assign.exec()
|
self.dialog_force_assign.exec_()
|
||||||
password = self.field_password_force_assign_ask.text()
|
password = self.field_password_force_assign_ask.text()
|
||||||
self.field_password_force_assign_ask.setText('')
|
self.field_password_force_assign_ask.setText('')
|
||||||
if password != self._password_force_assign:
|
if password != self._password_force_assign:
|
||||||
|
@ -3173,7 +3173,7 @@ class AppWindow(FrontWindow):
|
||||||
'cashier', 'frontend_admin'):
|
'cashier', 'frontend_admin'):
|
||||||
self.dialog('user_without_permission')
|
self.dialog('user_without_permission')
|
||||||
return
|
return
|
||||||
self.dialog_fixed_discount.exec()
|
self.dialog_fixed_discount.exec_()
|
||||||
if self.environment == 'restaurant':
|
if self.environment == 'restaurant':
|
||||||
self.dialog_combine_product.close()
|
self.dialog_combine_product.close()
|
||||||
|
|
||||||
|
@ -3183,7 +3183,7 @@ class AppWindow(FrontWindow):
|
||||||
self.dialog('user_without_permission')
|
self.dialog('user_without_permission')
|
||||||
return
|
return
|
||||||
self.field_bono_discount_manual.setText('')
|
self.field_bono_discount_manual.setText('')
|
||||||
self.dialog_fixed_discount_manual.exec()
|
self.dialog_fixed_discount_manual.exec_()
|
||||||
if self.environment == 'restaurant':
|
if self.environment == 'restaurant':
|
||||||
self.dialog_combine_product.close()
|
self.dialog_combine_product.close()
|
||||||
discount = self.field_bono_discount_manual.text()
|
discount = self.field_bono_discount_manual.text()
|
||||||
|
@ -3220,7 +3220,7 @@ class AppWindow(FrontWindow):
|
||||||
if qty_min_req:
|
if qty_min_req:
|
||||||
self.dialog_combo_product.label_qty_min_req.setText(str(qty_min_req))
|
self.dialog_combo_product.label_qty_min_req.setText(str(qty_min_req))
|
||||||
self.dialog_combo_product.set_buttons(products_mix)
|
self.dialog_combo_product.set_buttons(products_mix)
|
||||||
self.dialog_combo_product.exec()
|
self.dialog_combo_product.exec_()
|
||||||
self.dialog_combo_product.close()
|
self.dialog_combo_product.close()
|
||||||
|
|
||||||
def action_combine_line(self):
|
def action_combine_line(self):
|
||||||
|
@ -3238,7 +3238,7 @@ class AppWindow(FrontWindow):
|
||||||
('categories', 'in', categories),
|
('categories', 'in', categories),
|
||||||
], fields=['id', 'name', 'code', 'categories', 'rec_name', 'list_price'])
|
], fields=['id', 'name', 'code', 'categories', 'rec_name', 'list_price'])
|
||||||
self.dialog_combine_product.set_buttons(mixables)
|
self.dialog_combine_product.set_buttons(mixables)
|
||||||
self.dialog_combine_product.exec()
|
self.dialog_combine_product.exec_()
|
||||||
self.dialog_combine_product.filter_field.clear()
|
self.dialog_combine_product.filter_field.clear()
|
||||||
self.dialog_combine_product.close()
|
self.dialog_combine_product.close()
|
||||||
|
|
||||||
|
@ -3264,7 +3264,7 @@ class AppWindow(FrontWindow):
|
||||||
return self.dialog('user_without_permission')
|
return self.dialog('user_without_permission')
|
||||||
|
|
||||||
if order_sended:
|
if order_sended:
|
||||||
res = self.dialog_delete_product.exec()
|
res = self.dialog_delete_product.exec_()
|
||||||
if res == 0:
|
if res == 0:
|
||||||
self.dialog_delete_product.close()
|
self.dialog_delete_product.close()
|
||||||
return
|
return
|
||||||
|
@ -3339,7 +3339,7 @@ class AppWindow(FrontWindow):
|
||||||
journal = self.journal
|
journal = self.journal
|
||||||
|
|
||||||
if journal.get('require_voucher'):
|
if journal.get('require_voucher'):
|
||||||
res = self.dialog_voucher.exec()
|
res = self.dialog_voucher.exec_()
|
||||||
if res == 0:
|
if res == 0:
|
||||||
self.dialog_voucher.close()
|
self.dialog_voucher.close()
|
||||||
return
|
return
|
||||||
|
@ -3711,4 +3711,4 @@ class AppWindow(FrontWindow):
|
||||||
self.dialog_manage_tables.hide()
|
self.dialog_manage_tables.hide()
|
||||||
|
|
||||||
def action_test_print(self):
|
def action_test_print(self):
|
||||||
self.dialog_test_printer.exec()
|
self.dialog_test_printer.exec_()
|
||||||
|
|
Loading…
Reference in New Issue