parameters: (self, opportunities)
return_statement: return True
docstring: Move history from the given opportunities to the current one. `self`
          is the crm.lead record destination for message of `opportunities`.
  
          This method moves
            * messages
            * activities
  
          :param opportunities: see ``_merge_dependences``
docstring_summary: Move history from the given opportunities to the current one. `self`
          is the crm.lead record destination for message of `opportunities`.
docstring_tokens: Move history from the given opportunities to the current one . self is the crm . lead record destination for message of opportunities .
function: def _merge_dependences_history(self, opportunities):
          """ Move history from the given opportunities to the current one. `self`
          is the crm.lead record destination for message of `opportunities`.
  
          This method moves
            * messages
            * activities
  
          :param opportunities: see ``_merge_dependences``
          """
          self.ensure_one()
          for opportunity in opportunities:
              for message in opportunity.message_ids:
                  if message.subject:
                      subject = _("From %(source_name)s : %(source_subject)s", source_name=opportunity.name, source_subject=message.subject)
                  else:
                      subject = _("From %(source_name)s", source_name=opportunity.name)
                  message.write({
                      'res_id': self.id,
                      'subject': subject,
                  })
  
          opportunities.activity_ids.write({
              'res_id': self.id,
          })
  
          return True
function_tokens: def _merge_dependences_history ( self , opportunities ) : self . ensure_one ( ) for opportunity in opportunities : for message in opportunity . message_ids : if message . subject : subject = _ ( "From %(source_name)s : %(source_subject)s" , source_name = opportunity . name , source_subject = message . subject ) else : subject = _ ( "From %(source_name)s" , source_name = opportunity . name ) message . write ( { 'res_id' : self . id , 'subject' : subject , } ) opportunities . activity_ids . write ( { 'res_id' : self . id , } ) return True