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