diff --git a/modules/sale_don_confiao/routes.py b/modules/sale_don_confiao/routes.py index ea92487..36056a9 100644 --- a/modules/sale_don_confiao/routes.py +++ b/modules/sale_don_confiao/routes.py @@ -1,4 +1,5 @@ from trytond.wsgi import app +from trytond.transaction import Transaction from trytond.protocols.wrappers import ( with_pool, with_transaction, @@ -96,17 +97,18 @@ def products(request, pool): @with_transaction() @don_confiao_application def search_products(request, pool, product_name: str): - Product = pool.get('product.product') - products = Product.search_read([ - ('name', 'ilike', f'%{product_name}%') - ], order=[ - ('id', 'ASC') - ], fields_names=[ - 'id', - 'name', - 'list_price', - 'description' - ]) + with Transaction().set_context({'company': 1}): + Product = pool.get('product.product') + products = Product.search_read([ + ('name', 'ilike', f'%{product_name}%') + ], order=[ + ('id', 'ASC') + ], fields_names=[ + 'id', + 'name', + 'template.list_price', + 'description' + ]) return products