parameters: (self, work_days=1, log=True)
return_statement: return {
              'type': 'ir.actions.client',
              'tag': 'display_notification',
              'params': {
                  'type': 'success',
                  'title': _("Leads Assigned"),
                  'message': notif_message,
                  'next': {
                      'type': 'ir.actions.act_window_close'
                  },
              }
          }
docstring: Manual (direct) leads assignment. This method both
  
            * assigns leads to teams given by self;
            * assigns leads to salespersons belonging to self;
  
          See sub methods for more details about assign process.
  
          :param float work_days: number of work days to consider when assigning leads
            to teams or salespersons. We consider that Member.assignment_max (or
            its equivalent on team model) targets 30 work days. We make a ratio
            between expected number of work days and maximum assignment for those
            30 days to know lead count to assign.
  
          :return action: a client notification giving some insights on assign
            process;
docstring_summary: Manual (direct) leads assignment. This method both
docstring_tokens: Manual ( direct ) leads assignment . This method both
function: def action_assign_leads(self, work_days=1, log=True):
          """ Manual (direct) leads assignment. This method both
  
            * assigns leads to teams given by self;
            * assigns leads to salespersons belonging to self;
  
          See sub methods for more details about assign process.
  
          :param float work_days: number of work days to consider when assigning leads
            to teams or salespersons. We consider that Member.assignment_max (or
            its equivalent on team model) targets 30 work days. We make a ratio
            between expected number of work days and maximum assignment for those
            30 days to know lead count to assign.
  
          :return action: a client notification giving some insights on assign
            process;
          """
          teams_data, members_data = self._action_assign_leads(work_days=work_days)
  
          # format result messages
          logs = self._action_assign_leads_logs(teams_data, members_data)
          html_message = '<br />'.join(logs)
          notif_message = ' '.join(logs)
  
          # log a note in case of manual assign (as this method will mainly be called
          # on singleton record set, do not bother doing a specific message per team)
          log_action = _("Lead Assignment requested by %(user_name)s", user_name=self.env.user.name)
          log_message = "<p>%s<br /><br />%s</p>" % (log_action, html_message)
          self._message_log_batch(bodies=dict((team.id, log_message) for team in self))
  
          return {
              'type': 'ir.actions.client',
              'tag': 'display_notification',
              'params': {
                  'type': 'success',
                  'title': _("Leads Assigned"),
                  'message': notif_message,
                  'next': {
                      'type': 'ir.actions.act_window_close'
                  },
              }
          }
function_tokens: def action_assign_leads ( self , work_days = 1 , log = True ) : teams_data , members_data = self . _action_assign_leads ( work_days = work_days ) # format result messages logs = self . _action_assign_leads_logs ( teams_data , members_data ) html_message = '<br />' . join ( logs ) notif_message = ' ' . join ( logs ) # log a note in case of manual assign (as this method will mainly be called # on singleton record set, do not bother doing a specific message per team) log_action = _ ( "Lead Assignment requested by %(user_name)s" , user_name = self . env . user . name ) log_message = "<p>%s<br /><br />%s</p>" % ( log_action , html_message ) self . _message_log_batch ( bodies = dict ( ( team . id , log_message ) for team in self ) ) return { 'type' : 'ir.actions.client' , 'tag' : 'display_notification' , 'params' : { 'type' : 'success' , 'title' : _ ( "Leads Assigned" ) , 'message' : notif_message , 'next' : { 'type' : 'ir.actions.act_window_close' } , } }