Files
tryton/modules/dashboard/res.py
T

30 lines
912 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.
2012-09-24 22:17:54 +02:00
from trytond.model import fields
from trytond.pool import PoolMeta
2009-12-23 00:04:42 +01:00
2018-06-26 19:11:47 +02:00
class User(metaclass=PoolMeta):
2012-09-24 22:17:54 +02:00
__name__ = "res.user"
2009-12-23 00:04:42 +01:00
dashboard_layout = fields.Selection([
('square', 'Square'),
('stack_right', 'Stack Right'),
('stack_left', 'Stack Left'),
('stack_top', 'Stack Top'),
('stack_bottom', 'Stack Bottom'),
], string='Dashboard Layout')
2009-12-23 00:04:42 +01:00
dashboard_actions = fields.One2Many('dashboard.action', 'user',
'Dashboard Actions')
2012-09-24 22:17:54 +02:00
@classmethod
def __setup__(cls):
super(User, cls).__setup__()
cls._preferences_fields += [
2009-12-23 00:04:42 +01:00
'dashboard_layout',
'dashboard_actions',
2012-09-24 22:17:54 +02:00
]
2009-12-23 00:04:42 +01:00
2012-09-24 22:17:54 +02:00
@staticmethod
def default_dashboard_layout():
2009-12-23 00:04:42 +01:00
return 'square'