fix view image

fix cancel dialog qty stock
This commit is contained in:
Wilson Gomez 2023-05-24 09:30:16 -05:00
parent 36b94296a1
commit 31a8370790
4 changed files with 13 additions and 5 deletions

View File

@ -177,7 +177,10 @@ class QuickDialog(QDialog):
def dialog_rejected(self):
print('cancell quitdialog')
self.parent.label_input.setFocus()
try:
self.parent.label_input.setFocus()
except:
pass
self.setResult(0)
self.hide()

View File

@ -318,7 +318,7 @@ class SearchProduct(SearchWindow):
_cols_width_append(100)
if parent._config.get('show_location_pos'):
headers['location.name'] = {'desc': 'BODEGA', 'type': 'char'}
headers['locations.name'] = {'desc': 'BODEGA', 'type': 'char'}
_cols_width_append(100)
if parent._config['show_product_image']:

View File

@ -372,7 +372,7 @@ class FrontWindow(QMainWindow):
])
if self._config['show_stock_pos'] in ('value', 'icon'):
self.stock_context = {
'stock_date_end': date.today(),
'stock_date_end': date.today().strftime("%Y-%m-%d"),
'locations': [self.shop['warehouse']],
}

View File

@ -1917,6 +1917,7 @@ class AppWindow(FrontWindow):
else:
dom.append(('reservation', '=', True))
# dom.append(['payment_method', '!=', 'all_paid'])
time1 = time.time()
fields = self.dialog_search_sales.fields_names
sales = self.Sale.find(dom, fields=fields, order=[('id', 'DESC')])
self.dialog_search_sales.set_from_values(sales)
@ -1928,6 +1929,8 @@ class AppWindow(FrontWindow):
]
sales_draft = self.Sale.find(dom_draft)
self.dialog_search_sales.set_counter_control(sales_draft)
print(time.time() - time1, 'search sales')
def on_selected_sale(self):
sale_id = self.dialog_search_sales.get_id()
@ -2016,7 +2019,6 @@ class AppWindow(FrontWindow):
if sale.get('table_assigned.'):
self.field_table_assigned.setText(
sale['table_assigned.']['name'] or '')
print(sale, 'validate data')
consumer = sale.get('consumer.', None)
if consumer:
self.field_consumer.setText(consumer['name'] or '')
@ -2164,7 +2166,7 @@ class AppWindow(FrontWindow):
image_64_decode = base64.b64decode(product['image'])
image_ = QtGui.QImage()
image_.loadFromData(image_64_decode , 'PNG')
image_.loadFromData(image_64_decode)
image.set_image(image_, kind='qimage')
image.activate()
@ -2313,6 +2315,9 @@ class AppWindow(FrontWindow):
else:
ctx['price_list'] = self.shop['price_list.']['id']
fields = self.dialog_search_products.fields_names
# if self._config['show_location_pos']:
# # fields.append('locations.name')
# pass
products = self.Product.find(domain, fields=fields,
limit=100, ctx=self.stock_context)
self.dialog_search_products.set_from_values(products)