Merge lp:~openerp-dev/openobject-addons/6.1-opw-574367-dhs into lp:openobject-addons/6.1

Proposed by Dhruti Shastri(OpenERP)
Status: Approved
Approved by: Naresh(OpenERP)
Approved revision: 6833
Proposed branch: lp:~openerp-dev/openobject-addons/6.1-opw-574367-dhs
Merge into: lp:openobject-addons/6.1
Diff against target: 43 lines (+27/-0)
1 file modified
crm/crm.py (+27/-0)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.1-opw-574367-dhs
Reviewer Review Type Date Requested Status
Naresh(OpenERP) (community) Approve
Review via email: mp+108925@code.launchpad.net

Description of the change

To reproduce:
 - install SALE and CRM
 - create a user and assigned the default team to him
 - enable extended view
 - go to Sales > Configuration > Sales > Sales Teams
 - open the default team

 Expected behaviour:
 - the team members list should contain the new user

 Current behaviour:
 - the team members is empty

To post a comment you must log in.
Revision history for this message
Naresh(OpenERP) (nch-openerp) :
review: Approve
Revision history for this message
Naresh(OpenERP) (nch-openerp) wrote :

Hello,

This bug was qualified as Not Relevant on Trunk (means that architecture on trunk has changed and so this bug has no meaning anymore). If this Merge Proposal could not be merged in v6.1 at the release of v7.0, it will be closed.

Thanks,

Unmerged revisions

6833. By Dhruti Shastri(OpenERP)

[crm] : User having with Sales Team is shown as member in SalesTeam (Case:574367)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'crm/crm.py'
2--- crm/crm.py 2012-03-08 15:58:35 +0000
3+++ crm/crm.py 2012-06-06 12:13:23 +0000
4@@ -125,6 +125,24 @@
5 (osv.osv._check_recursion, 'Error ! You cannot create recursive Sales team.', ['parent_id'])
6 ]
7
8+ def write(self, cr, uid, ids, vals, context=None):
9+ new_users = vals.get('member_ids',[])
10+ if new_users:
11+ user_obj = self.pool.get('res.users')
12+ old_users_ids = {}
13+ map(lambda x:old_users_ids.setdefault(x.id, x.member_ids), self.browse(cr, uid, ids, context=context))
14+ new_user = []
15+ if new_users[0][0] == 6 and new_users[0][2]:
16+ new_user = new_users[0][2]
17+ elif new_users[0][0] == 4 and new_users[0][1]:
18+ new_user = [new_users[0][1]]
19+ for id in ids:
20+ users = list (set(old_users_ids[id]).difference(set(new_user)))
21+ user_to_modify = map(lambda x:x.id, users)
22+ user_obj.write(cr, uid, user_to_modify, {'context_section_id':False}, context)
23+
24+ return super(crm_case_section, self).write(cr, uid, ids, vals, context=context)
25+
26 def name_get(self, cr, uid, ids, context=None):
27 """Overrides orm name_get method"""
28 if not isinstance(ids, list) :
29@@ -576,6 +594,15 @@
30 if vals.get('context_section_id'):
31 section_obj.write(cr, uid, [vals['context_section_id']], {'member_ids':[(4, res)]}, context)
32 return res
33+
34+ def write (self, cr, uid, ids, vals, context=None):
35+ res = super(users, self).write(cr, uid, ids, vals, context=context)
36+ section_obj=self.pool.get('crm.case.section')
37+ section_id = vals.get('context_section_id', False)
38+ if section_id:
39+ for id in ids:
40+ section_obj.write(cr, uid, [section_id], {'member_ids':[(4,id)]}, context)
41+ return res
42
43 users()
44