diff options
| author | it-fixcomart <it@fixcomart.co.id> | 2024-11-26 16:56:38 +0700 |
|---|---|---|
| committer | it-fixcomart <it@fixcomart.co.id> | 2024-11-26 16:56:38 +0700 |
| commit | fd5617629243b879e020afbdb2f1957d2e419ae4 (patch) | |
| tree | b1b0ff774f7543df92b5f7757204f2d6757be3a9 | |
| parent | 899c9eea89b4745d76bf19e201f81b2b091dba34 (diff) | |
<iman> update improve
| -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 != '': |
