From f77362c452e04c67927d4572a29157922932d6c7 Mon Sep 17 00:00:00 2001 From: stephanchrst Date: Tue, 17 Jan 2023 10:31:02 +0700 Subject: descending new product --- indoteknik_api/controllers/api_v1/product.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indoteknik_api/controllers/api_v1') diff --git a/indoteknik_api/controllers/api_v1/product.py b/indoteknik_api/controllers/api_v1/product.py index 7e86bafd..fc8e2610 100644 --- a/indoteknik_api/controllers/api_v1/product.py +++ b/indoteknik_api/controllers/api_v1/product.py @@ -30,7 +30,7 @@ class Product(controller.Controller): ('website_description', '!=', False), # ('create_date', '>=', delta_time), ] - new_products = request.env['product.template'].search(query_products, order='create_date', limit=250) + new_products = request.env['product.template'].search(query_products, order='create_date desc', limit=250) brands = [] for product in new_products: brands.append(product.x_manufacture) @@ -63,7 +63,7 @@ class Product(controller.Controller): if count_products < 6: _logger.info('Brand Skipped %s' % brand.x_name) continue - products = request.env['product.template'].search(query, order='name', limit=12) + products = request.env['product.template'].search(query, order='create_date desc', limit=12) data.append({ 'manufacture_id': brand.id, 'sequence': brand.sequence if brand.sequence else count, -- cgit v1.2.3