mirror of
https://github.com/OCA/web.git
synced 2025-02-22 13:21:25 +02:00
[IMP] web_responsive: Possibility of putting the chatter in the right (#951)
This commit is contained in:
committed by
Sergey Shebanin
parent
e9f87d9ce4
commit
e00d61569f
5
web_responsive/models/__init__.py
Normal file
5
web_responsive/models/__init__.py
Normal file
@@ -0,0 +1,5 @@
|
||||
# Copyright 2018 Alexandre Díaz
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from . import inherited_res_users
|
||||
from . import ir_http
|
||||
13
web_responsive/models/inherited_res_users.py
Normal file
13
web_responsive/models/inherited_res_users.py
Normal file
@@ -0,0 +1,13 @@
|
||||
# Copyright 2018 Alexandre Díaz
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import models, fields
|
||||
|
||||
|
||||
class ResUsers(models.Model):
|
||||
_inherit = 'res.users'
|
||||
|
||||
chatter_position = fields.Selection([
|
||||
('normal', 'Normal'),
|
||||
('sided', 'Sided'),
|
||||
], string="Chatter Position", default='normal')
|
||||
16
web_responsive/models/ir_http.py
Normal file
16
web_responsive/models/ir_http.py
Normal file
@@ -0,0 +1,16 @@
|
||||
# Copyright 2018 Alexandre Díaz
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import models
|
||||
from odoo.http import request
|
||||
|
||||
|
||||
class Http(models.AbstractModel):
|
||||
_inherit = 'ir.http'
|
||||
|
||||
def session_info(self):
|
||||
res = super(Http, self).session_info()
|
||||
res.update({
|
||||
'chatter_position': request.env.user.chatter_position or 'normal',
|
||||
})
|
||||
return res
|
||||
Reference in New Issue
Block a user