title: ValueError Expected singleton , Odoo8
body: <p>I have been working on a module in Odoo8 on Ubuntu 14.04. I have come up to a strange issue when saving a form record based on some One2many fields. The error says </p>
  
  <pre><code>ValueError
  
  Expected singleton: hr.employee.pay.change(84, 85) 
  </code></pre>
  
  <p>My Python code is as below</p>
  
  <pre><code>class hr_employee_pay_change(models.Model):
  
      _name='hr.employee.pay.change'
      hr_payroll_change_ids = fields.Many2one("employee.salary.change", "Employee", ondelete="cascade")
  
      @api.onchange('emp_basic', 'emp_allowance')
      @api.depends('emp_basic', 'emp_allowance')
      def _current_total(self):
          self.emp_current_total = self.emp_basic + self.emp_allowance
  
  
  
      @api.onchange('emp_propose_allowance', 'emp_propose_basic')
      @api.depends('emp_propose_allowance', 'emp_propose_basic')
      def _proposed_total(self):
          data_val={}
          self.emp_propose_total = self.emp_propose_basic + self.emp_propose_allowance
          cr=self._cr
          uid=self._uid
          ids=self._ids  
          val=int(self.employee_name)
          if val:
             cr.execute("select max_salary,min_salary from hr_job where id in (select job_id from hr_employee where id='"+str(val)+"')")
             res=cr.fetchall()
             for data_val in res:
                 max_sal=data_val[0]
                 min_sal=data_val[1]
             if not min_sal &lt; self.emp_propose_total &lt; max_sal: 
                self.emp_propose_basic = 0.0
                self.emp_propose_allowance = 0.0
                return {'warning':{'title':'warning','message':'Out of Range, Proposed Total must be in between "'+str(max_sal)+'"to"'+str(min_sal)+'"'}}
          else:
             cr.execute("select wage from hr_contract where employee_id=0")    
  
  
  
  
      @api.onchange('employee_name')
      @api.depends('employee_name')
      def get_data(self):
          data={}
          cr=self._cr
          uid=self._uid
          ids=self._ids     
          value=int(self.employee_name)        
          if(self.employee_name):  
             cr.execute("select wage,allowance from hr_contract where employee_id ='"+str(value)+"'")
             res=cr.fetchall()
             for data in res:
                 self.emp_basic=data[0]
                 self.emp_allowance = data[1]
  
          else:     
             cr.execute("select wage,allowance from hr_contract where employee_id=0")   
  
  
  
      employee_name = fields.Many2one('hr.employee', 'Employee Name', required=True )
      zeo_number = fields.Char(related='employee_name.zeo_number', string='ZEO Number', readonly=True )
      emp_basic = fields.Float('Basic Salary',  compute='get_data',readonly=True, store=True )
      emp_allowance = fields.Float('Allowance', compute='get_data',readonly=True, store=True )
      emp_current_total = fields.Float('Totals', compute='_current_total', store=True, track_visibility='always')
      emp_propose_basic = fields.Float('Proposed Basic')
      emp_propose_allowance = fields.Float('Proposed Allowance')
      emp_propose_total = fields.Float('Proposed Totals', compute='_proposed_total', store=True, track_visibility='always')
  </code></pre>
  
  <p>I am unable to get this issue . I tried to remove the 'readonly=True' property of the field and the issue gets fixed but I need to have them as readonly . Hopes for suggestion</p>