Hi everyone,
I am having a weird behavior on a float function field.
I define the following fields
weight = fields.Float('Weight', digits=(3,2),help='Weight in kilos')
height = fields.Float('Height', digits=(3,1), help='Height in centimeters')
bmi = fields.Function(
fields.Float('BMI', digits=(2,2),help='Body mass index'), 'get_bmi')
def get_bmi(self, name):
bmi = 0
if self.height:
bmi =(self.weight / pow((self.height/100),2))
return bmi
Each time I want to change the view or close the tab tryton ask me to save the record even if it is already saved.
When I took off the pow function, for example, making bmi = self.weight/self.height, the problem is gone.
I am using tryton 5.0.
I don’t know if it is a bug or maybe I corrupted somthing on the db
Regards.
Francisco