forked from openlabs/nereid-project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
activity.py
40 lines (34 loc) · 996 Bytes
/
activity.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# -*- coding: utf-8 -*-
"""
activity
:copyright: (c) 2012-2014 by Openlabs Technologies & Consulting (P) Limited
:license: GPLv3, see LICENSE for more details.
"""
from trytond.model import fields
from trytond.pool import PoolMeta
from nereid import request
__all__ = ['Activity']
__metaclass__ = PoolMeta
class Activity:
'''
Nereid user activity
'''
__name__ = "nereid.activity"
project = fields.Many2One(
'project.work', 'Project', domain=[('type', '=', 'project')]
)
@classmethod
def get_activity_stream_domain(cls):
'''
Returns the domain to get activity stream of project where current user
is participant
'''
return [
'OR', [
('project.members.user', '=', request.nereid_user.id),
], [
('project.participants', '=', request.nereid_user.id)
], [
('actor', '=', request.nereid_user.id)
]
]