parameters: (self)
return_statement: return to_slowdown
docstring: Badly named method that checks user logs and slowdown the sending
          of digest emails based on recipients being away.
docstring_summary: Badly named method that checks user logs and slowdown the sending
          of digest emails based on recipients being away.
docstring_tokens: Badly named method that checks user logs and slowdown the sending of digest emails based on recipients being away .
function: def _check_daily_logs(self):
          """ Badly named method that checks user logs and slowdown the sending
          of digest emails based on recipients being away. """
          today = datetime.now().replace(hour=0, minute=0, second=0, microsecond=0)
          to_slowdown = self.env['digest.digest']
          for digest in self:
              if digest.periodicity == 'daily':  # 3 days ago
                  limit_dt = today - relativedelta(days=3)
              elif digest.periodicity == 'weekly':  # 2 weeks ago
                  limit_dt = today - relativedelta(days=14)
              elif digest.periodicity == 'monthly':  # 1 month ago
                  limit_dt = today - relativedelta(months=1)
              elif digest.periodicity == 'quarterly':  # 3 month ago
                  limit_dt = today - relativedelta(months=3)
              users_logs = self.env['res.users.log'].sudo().search_count([
                  ('create_uid', 'in', digest.user_ids.ids),
                  ('create_date', '>=', limit_dt)
              ])
              if not users_logs:
                  to_slowdown += digest
          return to_slowdown
function_tokens: def _check_daily_logs ( self ) : today = datetime . now ( ) . replace ( hour = 0 , minute = 0 , second = 0 , microsecond = 0 ) to_slowdown = self . env [ 'digest.digest' ] for digest in self : if digest . periodicity == 'daily' : # 3 days ago limit_dt = today - relativedelta ( days = 3 ) elif digest . periodicity == 'weekly' : # 2 weeks ago limit_dt = today - relativedelta ( days = 14 ) elif digest . periodicity == 'monthly' : # 1 month ago limit_dt = today - relativedelta ( months = 1 ) elif digest . periodicity == 'quarterly' : # 3 month ago limit_dt = today - relativedelta ( months = 3 ) users_logs = self . env [ 'res.users.log' ] . sudo ( ) . search_count ( [ ( 'create_uid' , 'in' , digest . user_ids . ids ) , ( 'create_date' , '>=' , limit_dt ) ] ) if not users_logs : to_slowdown += digest return to_slowdown