Skip to content

Commit

Permalink
TA#71814 [IMP] [16.0] pre-commit : add black (#215)
Browse files Browse the repository at this point in the history
  • Loading branch information
rivo2302 authored Nov 19, 2024
1 parent 2f5e1f3 commit ffb8fcb
Show file tree
Hide file tree
Showing 43 changed files with 397 additions and 360 deletions.
4 changes: 4 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ default_language_version:
python: python3
node: "14.13.0"
repos:
- repo: https://github.com/psf/black
rev: 22.8.0
hooks:
- id: black
- repo: https://github.com/PyCQA/flake8
rev: 3.8.3
hooks:
Expand Down
1 change: 0 additions & 1 deletion admin_light_auditlog/tests/test_admin_light_access.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@


class TestAdminLightAccess(common.SavepointCase):

@classmethod
def setUpClass(cls):
super().setUpClass()
Expand Down
2 changes: 1 addition & 1 deletion admin_light_base/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"data": [
"security/res_groups.xml",
"security/ir.model.access.csv",
"views/menus.xml"
"views/menus.xml",
],
"installable": True,
"application": True,
Expand Down
26 changes: 13 additions & 13 deletions admin_light_company/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).

{
'name': 'Admin Light Company',
'version': '1.0.1',
'author': 'Numigi',
'maintainer': 'Numigi',
'license': 'LGPL-3',
'category': 'Other',
'summary': 'Add companies to the admin light application',
'depends': ['admin_light_base'],
'data': [
'security/res_groups.xml',
'security/ir.model.access.csv',
'views/menu.xml',
"name": "Admin Light Company",
"version": "1.0.1",
"author": "Numigi",
"maintainer": "Numigi",
"license": "LGPL-3",
"category": "Other",
"summary": "Add companies to the admin light application",
"depends": ["admin_light_base"],
"data": [
"security/res_groups.xml",
"security/ir.model.access.csv",
"views/menu.xml",
],
'installable': True,
"installable": True,
}
26 changes: 13 additions & 13 deletions admin_light_filters/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
# License AGPL-3 or later (http://www.gnu.org/licenses/lgpl).

{
'name': 'Admin Light Filters',
'version': "16.0.1.0.0",
'author': 'Numigi',
'maintainer': 'Numigi',
'license': 'AGPL-3',
'category': 'Other',
'summary': 'Add user-defined filter management to the Admin Light user',
'depends': ['admin_light_web', 'filter_multi_user'],
'data': [
'security/admin_light_security.xml',
'security/ir_filters_security.xml',
'views/ir_filters_views.xml',
"name": "Admin Light Filters",
"version": "16.0.1.0.0",
"author": "Numigi",
"maintainer": "Numigi",
"license": "AGPL-3",
"category": "Other",
"summary": "Add user-defined filter management to the Admin Light user",
"depends": ["admin_light_web", "filter_multi_user"],
"data": [
"security/admin_light_security.xml",
"security/ir_filters_security.xml",
"views/ir_filters_views.xml",
],
'installable': True,
"installable": True,
}
1 change: 0 additions & 1 deletion admin_light_filters/tests/test_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@


class TestPermission(TransactionCase):

@classmethod
def setUpClass(cls):
super().setUpClass()
Expand Down
1 change: 0 additions & 1 deletion admin_light_mail/tests/test_mail_template_access.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@


class TestMailTemplateAccess(TransactionCase):

@classmethod
def setUpClass(cls):
super().setUpClass()
Expand Down
2 changes: 1 addition & 1 deletion admin_light_mail_gmail/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"maintainer": "Numigi",
"website": "https://bit.ly/numigi-com",
"license": "AGPL-3",
'category': 'Other',
"category": "Other",
"depends": ["admin_light_mail", "google_gmail"],
"summary": """Extends Administration Light/Mail Servers rights to handle
`Google Gmail` configuration.""",
Expand Down
5 changes: 2 additions & 3 deletions admin_light_mail_outlook/models/microsoft_outlook_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@


class MicrosoftOutlookMixin(models.AbstractModel):
_inherit = 'microsoft.outlook.mixin'
_inherit = "microsoft.outlook.mixin"

microsoft_outlook_refresh_token = fields.Char(groups=AUTHORIZED_GROUPS)
microsoft_outlook_access_token = fields.Char(groups=AUTHORIZED_GROUPS)
microsoft_outlook_access_token_expiration = fields.Integer(
groups=AUTHORIZED_GROUPS)
microsoft_outlook_access_token_expiration = fields.Integer(groups=AUTHORIZED_GROUPS)
microsoft_outlook_uri = fields.Char(groups=AUTHORIZED_GROUPS)

def open_microsoft_outlook_uri(self):
Expand Down
35 changes: 17 additions & 18 deletions admin_light_user/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,28 @@
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).

{
'name': 'Admin Light User',
'version': '16.0.1.0.0',
'author': 'Numigi',
'maintainer': 'Numigi',
'license': 'LGPL-3',
'category': 'Other',
'summary': 'Add a group to manage user access.',
'depends': [
'admin_light_base',

"name": "Admin Light User",
"version": "16.0.1.0.0",
"author": "Numigi",
"maintainer": "Numigi",
"license": "LGPL-3",
"category": "Other",
"summary": "Add a group to manage user access.",
"depends": [
"admin_light_base",
# This module auth_signup is auto-installed on all clients.
# It is important that the module is installed before running
# tests because it may cause access errors when creating
# users by non-super-admin.
# See TA#6395
'auth_signup',
'base_extended_security',
"auth_signup",
"base_extended_security",
],
'data': [
'data/data.xml',
'security/ir.model.access.csv',
'security/extended_security_rule.xml',
'security/ir_rule.xml'
"data": [
"data/data.xml",
"security/ir.model.access.csv",
"security/extended_security_rule.xml",
"security/ir_rule.xml",
],
'installable': True,
"installable": True,
}
14 changes: 9 additions & 5 deletions admin_light_user/models/res_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,18 @@ def get_view(self, view_id=None, view_type="form", **options):

if view_type == "form" and view_id == view_user_form_id:
user = self.env.user
if user.has_group("base.group_erp_manager") :
if user.has_group("base.group_erp_manager"):
return res
elif user.has_group("admin_light_user.group_user_management") :
elif user.has_group("admin_light_user.group_user_management"):
arch = etree.XML(res["arch"])
_remove_admin_application_selection_fields(arch, self.env)
_remove_admin_application_checkbox_fields(arch, self.env)
_remove_separators_with_no_fields_below(arch)
res.update({
"arch" : etree.tostring(arch, pretty_print=True, encoding="unicode")
})
res.update(
{
"arch": etree.tostring(
arch, pretty_print=True, encoding="unicode"
)
}
)
return res
34 changes: 17 additions & 17 deletions admin_light_web/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).

{
'name': 'Admin Light Web',
'version': '16.0.1.0.0',
'author': 'Numigi',
'maintainer': 'Numigi',
'license': 'LGPL-3',
'category': 'Other',
'summary': 'Add email management to the Admin Light application.',
'depends': [
'admin_light_base',
'web_custom_label',
'web_search_date_range',
"name": "Admin Light Web",
"version": "16.0.1.0.0",
"author": "Numigi",
"maintainer": "Numigi",
"license": "LGPL-3",
"category": "Other",
"summary": "Add email management to the Admin Light application.",
"depends": [
"admin_light_base",
"web_custom_label",
"web_search_date_range",
],
'data': [
'views/common.xml',
'views/custom_labels.xml',
'views/date_filters.xml',
'security/ir.model.access.csv',
"data": [
"views/common.xml",
"views/custom_labels.xml",
"views/date_filters.xml",
"security/ir.model.access.csv",
],
'installable': True,
"installable": True,
}
6 changes: 3 additions & 3 deletions attachment_minio/models/ir_attachment.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ def _get_minio_bucket(self, client, name=None):
"Incorrect configuration of attachment_minio -- Missing bucket."
)
if not client.bucket_exists(bucket):
region = (
params.get_param("ir_attachment.location.region", "us-west-1")
or config.get("attachment_minio_region", "us-west-1"))
region = params.get_param(
"ir_attachment.location.region", "us-west-1"
) or config.get("attachment_minio_region", "us-west-1")
client.make_bucket(bucket, region)
return bucket

Expand Down
3 changes: 2 additions & 1 deletion base_extended_security/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"category": "Other",
"summary": "Securize access to records",
"depends": [
"web", "account",
"web",
"account",
],
"data": [
"security/ir.model.access.csv",
Expand Down
2 changes: 0 additions & 2 deletions base_extended_security/controllers/crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@


class DataSetWithExtendedSecurity(DataSet):

def _call_kw(self, model, method, args, kwargs):
verifier = _ExtendedSecurityVerifier(model, method, args, kwargs)
verifier.run_pre_request_checks()
Expand All @@ -20,7 +19,6 @@ def _call_kw(self, model, method, args, kwargs):


class _ExtendedSecurityVerifier:

def __init__(self, model, method, args, kwargs):
self._model = model
self._method = method
Expand Down
2 changes: 1 addition & 1 deletion base_extended_security/controllers/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
class DataSetWithExtendedSearchSecurity(DataSet):
"""Add extra security domains to search operations."""

@http.route('/web/dataset/search_read', type='json', auth="user")
@http.route("/web/dataset/search_read", type="json", auth="user")
def search_read(
self, model, fields=False, offset=0, limit=False, domain=None, sort=None
):
Expand Down
1 change: 0 additions & 1 deletion base_extended_security/controllers/web_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@


class ExportFormatWithSecurityDomain(ExportFormat):

def base(self, data):
params = json.loads(data)
record_ids = params.get("ids")
Expand Down
Loading

0 comments on commit ffb8fcb

Please sign in to comment.