summaryrefslogtreecommitdiff
path: root/indoteknik_api/controllers/api_v1/product.py
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2023-01-24 11:43:52 +0700
committerstephanchrst <stephanchrst@gmail.com>2023-01-24 11:43:52 +0700
commit2a3a0a7e88ef24456eeda070a7d74f1457efdb18 (patch)
tree2bb4cd374d46b5d5e4fb6e32fe239c5ccc83daf4 /indoteknik_api/controllers/api_v1/product.py
parent287cf8497b4b6bb825870ee2b3d1b49d4c29ab6a (diff)
parent646b9e22fc11f6f1d1b556761a3df2df61f8f59b (diff)
Merge branch 'release' into staging
Diffstat (limited to 'indoteknik_api/controllers/api_v1/product.py')
-rw-r--r--indoteknik_api/controllers/api_v1/product.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/indoteknik_api/controllers/api_v1/product.py b/indoteknik_api/controllers/api_v1/product.py
index 78b03203..23dcf48e 100644
--- a/indoteknik_api/controllers/api_v1/product.py
+++ b/indoteknik_api/controllers/api_v1/product.py
@@ -19,6 +19,8 @@ class Product(controller.Controller):
is_brand_only = int(kw.get('is_brand_only', 0))
base_url = request.env['ir.config_parameter'].get_param('web.base.url')
+ limit_new_products = request.env['ir.config_parameter'].get_param('limit.new.product')
+ limit_new_products = int(limit_new_products)
# current_time = datetime.now()
# delta_time = current_time - timedelta(days=30)
@@ -28,9 +30,11 @@ class Product(controller.Controller):
('active', '=', True),
('image_128', '!=', False),
('website_description', '!=', False),
+ # ('write_uid', '!=', 1),
+ ('x_manufacture', '!=', False),
# ('create_date', '>=', delta_time),
]
- new_products = request.env['product.template'].search(query_products, order='create_date desc', limit=250)
+ new_products = request.env['product.template'].search(query_products, order='create_date desc', limit=limit_new_products)
brands = []
for product in new_products:
brands.append(product.x_manufacture)
@@ -57,6 +61,8 @@ class Product(controller.Controller):
('x_manufacture', '=', brand.id),
('image_128', '!=', False),
('website_description', '!=', False),
+ # ('write_uid', '!=', 1),
+ ('x_manufacture', '!=', False),
# ('create_date', '>=', delta_time),
]
count_products = request.env['product.template'].search_count(query)