summaryrefslogtreecommitdiff
path: root/indoteknik_api/models
diff options
context:
space:
mode:
authorIT Fixcomart <it@fixcomart.co.id>2022-11-01 16:44:44 +0700
committerIT Fixcomart <it@fixcomart.co.id>2022-11-01 16:44:44 +0700
commit25ab8a7f448c5a7045b6944839622a3f79900164 (patch)
treed9025986a02f3bf7cea2ee34ea4cfaa9f7063556 /indoteknik_api/models
parent9a7b506816c724a8af10b51622532f773257f203 (diff)
Add filter by solr_flag and with_detail in rest api product search
Diffstat (limited to 'indoteknik_api/models')
-rw-r--r--indoteknik_api/models/product_template.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/indoteknik_api/models/product_template.py b/indoteknik_api/models/product_template.py
index e99b2c2d..a1e2e5a4 100644
--- a/indoteknik_api/models/product_template.py
+++ b/indoteknik_api/models/product_template.py
@@ -25,6 +25,8 @@ class ProductTemplate(models.Model):
'image': base_url + 'api/image/product.template/image_512/' + str(product_template.id) if product_template.image_512 else '',
'variants': [],
'description': product_template.website_description or '',
+ 'solr_flag': product_template.solr_flag,
+ 'product_rating': product_template.product_rating,
}
for variant in product_template.product_variant_ids:
data_with_detail['variants'].append({
@@ -34,7 +36,9 @@ class ProductTemplate(models.Model):
'price': self.env['product.pricelist'].compute_price(product_pricelist_default_discount_id, variant.id),
'stock': variant.qty_stock_vendor,
'weight': variant.weight,
- 'attributes': [x.name for x in variant.product_template_attribute_value_ids]
+ 'attributes': [x.name for x in variant.product_template_attribute_value_ids],
+ 'solr_flag': product_template.solr_flag,
+ 'product_rating': product_template.product_rating,
})
data.update(data_with_detail)
return data