Fix: Product Quantity, search context
This commit is contained in:
parent
695c97638c
commit
08cb74af5c
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user