summaryrefslogtreecommitdiff
path: root/indoteknik_api/models
diff options
context:
space:
mode:
authortrisusilo <tri.susilo@altama.co.id>2023-01-04 07:53:29 +0000
committertrisusilo <tri.susilo@altama.co.id>2023-01-04 07:53:29 +0000
commit32a38516894abbd7aa010f99a7fdbc18268b3bdc (patch)
treec47eb17a8d19b3ff241e951f8793d6b80fa23ca1 /indoteknik_api/models
parent7cc4bec031757d23c7f7f9e754fc2997d2dfd921 (diff)
parentdd5fcceb381eccbc1b08fd7afb08f8e6f15d04be (diff)
Merged in Feature/wishlish (pull request #12)
update api wishlish for variant and product
Diffstat (limited to 'indoteknik_api/models')
-rw-r--r--indoteknik_api/models/product_product.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/indoteknik_api/models/product_product.py b/indoteknik_api/models/product_product.py
index 92c738fd..6b02d91e 100644
--- a/indoteknik_api/models/product_product.py
+++ b/indoteknik_api/models/product_product.py
@@ -22,5 +22,18 @@ class ProductProduct(models.Model):
'stock': product_product.qty_stock_vendor,
'weight': product_product.weight,
'attributes': [x.name for x in product_product.product_template_attribute_value_ids],
+ 'manufacture' : self.api_manufacture(product_product)
}
- return data \ No newline at end of file
+ return data
+
+ def api_manufacture(self, product_template):
+ base_url = self.env['ir.config_parameter'].get_param('web.base.url')
+ if product_template.x_manufacture:
+ manufacture = product_template.x_manufacture
+ return {
+ 'id': manufacture.id,
+ 'name': manufacture.x_name,
+ 'image_promotion_1': base_url + 'api/image/x_manufactures/image_promotion_1/' + str(manufacture.id) if manufacture.image_promotion_1 else '',
+ 'image_promotion_2': base_url + 'api/image/x_manufactures/image_promotion_2/' + str(manufacture.id) if manufacture.image_promotion_2 else '',
+ }
+ return {} \ No newline at end of file