title: Odoo 11 ValueError: Expected singleton: %s" % record
body: <p>I am creating a custom module where I want to get all the selected employee in the Payroll and send them a default email. For that I am doing this</p>
  
  <p>To show the action button </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;odoo&gt;
      &lt;data&gt;
        &lt;record id="action_email_payslip" model="ir.actions.server"&gt;
        &lt;field name="name"&gt;Email&lt;/field&gt;
        &lt;field eval="2" name="sequence"/&gt;
        &lt;field name="view_mode"&gt;form&lt;/field&gt;
        &lt;field name="multi" eval="False"/&gt;
              &lt;field name="model_id" ref="hr_payroll.model_hr_payslip"/&gt; 
              &lt;field name="binding_model_id" ref="hr_payroll.model_hr_payslip"/&gt;
              &lt;field name="state"&gt;code&lt;/field&gt; 
              &lt;field name="code"&gt; 
              action = records.action_send_email() 
              &lt;/field&gt;
      &lt;/record&gt;
      &lt;/data&gt;
  &lt;/odoo&gt;
  </code></pre>
  
  <p>In the model my code is like this</p>
  
  <p>from odoo import models, fields, api, _</p>
  
  <pre><code>class EmailPayslip(models.Model):
      _inherit = 'hr.payslip'
  
      @api.multi
      def action_send_email(self):
  
          selected_employess = []
          not_selected_employees = []
  
          for payslip in self:
            try:
              lang = payslip.employee_id.user_id.lang
              template.with_context(lang=lang).send_mail(
                  self.env.user.id, force_send=True, raise_exception=True
              )
              selected_employess.append(payslip.name)
            except Exception as e:
              not_selected_employees.append(payslip.name)
  
          print(selected_employess)
  </code></pre>
  
  <p>But its showing error like</p>
  
  <pre><code>ValueError: Expected singleton: %s" % record
  </code></pre>
  
  <p>ValueError: Expected singleton: hr.payslip(1, 3, 4)</p>
  
  <p>Can someone tell me what I a doing wrong here and how to fix this?
  Any help and suggestions will be really appreciable.</p>
  
  <p>Regards,</p>