diff options
| author | Denis Ledoux <dle@odoo.com> | 2014-12-11 13:21:18 +0100 |
|---|---|---|
| committer | Denis Ledoux <dle@odoo.com> | 2014-12-11 13:26:07 +0100 |
| commit | a69076851a1db8eaf29c29e762694dc03678e60a (patch) | |
| tree | 32a184c5ccdd8f6e5db128adeedcd2159241c426 /addons | |
| parent | 1263278b7437a00b007feb7ada896799731106f6 (diff) | |
[FIX] crm: do not assign a salesteam to a lead if not in multi sales team env
on_change_user was used to assign the first team in which the user is a member to the lead
When the user does not use the multi sales team, it therefore set a default sales team, but invisible to the user.
Stages displayed in the kanban view are the lead sales team stages. In a non sales team env, only stages with no stages are displayed for new leads
If you added a new stage, in the kanban view, the stage is not assigned to a team
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/crm/crm_lead.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py index 992e4f365ea..d142b4aa403 100644 --- a/addons/crm/crm_lead.py +++ b/addons/crm/crm_lead.py @@ -330,7 +330,7 @@ class crm_lead(format_address, osv.osv): """ When changing the user, also set a section_id or restrict section id to the ones user_id is member of. """ section_id = self._get_default_section_id(cr, uid, user_id=user_id, context=context) or False - if user_id and not section_id: + if user_id and self.pool['res.users'].has_group(cr, uid, 'base.group_multi_salesteams') and not section_id: section_ids = self.pool.get('crm.case.section').search(cr, uid, ['|', ('user_id', '=', user_id), ('member_ids', '=', user_id)], context=context) if section_ids: section_id = section_ids[0] |
