diff --git a/modules/sale_don_confiao/routes.py b/modules/sale_don_confiao/routes.py index 09374a0..1e59114 100644 --- a/modules/sale_don_confiao/routes.py +++ b/modules/sale_don_confiao/routes.py @@ -79,9 +79,14 @@ def search_products(request, pool, product_name): products = Product.search_read( [('name', 'like', product_name)], order=[('id', 'ASC')], - fields_names=['id', 'name', 'list_price']) + fields_names=[ + 'id', 'name', 'list_price', + 'description', 'template.forecast_quantity' + ]) + return products + @app.route('//sale_don_confiao/sales', methods=['GET']) @allow_null_origin @with_pool diff --git a/modules/sale_don_confiao/tests/test_api_donconfiao.py b/modules/sale_don_confiao/tests/test_api_donconfiao.py index 085d422..e41137a 100644 --- a/modules/sale_don_confiao/tests/test_api_donconfiao.py +++ b/modules/sale_don_confiao/tests/test_api_donconfiao.py @@ -101,7 +101,6 @@ class DonConfiaoApiRouteTestCase( template, = ProductTemplate.create([{ 'name': 'Product', 'default_uom': Uom.search([('name', '=', 'Unit')])[0].id, - 'list_price': 5000 }]) Product.create([{'template': template.id}]) @@ -129,8 +128,8 @@ class DonConfiaoApiRouteTestCase( products = json.loads( response.get_data().decode()) - raise Exception(products) self.assertEqual(response.status_code, HTTPStatus.OK) + self.assertEqual(len(products), 2) def test_get_sales(self): pool = Pool(DB_NAME)