diff --git a/web_responsive/__manifest__.py b/web_responsive/__manifest__.py index afcfa70b6..80618bcd3 100644 --- a/web_responsive/__manifest__.py +++ b/web_responsive/__manifest__.py @@ -8,22 +8,14 @@ "version": "13.0.1.0.0", "category": "Website", "website": "https://github.com/OCA/web", - "author": "LasLabs, Tecnativa, " - "Odoo Community Association (OCA)", + "author": "LasLabs, Tecnativa, " "Odoo Community Association (OCA)", "license": "LGPL-3", "installable": True, - "depends": [ - 'web', - 'mail', - ], - "data": [ - 'views/assets.xml', - 'views/res_users.xml', - 'views/web.xml', - ], - 'qweb': [ - 'static/src/xml/apps.xml', - 'static/src/xml/form_view.xml', - 'static/src/xml/navbar.xml', + "depends": ["web", "mail"], + "data": ["views/assets.xml", "views/res_users.xml", "views/web.xml"], + "qweb": [ + "static/src/xml/apps.xml", + "static/src/xml/form_view.xml", + "static/src/xml/navbar.xml", ], } diff --git a/web_responsive/models/res_users.py b/web_responsive/models/res_users.py index 8075e039f..035b5be8a 100644 --- a/web_responsive/models/res_users.py +++ b/web_responsive/models/res_users.py @@ -1,16 +1,17 @@ # Copyright 2018-2019 Alexandre Díaz # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import models, fields +from odoo import fields, models class ResUsers(models.Model): - _inherit = 'res.users' + _inherit = "res.users" - chatter_position = fields.Selection([ - ('normal', 'Normal'), - ('sided', 'Sided'), - ], string="Chatter Position", default='sided') + chatter_position = fields.Selection( + [("normal", "Normal"), ("sided", "Sided")], + string="Chatter Position", + default="sided", + ) def __init__(self, pool, cr): """ Override of __init__ to add access rights. @@ -20,7 +21,7 @@ class ResUsers(models.Model): 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(['chatter_position']) + type(self).SELF_WRITEABLE_FIELDS.extend(["chatter_position"]) # duplicate list to avoid modifying the original reference type(self).SELF_READABLE_FIELDS = list(self.SELF_READABLE_FIELDS) - type(self).SELF_READABLE_FIELDS.extend(['chatter_position']) + type(self).SELF_READABLE_FIELDS.extend(["chatter_position"]) diff --git a/web_responsive/tests/test_res_users.py b/web_responsive/tests/test_res_users.py index 872a6c5a4..90fa17ba4 100644 --- a/web_responsive/tests/test_res_users.py +++ b/web_responsive/tests/test_res_users.py @@ -5,12 +5,9 @@ from odoo.tests import common class TestResUsers(common.TransactionCase): - def test_chatter_position_wr(self): - user_public = self.env.ref('base.public_user') + user_public = self.env.ref("base.public_user") - self.assertEqual(user_public.chatter_position, 'sided') - user_public.sudo(user_public).write({ - 'chatter_position': 'normal', - }) - self.assertEqual(user_public.chatter_position, 'normal') + self.assertEqual(user_public.chatter_position, "sided") + user_public.sudo(user_public).write({"chatter_position": "normal"}) + self.assertEqual(user_public.chatter_position, "normal")