From 1698ec300f2e7c363e41cb51ce94a39f66d6088b Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Tue, 17 Sep 2024 14:43:22 +0700 Subject: cr type promotion --- indoteknik_custom/models/sale_order.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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: -- cgit v1.2.3