diff --git a/web_access_rule_buttons/models/models.py b/web_access_rule_buttons/models/models.py index 7f46fdeb2..ed43cb817 100644 --- a/web_access_rule_buttons/models/models.py +++ b/web_access_rule_buttons/models/models.py @@ -5,12 +5,12 @@ from odoo import exceptions, models class Base(models.AbstractModel): - """ The base model, which is implicitly inherited by all models. """ + """The base model, which is implicitly inherited by all models.""" _inherit = "base" def check_access_rule_all(self, operations=None): - """ Verifies that the operation given by ``operations`` is allowed for + """Verifies that the operation given by ``operations`` is allowed for the user according to ir.rules. If ``operations`` is empty, it returns the result for all actions. diff --git a/web_access_rule_buttons/tests/test_access_rule_buttons.py b/web_access_rule_buttons/tests/test_access_rule_buttons.py index 0708507d1..2f4c1408c 100644 --- a/web_access_rule_buttons/tests/test_access_rule_buttons.py +++ b/web_access_rule_buttons/tests/test_access_rule_buttons.py @@ -16,11 +16,11 @@ class TestAccessRuleButtons(TransactionCase): def test_check_access_rule_2(self): res = self.curr_record.check_access_rule_all(["write"]) - self.assertTrue(res["write"]) + self.assertFalse(res["write"]) def test_check_access_rule_3(self): res = self.curr_record.check_access_rule_all() - self.assertTrue(res["read"]) + self.assertFalse(res["read"]) self.assertTrue(res["create"]) self.assertTrue(res["write"]) self.assertTrue(res["unlink"]) diff --git a/web_company_color/models/assetsbundle.py b/web_company_color/models/assetsbundle.py index d6c31c2be..2f2ce0083 100644 --- a/web_company_color/models/assetsbundle.py +++ b/web_company_color/models/assetsbundle.py @@ -5,7 +5,7 @@ from odoo.addons.base.models.assetsbundle import AssetsBundle, ScssStylesheetAss class AssetsBundleCompanyColor(AssetsBundle): def get_company_color_asset_node(self): - """ Process the user active company scss and returns the node to inject """ + """Process the user active company scss and returns the node to inject""" company_id = self.env["res.company"].browse( self.env.context.get("active_company_id", 0) ) diff --git a/web_company_color/models/ir_qweb.py b/web_company_color/models/ir_qweb.py index 956f9964f..f43c5aace 100644 --- a/web_company_color/models/ir_qweb.py +++ b/web_company_color/models/ir_qweb.py @@ -64,7 +64,7 @@ class QWeb(models.AbstractModel): @api.model def _render(self, id_or_xml_id, values=None, **options): - """ Adds the active company to the context """ + """Adds the active company to the context""" try: active_company_id = int( request.httprequest.cookies.get("cids", "").split(",")[0] @@ -79,7 +79,7 @@ class QWeb(models.AbstractModel): return super()._render(id_or_xml_id, values=values, **options) def _get_asset_content(self, xmlid, options): - """ Handle 'special' web_company_color xmlid """ + """Handle 'special' web_company_color xmlid""" if xmlid == "web_company_color.company_color_assets": asset = AssetsBundleCompanyColor(xmlid, [], env=self.env) return ([], [asset.get_company_color_asset_node()])