mirror of
https://github.com/guohuadeng/app-odoo.git
synced 2025-02-23 04:11:36 +02:00
fix #I8NJ48 app_web_fullwidth优化全局设置 置顶
This commit is contained in:
@@ -11,8 +11,19 @@ _logger = logging.getLogger(__name__)
|
||||
class ResConfigSettings(models.TransientModel):
|
||||
_inherit = 'res.config.settings'
|
||||
|
||||
# todo: 可能要设置为不同公司不同
|
||||
default_chatter_position = fields.Selection([
|
||||
("auto", "Responsive"),
|
||||
("bottom", "Bottom"),
|
||||
("sided", "Sided"),
|
||||
], string='Default Chatter Position', default="bottom", default_model="res.users")
|
||||
|
||||
def user_set_chatter_pos(self):
|
||||
# todo: 处理设置
|
||||
company_id = self.env.company.id
|
||||
users = self.env['res.users'].with_context(active_test=False).search([('company_id', '=', company_id)])
|
||||
if users:
|
||||
users.write({
|
||||
'chatter_position': self.default_chatter_position
|
||||
})
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user