diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2024-09-17 14:05:31 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2024-09-17 14:05:31 +0700 |
| commit | f0aaf4476c8b92cb68503e9760216ca20fe4e34d (patch) | |
| tree | 9199754e2bba9f467ccae8b5cb4f01b2b882f492 /indoteknik_custom/models | |
| parent | 2e9f95e8201692317d1ce23f6992fdb0e37dc95c (diff) | |
api check_tempo and add type promotion on sale order
Diffstat (limited to 'indoteknik_custom/models')
| -rwxr-xr-x | indoteknik_custom/models/sale_order.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py index 6348328e..43ee3ef9 100755 --- a/indoteknik_custom/models/sale_order.py +++ b/indoteknik_custom/models/sale_order.py @@ -115,6 +115,17 @@ class SaleOrder(models.Model): margin_after_delivery_purchase = fields.Float(string='Margin After Delivery Purchase', compute='_compute_margin_after_delivery_purchase') percent_margin_after_delivery_purchase = fields.Float(string='% Margin After Delivery Purchase', compute='_compute_margin_after_delivery_purchase') purchase_delivery_amt = fields.Float(string='Purchase Delivery Amount', compute='_compute_purchase_delivery_amount') + type_promotion = fields.Char(string='Type Promotion', compute='_compute_type_promotion') + + def _compute_type_promotion(self): + for rec in self: + promotion_types = [] + for promotion in rec.order_promotion_ids: + for line_program in promotion.program_line_id: + if line_program.promotion_type: + promotion_types.append(dict(line_program._fields['promotion_type'].selection).get(line_program.promotion_type)) + + rec.type_promotion = ', '.join(promotion_types) def _compute_purchase_delivery_amount(self): for order in self: |
