add option view info product in restaurant

add option dont delete products commanded
This commit is contained in:
Wilson Gomez 2023-10-13 17:02:41 -05:00
parent 2eee6781d5
commit 6dcf6658eb
6 changed files with 17 additions and 22 deletions

View File

@ -58,11 +58,6 @@ class StartButtons(QVBoxLayout):
values_extend([
['button_tables', 'VER MESAS', 'action_tables', 'tables']
])
else:
values_extend([
['button_product_info', 'INFO. PRODUCTO', 'action_info_product', 'product_info'],
])
if parent.type_pos_user in ('cashier', 'frontend', 'frontend_admin'):
values_extend([
@ -77,6 +72,7 @@ class StartButtons(QVBoxLayout):
values_extend([
['button_help', 'AYUDA', 'action_help', 'help'],
['button_product_info', 'INFO. PRODUCTO', 'action_info_product', 'product_info']
])
positions = [(i, j) for i in range(rows) for j in range(columns)]

View File

@ -1,21 +1,20 @@
import os
from pathlib import Path
from PySide6.QtCore import (QSize, Qt, QRect, QMetaObject)
from PySide6.QtGui import (QBrush, QColor, QFont, QGradient, QIcon,
QLinearGradient, QPalette, QPixmap)
from PySide6.QtCore import (QSize, Qt, QRect)
from PySide6.QtGui import (QFont, QIcon, QPixmap)
from PySide6.QtWidgets import (QGridLayout, QGroupBox, QLabel,
QLayout, QPushButton, QLineEdit, QVBoxLayout, QWidget, QLineEdit,
QDialogButtonBox, QSizePolicy, QHBoxLayout)
QLayout, QPushButton, QLineEdit, QVBoxLayout, QWidget,
QHBoxLayout)
from ..version import __version__
from ..tools import get_screen
pkg_dir = str(Path(os.path.dirname(__file__)).parents[0])
path_pos_advanced = os.path.join(pkg_dir, 'share', 'advanced_pos.png')
from ..tools import get_screen
dimensions = {
'large': (1173, 666),
'medium': (980, 666),
'small': (900, 666),
'large': (1173, 666),
'medium': (980, 666),
'small': (900, 666),
}
STYLE = """

View File

@ -1752,7 +1752,7 @@ class DialogInfoProduct(QuickDialog):
grid = QGridLayout()
_sizes = (160, 320)
fields = (
{'label': 'CODIGO', 'type': 'integer', 'readonly': False},
{'label': 'CODIGO', 'type': 'char', 'readonly': False},
{'label': 'NOMBRE', 'type': 'char', 'readonly': False},
)
self.model = TableEdit(self, [], fields)
@ -1914,7 +1914,7 @@ class DialogCollection(QuickDialog):
grid = QGridLayout()
_sizes = (160, 320)
fields = (
{'label': 'DOCUMENTO', 'type': 'char', 'readonly': False},
{'label': 'DOCUMENTO', 'type': 'char', 'readonly': False},
{'label': 'NOMBRE', 'type': 'char', 'readonly': False},
)
self.model = TableEdit(self, [], fields)

View File

@ -3259,7 +3259,8 @@ class AppWindow(FrontWindow):
note = None
if self.environment == 'restaurant':
order_sended = line.get('order_sended') and line['order_sended'] in (True, '')
if self.type_pos_user in ['order', 'salesman'] and order_sended:
not_delete = self._config.get('no_remove_commanded', False)
if order_sended and (not self.user_can_delete or not_delete):
return self.dialog('user_without_permission')
if order_sended:

View File

@ -170,7 +170,7 @@ MODELS_RESTAURANT = {
'show_location_pos', 'show_delivery_charge', 'use_price_list',
'decimals_digits_quantity', 'password_admin_pos', 'show_fractions',
'new_sale_automatic', 'show_product_image',
'print_invoice_payment', 'encoded_sale_price',
'no_remove_commanded', 'encoded_sale_price',
'delivery_product.list_price', 'delivery_product.code',
'delivery_product.name', 'allow_discount_handle',
'cache_products_local', 'show_party_categories',
@ -385,10 +385,10 @@ MODELS_RETAIL = {
'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',
'print_invoice_payment', 'encoded_sale_price',
'delivery_product.list_price', 'delivery_product.code',
'new_sale_automatic', 'show_product_image', 'delivery_product.code',
'encoded_sale_price', 'delivery_product.list_price',
'delivery_product.name', 'allow_discount_handle',
'no_remove_commanded',
'cache_products_local', 'show_party_categories',
'print_lines_product', 'uvt_pos'
]

View File

@ -92,7 +92,6 @@ class Receipt(object):
self._footer = context.get('footer')
self._header = context.get('header')
self._printing_taxes = context.get('printing_taxes')
self._print_invoice_payment = context.get('print_invoice_payment')
self._delta_locale = context.get('delta_locale')
self._environment = environment
self.order_copies = context.get('order_copies') or 0