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