diff options
| author | Nicolas Martinelli <nim@odoo.com> | 2018-08-21 13:54:08 +0200 |
|---|---|---|
| committer | Nicolas Martinelli <nim-odoo@users.noreply.github.com> | 2018-08-21 14:46:11 +0200 |
| commit | 65c2a9b70c4313af8bf80ee633e55e176df8baf0 (patch) | |
| tree | b53422895eb7fa113aa404a92bd1b329007bfae0 /addons | |
| parent | f46761caa8b815aea7c3089f928dcc494f124b08 (diff) | |
[FIX] sales_team: default team is active
Check the default team is active. Moreover, make the return object type
consistent.
opw-1876966
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/sales_team/models/crm_team.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/sales_team/models/crm_team.py b/addons/sales_team/models/crm_team.py index ecfcecfd587..180e2879cdd 100644 --- a/addons/sales_team/models/crm_team.py +++ b/addons/sales_team/models/crm_team.py @@ -37,8 +37,8 @@ class CrmTeam(models.Model): try: default_team_id.check_access_rule('read') except AccessError: - return False - if self.env.context.get('default_type') != 'lead' or default_team_id.use_leads: + return self.env['crm.team'] + if self.env.context.get('default_type') != 'lead' or default_team_id.use_leads and default_team_id.active: team_id = default_team_id return team_id |
