Skip to Content
Menu
This question has been flagged
1 Reply
2306 Views

Hello,

I would like to increment the value of the field "temperature" in all records in my tree view.

So which instruction i should write inside my function ?

Thank you 

Avatar
Discard
Author

Thank you Niyas :)

Best Answer

Hi Zak,

In the buttons action, you can write a code like this,

all_rec = self.env['model_name'].search([])
#here you will get all records of the model
for rec in all_rec:
#here increment value by one
rec.temperature = rec.temperature + 1

Thanks

Avatar
Discard