minor fix

This commit is contained in:
wilsongomez 2022-05-14 09:46:35 -05:00
parent 610baa5cef
commit 8292e69d03
1 changed files with 5 additions and 1 deletions

View File

@ -770,7 +770,10 @@ class AppWindow(FrontWindow):
rec = {}
try:
quantity = Decimal(eval_value)
product_id = self._sale_line['product']['id']
try:
product_id = self._sale_line['product']['id']
except:
product_id = self._sale_line['product']
if product_id and self.stock_context:
_product, = self.Product.find(
[('id', '=', product_id)],
@ -778,6 +781,7 @@ class AppWindow(FrontWindow):
)
if _product and 'quantity' in _product:
if not self._check_stock_quantity(_product, quantity):
print('retorna esta')
return False
if self._current_line_id:
self._sale_line['quantity'] = float(quantity)