...
make sure the status is active
then
no signal listener to registerRegister
getParameter to getParameter signal
getLinkedClass ot getLinkedClass signal
activeForObject(self, instance, context)
...
return CCPD.value
else Return False
getLinkedClass(classname)
ListClass = []
if class == ContributionPlan or class == None
ListClass.amend(Calculation)
else if class == PH insuree or class == None
ListClass.amend( ContributionPlanBundle)
else if class == ContractDetails or class == None
ListClass.amend( ContributionPlanBundle)
else if class == ContractContributionPlanDetails or class == None
ListClass.amend(ContributionPlan)
else if class == ContributionPlanBundle or class == None
ListClass.amend(ContributionPlan)
return listClass
getParamteres(ClassName, instance)
#className is the class name of the object where the calculation param need to be added
#instance is where the link with a calculation need to be found, like the CPB in case of PH insuree or Contract Details
This function has two steps
1- getRuleDetails(className)
2- define if the calculation should be used
for each “eligible“ ruleDetails,
checkCalculation(instance) #check if the calculation is really concerning the class for that context
return a list only with rule details that matches step 1 and 2