changes
This commit is contained in:
3
fusion_chatter_enhance/models/__init__.py
Normal file
3
fusion_chatter_enhance/models/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from . import ir_http
|
||||
from . import res_users
|
||||
18
fusion_chatter_enhance/models/ir_http.py
Normal file
18
fusion_chatter_enhance/models/ir_http.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2024-2026 Nexa Systems Inc.
|
||||
# License OPL-1
|
||||
|
||||
from odoo import models
|
||||
from odoo.http import request
|
||||
|
||||
|
||||
class IrHttp(models.AbstractModel):
|
||||
_inherit = 'ir.http'
|
||||
|
||||
def session_info(self):
|
||||
result = super().session_info()
|
||||
if request.session.uid:
|
||||
user = self.env.user
|
||||
result['chatter_position'] = user.chatter_position or 'side'
|
||||
result['chatter_hidden'] = user.chatter_hidden or False
|
||||
return result
|
||||
31
fusion_chatter_enhance/models/res_users.py
Normal file
31
fusion_chatter_enhance/models/res_users.py
Normal file
@@ -0,0 +1,31 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2024-2026 Nexa Systems Inc.
|
||||
# License OPL-1
|
||||
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class ResUsers(models.Model):
|
||||
_inherit = 'res.users'
|
||||
|
||||
chatter_position = fields.Selection(
|
||||
selection=[
|
||||
('side', 'Side (right of form)'),
|
||||
('bottom', 'Bottom (below form)'),
|
||||
],
|
||||
string='Chatter Position',
|
||||
default='side',
|
||||
)
|
||||
|
||||
chatter_hidden = fields.Boolean(
|
||||
string='Chatter Hidden',
|
||||
default=False,
|
||||
)
|
||||
|
||||
@property
|
||||
def SELF_READABLE_FIELDS(self):
|
||||
return super().SELF_READABLE_FIELDS + ['chatter_position', 'chatter_hidden']
|
||||
|
||||
@property
|
||||
def SELF_WRITEABLE_FIELDS(self):
|
||||
return super().SELF_WRITEABLE_FIELDS + ['chatter_position', 'chatter_hidden']
|
||||
Reference in New Issue
Block a user