summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafi Zadanly <zadanlyr@gmail.com>2024-02-20 16:28:57 +0700
committerRafi Zadanly <zadanlyr@gmail.com>2024-02-20 16:28:57 +0700
commitf954856557e5199989f2e83a3d7c3015b5d9d42c (patch)
tree09873cd9faf6fc1c55791ee534e0cf12bc8aa4b4
parentdd6544f7fa40d8e688349f2f143d258f6dd3eec7 (diff)
Add parent on promotion product api res
-rw-r--r--indoteknik_custom/models/promotion/promotion_free_product.py4
-rw-r--r--indoteknik_custom/models/promotion/promotion_product.py4
2 files changed, 8 insertions, 0 deletions
diff --git a/indoteknik_custom/models/promotion/promotion_free_product.py b/indoteknik_custom/models/promotion/promotion_free_product.py
index c5055562..e91d5137 100644
--- a/indoteknik_custom/models/promotion/promotion_free_product.py
+++ b/indoteknik_custom/models/promotion/promotion_free_product.py
@@ -17,6 +17,10 @@ class PromotionFreeProduct(models.Model):
weight = rec.product_id.weight or 0
result.append({
'id': rec.product_id.id,
+ 'parent': {
+ 'id': rec.product_id.product_tmpl_id.id,
+ 'name': rec.product_id.product_tmpl_id.name,
+ },
'image': ir_attachment.api_image('product.template', 'image_256', rec.product_id.product_tmpl_id.id),
'display_name': rec.product_id.display_name,
'name': rec.product_id.name,
diff --git a/indoteknik_custom/models/promotion/promotion_product.py b/indoteknik_custom/models/promotion/promotion_product.py
index 2fad0f0d..ae26e888 100644
--- a/indoteknik_custom/models/promotion/promotion_product.py
+++ b/indoteknik_custom/models/promotion/promotion_product.py
@@ -17,6 +17,10 @@ class PromotionProduct(models.Model):
weight = rec.product_id.weight or 0
result.append({
'id': rec.product_id.id,
+ 'parent': {
+ 'id': rec.product_id.product_tmpl_id.id,
+ 'name': rec.product_id.product_tmpl_id.name,
+ },
'image': ir_attachment.api_image('product.template', 'image_256', rec.product_id.product_tmpl_id.id),
'display_name': rec.product_id.display_name,
'name': rec.product_id.name,