Fix: Product Quantity, search context

This commit is contained in:
Rodia 2025-01-18 18:29:49 -05:00
parent 695c97638c
commit 08cb74af5c

View File

@ -97,8 +97,9 @@ def products(request, pool):
@with_transaction()
@don_confiao_application
def search_products(request, pool, product_name: str):
with Transaction().set_context({'company': 1}):
Product = pool.get('product.product')
Product = pool.get('product.product')
with Transaction().set_context(
{'company': 1, 'locations': [3]}):
products = Product.search_read([
('name', 'ilike', f'%{product_name}%')
], order=[
@ -107,7 +108,8 @@ def search_products(request, pool, product_name: str):
'id',
'name',
'template.list_price',
'description'
'description',
'quantity',
])
return products