summaryrefslogtreecommitdiff
path: root/indoteknik_custom
diff options
context:
space:
mode:
Diffstat (limited to 'indoteknik_custom')
-rwxr-xr-xindoteknik_custom/models/sale_order.py11
-rwxr-xr-xindoteknik_custom/views/sale_order.xml1
2 files changed, 12 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:
diff --git a/indoteknik_custom/views/sale_order.xml b/indoteknik_custom/views/sale_order.xml
index e772dcae..f2789254 100755
--- a/indoteknik_custom/views/sale_order.xml
+++ b/indoteknik_custom/views/sale_order.xml
@@ -32,6 +32,7 @@
<field name="delivery_amt"/>
<field name="fee_third_party"/>
<field name="total_percent_margin"/>
+ <field name="type_promotion"/>
<label for="voucher_id"/>
<div class="o_row">
<field name="voucher_id" id="voucher_id" attrs="{'readonly': ['|', ('state', 'not in', ['draft', 'sent']), ('applied_voucher_id', '!=', False)]}"/>