Specifying the login user sale team as domain parameter is not possible but there is another way in which we can achieve this. ie; in my view action i specify the domain as:
<field name="domain">[('user_id.default_section_id', 'in', user_sale_team())]</field>
where user_id is the responsible user of the task. Now inherit read function of ir.actions.act_window and check if user_sale_team() is present in the domain of read result and replace this with the login user sale team id. This can be done as:
class ir_action_window(osv.osv):
_inherit = 'ir.actions.act_window'
def read(self, cr, uid, ids, fields=None, context=None, load='_classic_read'):
user_pool = self.pool.get('res.users')
obj_user = user_pool.browse(cr, uid, uid, context=context)
res = super(ir_action_window, self).read(cr, uid, ids, fields=fields, context=context, load=load)
if not isinstance(res, list):
res = [res]
sale_team_id = obj_user.default_section_id and obj_user.default_section_id.id or''
for r in res:
mystring = 'user_sale_team()'
if mystring in (r.get('domain', '[]') or ''):
r['domain'] = r['domain'].replace(mystring, str([sale_team_id]))
if isinstance(ids, (int, long)):
if res:
return res[0]
else:
return False
return res
ir_action_window()
This filters the result of the task to be displayed to each user based on his/her sale team.
Hope this helps.....