When i enter 10 the value is recorded but when i enter 10.55 is not recorded. How to resolve it ?
def save_contract_completion(self):
total_weightage = 0
for line in self.stage_details_ids:
total_weightage += line.stage_weightage
if total_weightage <= 0:
raise ValidationError(
f'The total of stage weightage is %s' % (total_weightage) + '%. \nPlease, re-set the weightage of each stage.' )
elif total_weightage > 100:
raise ValidationError(
f'The total of stage weightage is more than 100%.\nPlease, re-set the weightage of each stage.')
elif total_weightage < 100:
return{
'name': ("Confirmation"),
'type': 'ir.actions.act_window',
'res_model': 'contract.completion.validation.wizard',
'view_mode': 'form',
'target': 'new',
'context': {'default_contract_completion_id': self.id,}
}
else:
return {
'type': 'ir.actions.act_window_close',
}