diff options
| author | trisusilo48 <tri.susilo@altama.co.id> | 2024-12-05 14:47:42 +0700 |
|---|---|---|
| committer | trisusilo48 <tri.susilo@altama.co.id> | 2024-12-05 14:47:42 +0700 |
| commit | 1e9e0c28ee4dc63f1465affac6d98ae213d9f283 (patch) | |
| tree | e48922d3885f3c1870f24cfad2c708389468d722 /indoteknik_api/models/product_template.py | |
| parent | 4d5a0a6e2d997e323f8670172226f613b7673d62 (diff) | |
| parent | 4eac4d0709ec5d9e03b517a39cb67acbc35e2932 (diff) | |
Merge branch 'production' of https://bitbucket.org/altafixco/indoteknik-addons into production
Diffstat (limited to 'indoteknik_api/models/product_template.py')
| -rw-r--r-- | indoteknik_api/models/product_template.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/indoteknik_api/models/product_template.py b/indoteknik_api/models/product_template.py index 75899624..e46e44d3 100644 --- a/indoteknik_api/models/product_template.py +++ b/indoteknik_api/models/product_template.py @@ -7,6 +7,11 @@ class ProductTemplate(models.Model): def api_single_response(self, product_template, with_detail=''): product_pricelist_default_discount_id = self.env['ir.config_parameter'].get_param('product.pricelist.default_discount_id') product_pricelist_default_discount_id = int(product_pricelist_default_discount_id) + voucher = self.get_voucher_pastihemat(product_template.x_manufacture.id) + newVoucherPastiHemat = {"min_purchase": voucher.min_purchase_amount or 0, + "discount_type": voucher.discount_type or '', + "discount_amount": voucher.discount_amount or 0, + "max_discount": voucher.max_discount_amount or 0,} data = { 'id': product_template.id, 'image': self.env['ir.attachment'].api_image('product.template', 'image_128', product_template.id), @@ -18,6 +23,7 @@ class ProductTemplate(models.Model): 'weight': product_template.weight, 'manufacture': self.api_manufacture(product_template), 'categories': self.api_categories(product_template), + "newVoucherPastiHemat": newVoucherPastiHemat } if with_detail != '': |
