Dhruti Shastri has proposed merging 
lp:~openerp-dev/openobject-addons/6.1-opw-574367-dhs into 
lp:openobject-addons/6.1.

Requested reviews:
  Naresh(OpenERP) (nch-openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/6.1-opw-574367-dhs/+merge/104247

o 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 defaut team

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

Current behavior:
- the team members is empty

At the time of loading view the user will be assigned to respective team.
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/6.1-opw-574367-dhs/+merge/104247
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/6.1-opw-574367-dhs.
=== modified file 'crm/crm.py'
--- crm/crm.py	2012-03-08 15:58:35 +0000
+++ crm/crm.py	2012-05-01 13:34:40 +0000
@@ -111,6 +111,17 @@
         ids = self.pool.get('crm.case.stage').search(cr, uid, [('case_default','=',1)], context=context)
         return ids
 
+    def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
+        res = super(crm_case_section, self).fields_view_get(cr, uid, view_id, view_type, context, toolbar)
+        salesteam_obj = self.pool.get('crm.case.section')
+        user_obj = self.pool.get('res.users')
+        sids = salesteam_obj.search(cr, uid , [])
+        for team in salesteam_obj.browse(cr, uid, sids,context):
+           user_data = user_obj.search(cr, uid, [('context_section_id','=', team.id)])
+           if user_data:
+               salesteam_obj.write(cr, uid, team.id, {'member_ids': [(6, 0, user_data)] }, context)
+        return res
+
     _defaults = {
         'active': lambda *a: 1,
         'allow_unlink': lambda *a: 1,

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to