TypeError: hr.employee(26,) is not JSON serializable

457 views Asked by At

I tried to apply domain for many2one field. But I got the following Error:

  @api.mutli
  def open_other_view(self):
      ......
      ......
      ......
      tree_id = self.env.ref('module_name.tree_xml_id').id
      return {
         'type': 'ir.actions.act_window',
         'name': 'title',
         'views': [(tree_id, 'tree'), (False, 'form')],
         'domain' : [('employee_id','=',self.employee_id)],
         ....
         ....
      }

1

There are 1 answers

3
Dayana On BEST ANSWER

you could try to obtain the employee id like:

'domain' : [('employee_id','=',self.employee_id.id)] 

I hope this help you.