minor fix search product only with fields required
This commit is contained in:
parent
515669c605
commit
072b579248
|
@ -2327,9 +2327,8 @@ class AppWindow(FrontWindow):
|
|||
elif isinstance(line['product'], dict):
|
||||
product_id = line['product']['id']
|
||||
if product_id:
|
||||
product, = self.Product.find([('id', '=', product_id)], ctx=self.stock_context)
|
||||
product, = self.Product.find([('id', '=', product_id)], fields=['id', 'name', 'code', 'rec_name', 'quantity'], ctx=self.stock_context)
|
||||
quantity = Decimal(line['quantity'])
|
||||
print('quantity', quantity, product, self.stock_context)
|
||||
if 'quantity' in product and not self._check_stock_quantity(product, quantity):
|
||||
return False
|
||||
return True
|
||||
|
|
Loading…
Reference in New Issue