Files
tryton/modules/dashboard/dashboard.py
T

23 lines
948 B
Python
Raw Normal View History

2014-12-02 12:55:19 +01:00
# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
2016-09-13 14:06:36 +02:00
from trytond.model import ModelView, ModelSQL, fields, sequence_ordered
2013-02-04 19:56:02 +01:00
from trytond.pyson import Eval
2009-12-23 00:04:42 +01:00
2012-09-24 22:17:54 +02:00
2020-03-01 12:33:52 +01:00
class Action(sequence_ordered(), ModelSQL, ModelView):
2009-12-23 00:04:42 +01:00
"Dashboard Action"
2012-09-24 22:17:54 +02:00
__name__ = "dashboard.action"
2009-12-23 00:04:42 +01:00
user = fields.Many2One('res.user', 'User', required=True,
2012-03-05 10:53:02 +01:00
select=True)
2009-12-23 00:04:42 +01:00
act_window = fields.Many2One('ir.action.act_window', 'Action',
required=True, ondelete='CASCADE', domain=[
2012-03-27 10:43:36 +02:00
('res_model', '!=', None),
('res_model', '!=', ''),
2012-12-23 17:44:43 +01:00
('usage', '=', 'dashboard'),
2013-02-04 19:56:02 +01:00
# XXX copy ir.action rule to prevent access rule error
['OR',
('groups', 'in', Eval('context', {}).get('groups', [])),
('groups', '=', None),
],
])