[FIX] pre-commit issue

pull/1944/head
Urvisha-OSI 2022-10-31 12:11:23 +05:30
parent c0a8177b19
commit 38fc25b3fd
5 changed files with 2813 additions and 2139 deletions

View File

@ -46,7 +46,7 @@ repos:
- --remove-duplicate-keys - --remove-duplicate-keys
- --remove-unused-variables - --remove-unused-variables
- repo: https://github.com/psf/black - repo: https://github.com/psf/black
rev: 20.8b1 rev: 22.3.0
hooks: hooks:
- id: black - id: black
- repo: https://github.com/pre-commit/mirrors-prettier - repo: https://github.com/pre-commit/mirrors-prettier

View File

@ -5,7 +5,7 @@ from odoo import exceptions, models
class Base(models.AbstractModel): 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" _inherit = "base"

View File

@ -5,7 +5,7 @@ from odoo.addons.base.models.assetsbundle import AssetsBundle, ScssStylesheetAss
class AssetsBundleCompanyColor(AssetsBundle): class AssetsBundleCompanyColor(AssetsBundle):
def get_company_color_asset_node(self): 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( company_id = self.env["res.company"].browse(
self.env.context.get("active_company_id", 0) self.env.context.get("active_company_id", 0)
) )

View File

@ -64,7 +64,7 @@ class QWeb(models.AbstractModel):
@api.model @api.model
def _render(self, id_or_xml_id, values=None, **options): 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: try:
active_company_id = int( active_company_id = int(
request.httprequest.cookies.get("cids", "").split(",")[0] 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) return super()._render(id_or_xml_id, values=values, **options)
def _get_asset_content(self, xmlid, 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": if xmlid == "web_company_color.company_color_assets":
asset = AssetsBundleCompanyColor(xmlid, [], env=self.env) asset = AssetsBundleCompanyColor(xmlid, [], env=self.env)
return ([], [asset.get_company_color_asset_node()]) return ([], [asset.get_company_color_asset_node()])

File diff suppressed because it is too large Load Diff