fix on get values config

This commit is contained in:
Wilson Gomez 2023-10-17 09:43:01 -05:00
parent 6dcf6658eb
commit bf17c1c842
5 changed files with 31 additions and 4 deletions

View File

@ -29,6 +29,20 @@ QLabel {
min-width : 10px;
}
/* QLineEdit {
font : 12pt;
color : #e7e8e9;
min-height : 10px;
min-width : 10px;
}
QComboBox {
font : 12pt;
color : #e7e8e9;
min-height : 10px;
min-width : 10px;
} */
QAbstractButton {
font-family: "DejaVu Sans";
background-color: rgb(220, 220, 220);

View File

@ -55,7 +55,6 @@
}
#button_label_toolbar {
/* font-size: 16px; */
font-size: 12px;
max-height: 30px;
text-align: center;
@ -109,7 +108,6 @@
background-color: white;
max-height: 60px;
min-width : 90px;
/* max-width : 190px; */
border-width: 0px;
}

View File

@ -205,6 +205,21 @@ class FrontWindow(QMainWindow):
self.Config = Model('sale.configuration', self.ctx, main_window=self)
self.Sale = Model('sale.sale', self.ctx, main_window=self)
self._config, = self.Config.find([('id', '=', 1)])
if not isinstance(self._config, dict):
fields = [
'tip_product.code', 'show_description_pos',
'show_position_pos', 'show_stock_pos', 'password_force_assign',
'tip_rate', 'show_agent_pos', 'discount_pos_method', 'show_brand',
'show_location_pos', 'show_delivery_charge', 'use_price_list',
'decimals_digits_quantity', 'password_admin_pos', 'show_fractions',
'new_sale_automatic', 'show_product_image',
'encoded_sale_price',
'delivery_product.list_price', 'delivery_product.code',
'delivery_product.name', 'allow_discount_handle',
'cache_products_local', 'show_party_categories',
'print_lines_product', 'uvt_pos'
]
self._config, = self.Config.find([('id', '=', 1)], fields=fields)
self.discount_method = self._config.get('discount_pos_method')
self.allow_discount_handle = self._config.get('allow_discount_handle', None)

View File

@ -208,7 +208,7 @@ class Model(object):
response = conn.getresponse()
res = json.loads(response.read())
if response.status != 200:
if self.main_window:
if self.main_window and hasattr(self.main_window, 'statusbar'):
print(res, 'valida')
self.main_window.dialog(
'error_server',

2
pospro
View File

@ -28,7 +28,7 @@ class Client(object):
self.app.setOrganizationName("PRESIK SAS")
self.app.setOrganizationDomain("presik.com")
self.app.setApplicationName("SMART POS")
self.app.setStyle("Fusion")
self.app.setStyle("fusion")
def init_login(self):
_file_config = 'config_pos.ini'