FIX FOCUS AND GET ADD_PRODUCT

This commit is contained in:
Elvis 2023-04-10 09:16:53 -05:00
parent 05e932c1c3
commit 2124286529
3 changed files with 13 additions and 14 deletions

View File

@ -176,7 +176,8 @@ class QuickDialog(QDialog):
super(QuickDialog, self).closeEvent(event)
def dialog_rejected(self):
self.parent.setFocus()
print('cancell quitdialog')
self.parent.label_input.setFocus()
self.setResult(0)
self.hide()

View File

@ -227,10 +227,11 @@ class SearchWindow(QDialog):
def hide(self):
self.clear_filter()
self.parent.setFocus()
super(SearchWindow, self).hide()
self.parent.label_input.setFocus()
def action_close(self):
self.parent.label_input.setFocus()
self.close()
def action_selection_changed(self):

View File

@ -733,7 +733,6 @@ class AppWindow(FrontWindow):
])
self.model_sale_lines.update_record(sale_line)
elif self._state in ['add', 'cancel', 'accept']:
print('si pasa junto al metodo clear_right_panel()')
self.clear_right_panel()
self.add_product(code=self._input_text)
elif self._state == 'payment':
@ -1097,9 +1096,7 @@ class AppWindow(FrontWindow):
if sale['invoice_type'] == 'P' and self._config.get('uvt_pos') and sale['total_amount'] > self._config['uvt_pos']:
return self.dialog('base_uvt_pos')
if self.enviroment == 'retail':
print('ingresa a este')
self.Sale.button_method('quote', [self._sale['id']])
print('no conitnua')
self.load_sale(self._sale['id'])
self.set_state('accept')
@ -1411,6 +1408,7 @@ class AppWindow(FrontWindow):
val = self.field_invoice_type.get_id()
if val and self._sale and self._sale.get('id'):
self.Sale.write([self._sale['id']], {'invoice_type': val})
self.label_input.setFocus()
def action_tax_selection_changed(self):
args = {'id': self.store.sale_id, 'tax_id': self.field_tax_id}
@ -1594,6 +1592,7 @@ class AppWindow(FrontWindow):
self.field_commission_amount.setText(str(total))
def action_party(self):
print('action_parety si llega')
if self._state in ['checkout']:
return
self.dialog_search_parties.clear_rows()
@ -1939,8 +1938,10 @@ class AppWindow(FrontWindow):
self.message_bar.set('sale_closed')
return
if not party_id:
self.label_input.setFocus()
party_id = self.dialog_search_parties.get_id()
if not party_id:
self.label_input.setFocus()
return
party, = self.Party.find([('id', '=', party_id)])
@ -2502,7 +2503,6 @@ class AppWindow(FrontWindow):
self.message_bar.set('product_not_found')
return False
product = products[0]
# sadsd
return product
def _check_quantity(self):
@ -2572,16 +2572,13 @@ class AppWindow(FrontWindow):
if list_price is not None:
data['list_price'] = list_price
print(data['list_price'], 'si se cumple')
ctx = None
# ctx = None
if hasattr(self, 'field_list_price'):
ctx = {'price_list': self.field_list_price.get_id()}
kargs = {
'sale_id': data['sale_id'],
'product_id': data['product_id'],
'args': data,
'context': ctx
}
print(self.field_list_price.get_id(), 'este es el id de la lista')
# ctx = {'price_list': self.field_list_price.get_id()}
data['price_list'] = self.field_list_price.get_id()
res = self.Sale.faster_add_product(data)
res['sale'] = self._sale['id']
self._sale_line = res