From d8b68e0f1ffc4f8a022de7db9729c70eff6fedbf Mon Sep 17 00:00:00 2001 From: Bernat Puig Font Date: Wed, 22 Dec 2021 10:45:03 +0100 Subject: [PATCH] [IMP] web_company_color: black, isort, prettier --- setup/web_company_color/odoo/addons/web_company_color | 1 + setup/web_company_color/setup.py | 6 ++++++ web_company_color/models/assetsbundle.py | 2 +- web_company_color/models/ir_qweb.py | 4 ++-- 4 files changed, 10 insertions(+), 3 deletions(-) create mode 120000 setup/web_company_color/odoo/addons/web_company_color create mode 100644 setup/web_company_color/setup.py diff --git a/setup/web_company_color/odoo/addons/web_company_color b/setup/web_company_color/odoo/addons/web_company_color new file mode 120000 index 000000000..ba46d5db5 --- /dev/null +++ b/setup/web_company_color/odoo/addons/web_company_color @@ -0,0 +1 @@ +../../../../web_company_color \ No newline at end of file diff --git a/setup/web_company_color/setup.py b/setup/web_company_color/setup.py new file mode 100644 index 000000000..28c57bb64 --- /dev/null +++ b/setup/web_company_color/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) 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()])