diff options
| author | stephanchrst <stephanchrst@gmail.com> | 2023-01-17 10:31:02 +0700 |
|---|---|---|
| committer | stephanchrst <stephanchrst@gmail.com> | 2023-01-17 10:31:02 +0700 |
| commit | f77362c452e04c67927d4572a29157922932d6c7 (patch) | |
| tree | cc7473a190e51afd8bdcfcad082e7ffa6d8100b7 /indoteknik_api/controllers/api_v1 | |
| parent | b9724e5d77c702c7418673bac3c711a60e1309d0 (diff) | |
descending new product
Diffstat (limited to 'indoteknik_api/controllers/api_v1')
| -rw-r--r-- | indoteknik_api/controllers/api_v1/product.py | 4 |
1 files changed, 2 insertions, 2 deletions
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, |
