diff options
Diffstat (limited to 'backend_theme_v14/models')
| -rw-r--r-- | backend_theme_v14/models/__init__.py | 4 | ||||
| -rw-r--r-- | backend_theme_v14/models/res_company.py | 11 | ||||
| -rw-r--r-- | backend_theme_v14/models/res_users.py | 25 |
3 files changed, 40 insertions, 0 deletions
diff --git a/backend_theme_v14/models/__init__.py b/backend_theme_v14/models/__init__.py new file mode 100644 index 0000000..889e628 --- /dev/null +++ b/backend_theme_v14/models/__init__.py @@ -0,0 +1,4 @@ +# -*- coding: utf-8 -*- +from . import res_company +from . import res_users + diff --git a/backend_theme_v14/models/res_company.py b/backend_theme_v14/models/res_company.py new file mode 100644 index 0000000..5940bcc --- /dev/null +++ b/backend_theme_v14/models/res_company.py @@ -0,0 +1,11 @@ +# -*- coding: utf-8 -*- +# Copyright 2016, 2019 Openworx +# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). + +from odoo import models, fields + +class ResCompany(models.Model): + + _inherit = 'res.company' + + dashboard_background = fields.Binary(attachment=True)
\ No newline at end of file diff --git a/backend_theme_v14/models/res_users.py b/backend_theme_v14/models/res_users.py new file mode 100644 index 0000000..fd3ecd6 --- /dev/null +++ b/backend_theme_v14/models/res_users.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +# Copyright 2016, 2019 Openworx +# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). + +from odoo import models, fields + +class ResUsers(models.Model): + + _inherit = 'res.users' + + sidebar_visible = fields.Boolean("Show App Sidebar", default=True) + + def __init__(self, pool, cr): + """ Override of __init__ to add access rights on notification_email_send + and alias fields. Access rights are disabled by default, but allowed + on some specific fields defined in self.SELF_{READ/WRITE}ABLE_FIELDS. + """ + init_res = super(ResUsers, self).__init__(pool, cr) + # duplicate list to avoid modifying the original reference + type(self).SELF_WRITEABLE_FIELDS = list(self.SELF_WRITEABLE_FIELDS) + type(self).SELF_WRITEABLE_FIELDS.extend(['sidebar_visible']) + # duplicate list to avoid modifying the original reference + type(self).SELF_READABLE_FIELDS = list(self.SELF_READABLE_FIELDS) + type(self).SELF_READABLE_FIELDS.extend(['sidebar_visible']) + return init_res
\ No newline at end of file |
