[init/add] generic backend theme
This commit is contained in:
2
muk_web_theme-19/muk_web_chatter/models/__init__.py
Normal file
2
muk_web_theme-19/muk_web_chatter/models/__init__.py
Normal file
@@ -0,0 +1,2 @@
|
||||
from . import ir_http
|
||||
from . import res_users
|
||||
15
muk_web_theme-19/muk_web_chatter/models/ir_http.py
Normal file
15
muk_web_theme-19/muk_web_chatter/models/ir_http.py
Normal file
@@ -0,0 +1,15 @@
|
||||
from odoo import models
|
||||
|
||||
|
||||
class IrHttp(models.AbstractModel):
|
||||
|
||||
_inherit = "ir.http"
|
||||
|
||||
#----------------------------------------------------------
|
||||
# Functions
|
||||
#----------------------------------------------------------
|
||||
|
||||
def session_info(self):
|
||||
result = super().session_info()
|
||||
result['chatter_position'] = self.env.user.chatter_position
|
||||
return result
|
||||
36
muk_web_theme-19/muk_web_chatter/models/res_users.py
Normal file
36
muk_web_theme-19/muk_web_chatter/models/res_users.py
Normal file
@@ -0,0 +1,36 @@
|
||||
from odoo import models, fields, api
|
||||
|
||||
|
||||
class ResUsers(models.Model):
|
||||
|
||||
_inherit = 'res.users'
|
||||
|
||||
#----------------------------------------------------------
|
||||
# Properties
|
||||
#----------------------------------------------------------
|
||||
|
||||
@property
|
||||
def SELF_READABLE_FIELDS(self):
|
||||
return super().SELF_READABLE_FIELDS + [
|
||||
'chatter_position',
|
||||
]
|
||||
|
||||
@property
|
||||
def SELF_WRITEABLE_FIELDS(self):
|
||||
return super().SELF_WRITEABLE_FIELDS + [
|
||||
'chatter_position',
|
||||
]
|
||||
|
||||
#----------------------------------------------------------
|
||||
# Fields
|
||||
#----------------------------------------------------------
|
||||
|
||||
chatter_position = fields.Selection(
|
||||
selection=[
|
||||
('side', 'Side'),
|
||||
('bottom', 'Bottom'),
|
||||
],
|
||||
string="Chatter Position",
|
||||
default='side',
|
||||
required=True,
|
||||
)
|
||||
Reference in New Issue
Block a user