parameters: (self, res_ids)
return_statement: return multi_mode and template_values or template_values[res_ids[0]]
docstring: Generate template-based values of wizard, for the document records given
          by res_ids. This method is meant to be inherited by email_template that
          will produce a more complete dictionary, using qweb templates.
  
          Each template is generated for all res_ids, allowing to parse the template
          once, and render it multiple times. This is useful for mass mailing where
          template rendering represent a significant part of the process.
  
          Default recipients are also computed, based on mail_thread method
          _message_get_default_recipients. This allows to ensure a mass mailing has
          always some recipients specified.
  
          :param browse wizard: current mail.compose.message browse record
          :param list res_ids: list of record ids
  
          :return dict results: for each res_id, the generated template values for
                                subject, body, email_from and reply_to
docstring_summary: Generate template-based values of wizard, for the document records given
          by res_ids. This method is meant to be inherited by email_template that
          will produce a more complete dictionary, using qweb templates.
docstring_tokens: Generate template - based values of wizard for the document records given by res_ids . This method is meant to be inherited by email_template that will produce a more complete dictionary using qweb templates .
function: def render_message(self, res_ids):
          """Generate template-based values of wizard, for the document records given
          by res_ids. This method is meant to be inherited by email_template that
          will produce a more complete dictionary, using qweb templates.
  
          Each template is generated for all res_ids, allowing to parse the template
          once, and render it multiple times. This is useful for mass mailing where
          template rendering represent a significant part of the process.
  
          Default recipients are also computed, based on mail_thread method
          _message_get_default_recipients. This allows to ensure a mass mailing has
          always some recipients specified.
  
          :param browse wizard: current mail.compose.message browse record
          :param list res_ids: list of record ids
  
          :return dict results: for each res_id, the generated template values for
                                subject, body, email_from and reply_to
          """
          self.ensure_one()
          multi_mode = True
          if isinstance(res_ids, int):
              multi_mode = False
              res_ids = [res_ids]
  
          subjects = self._render_field('subject', res_ids, options={"render_safe": True})
          bodies = self._render_field('body', res_ids, post_process=True)
          emails_from = self._render_field('email_from', res_ids)
          replies_to = self._render_field('reply_to', res_ids)
          default_recipients = {}
          if not self.partner_ids:
              records = self.env[self.model].browse(res_ids).sudo()
              default_recipients = records._message_get_default_recipients()
  
          results = dict.fromkeys(res_ids, False)
          for res_id in res_ids:
              results[res_id] = {
                  'subject': subjects[res_id],
                  'body': bodies[res_id],
                  'email_from': emails_from[res_id],
                  'reply_to': replies_to[res_id],
              }
              results[res_id].update(default_recipients.get(res_id, dict()))
  
          # generate template-based values
          if self.template_id:
              template_values = self.generate_email_for_composer(
                  self.template_id.id, res_ids,
                  ['email_to', 'partner_to', 'email_cc', 'attachment_ids', 'mail_server_id'])
          else:
              template_values = {}
  
          for res_id in res_ids:
              if template_values.get(res_id):
                  # recipients are managed by the template
                  results[res_id].pop('partner_ids', None)
                  results[res_id].pop('email_to', None)
                  results[res_id].pop('email_cc', None)
                  # remove attachments from template values as they should not be rendered
                  template_values[res_id].pop('attachment_ids', None)
              else:
                  template_values[res_id] = dict()
              # update template values by composer values
              template_values[res_id].update(results[res_id])
  
          return multi_mode and template_values or template_values[res_ids[0]]
function_tokens: def render_message ( self , res_ids ) : self . ensure_one ( ) multi_mode = True if isinstance ( res_ids , int ) : multi_mode = False res_ids = [ res_ids ] subjects = self . _render_field ( 'subject' , res_ids , options = { "render_safe" : True } ) bodies = self . _render_field ( 'body' , res_ids , post_process = True ) emails_from = self . _render_field ( 'email_from' , res_ids ) replies_to = self . _render_field ( 'reply_to' , res_ids ) default_recipients = { } if not self . partner_ids : records = self . env [ self . model ] . browse ( res_ids ) . sudo ( ) default_recipients = records . _message_get_default_recipients ( ) results = dict . fromkeys ( res_ids , False ) for res_id in res_ids : results [ res_id ] = { 'subject' : subjects [ res_id ] , 'body' : bodies [ res_id ] , 'email_from' : emails_from [ res_id ] , 'reply_to' : replies_to [ res_id ] , } results [ res_id ] . update ( default_recipients . get ( res_id , dict ( ) ) ) # generate template-based values if self . template_id : template_values = self . generate_email_for_composer ( self . template_id . id , res_ids , [ 'email_to' , 'partner_to' , 'email_cc' , 'attachment_ids' , 'mail_server_id' ] ) else : template_values = { } for res_id in res_ids : if template_values . get ( res_id ) : # recipients are managed by the template results [ res_id ] . pop ( 'partner_ids' , None ) results [ res_id ] . pop ( 'email_to' , None ) results [ res_id ] . pop ( 'email_cc' , None ) # remove attachments from template values as they should not be rendered template_values [ res_id ] . pop ( 'attachment_ids' , None ) else : template_values [ res_id ] = dict ( ) # update template values by composer values template_values [ res_id ] . update ( results [ res_id ] ) return multi_mode and template_values or template_values [ res_ids [ 0 ] ]