From e320d275317709d8cf9248efce15466dece4330d Mon Sep 17 00:00:00 2001 From: delcroip Date: Wed, 30 Oct 2024 18:26:11 +0100 Subject: [PATCH] use related ref --- calculation/calculation_rule.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/calculation/calculation_rule.py b/calculation/calculation_rule.py index 7e4d9f7..6fa1374 100644 --- a/calculation/calculation_rule.py +++ b/calculation/calculation_rule.py @@ -29,7 +29,7 @@ class ContributionValuationRule(AbsStrategy): def active_for_object(cls, instance, context, type='account_receivable', sub_type='contribution'): return ( instance.__class__.__name__ == "ContractContributionPlanDetails" - and context in ["value", "members", "validity"] + and context in ["value", "members", "validity"] ) and cls.check_calculation(instance) @classmethod @@ -46,8 +46,8 @@ def check_calculation(cls, instance): elif class_name == "ContributionPlan": match = UUID(str(cls.uuid)) == UUID(str(instance.calculation)) elif class_name == "ContributionPlanBundle": - list_cpbd = list(ContributionPlanBundleDetails.objects.filter( - contribution_plan_bundle=instance + list_cpbd = list(instance.contributionplanbundledetails_set.filter( + is_deleted=False )) for cpbd in list_cpbd: if match is False: