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() @with_transaction()
@don_confiao_application @don_confiao_application
def search_products(request, pool, product_name: str): 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([ products = Product.search_read([
('name', 'ilike', f'%{product_name}%') ('name', 'ilike', f'%{product_name}%')
], order=[ ], order=[
@ -107,7 +108,8 @@ def search_products(request, pool, product_name: str):
'id', 'id',
'name', 'name',
'template.list_price', 'template.list_price',
'description' 'description',
'quantity',
]) ])
return products return products