summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2024-09-17 14:43:22 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2024-09-17 14:43:22 +0700
commit1698ec300f2e7c363e41cb51ce94a39f66d6088b (patch)
tree136e259cab87e01c991d89ec16ecf39e336d1fea
parent3f7cb23684eb827e9610cdf6bdd80127c16f08c5 (diff)
cr type promotion
-rwxr-xr-xindoteknik_custom/models/sale_order.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py
index 43ee3ef9..65b92601 100755
--- a/indoteknik_custom/models/sale_order.py
+++ b/indoteknik_custom/models/sale_order.py
@@ -125,7 +125,9 @@ class SaleOrder(models.Model):
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)
+ # Removing duplicates by converting to a set, then back to a list
+ rec.type_promotion = ', '.join(sorted(set(promotion_types)))
+
def _compute_purchase_delivery_amount(self):
for order in self: