0

how can we change the state value in a @api.depends method ? I tried the return {'value':{'stat':'done'}} and self.state='done' didn't work then self.browse(self.id).write({'state':'done' }) worked but on instant, we have to return to the list view or to reload the page to see the new state

m3asmi
  • 1,252
  • 1
  • 16
  • 36

1 Answers1

0

your problem can be resolved using this.

@api.onchange('your_field')
def your_method_name(self):
    self.state='done'
    return {
            'type': 'ir.actions.client',
            'tag': 'reload',
            }
Alpesh Valaki
  • 1,611
  • 1
  • 16
  • 36