Skip to content

Commit 133cffa

Browse files
committed
[IMP] update dotfiles
1 parent 7ea7189 commit 133cffa

File tree

42 files changed

+135
-133
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+135
-133
lines changed

.copier-answers.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
# Do NOT update manually; changes here will be overwritten by Copier
2-
_commit: v1.5.1
2+
_commit: v1.5.2
33
_src_path: gh:oca/oca-addons-repo-template
44
ci: GitHub
55
dependency_installation_mode: PIP
66
generate_requirements_txt: true
77
include_wkhtmltopdf: true
88
odoo_version: 14.0
9+
org_name: Odoo Community Association (OCA)
10+
org_slug: OCA
911
rebel_module_groups:
1012
- fetchmail_incoming_log,fetchmail_notify_error_to_sender_test,fetchmail_notify_error_to_sender
1113
repo_description: This project aims to deal with modules related to manage Odoo server
1214
environment and provide useful tools.
1315
repo_name: Tools for server environment(s)
1416
repo_slug: server-tools
17+
repo_website: https://github.com/OCA/server-tools
1518
travis_apt_packages: []
1619
travis_apt_sources: []

.eslintrc.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ env:
44

55
# See https://github.com/OCA/odoo-community.org/issues/37#issuecomment-470686449
66
parserOptions:
7-
ecmaVersion: 2017
7+
ecmaVersion: 2019
88

99
overrides:
1010
- files:

.github/workflows/pre-commit.yml

+5-7
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,19 @@ name: pre-commit
22

33
on:
44
pull_request:
5+
branches:
6+
- "14.0*"
57
push:
8+
branches:
9+
- "14.0"
10+
- "14.0-ocabot-*"
611

712
jobs:
813
pre-commit:
914
runs-on: ubuntu-latest
1015
steps:
1116
- uses: actions/checkout@v2
1217
- uses: actions/setup-python@v2
13-
with:
14-
# The pylint-odoo version we use here does not support python 3.10
15-
# https://github.com/OCA/oca-addons-repo-template/issues/80
16-
# We also need to pin to an older version of python for older odoo versions
17-
# where we are not using black > 21. Older black versions won't work with
18-
# Python 3.9.8+, and we can't bump black without reformatting.
19-
python-version: "3.9.7"
2018
- name: Get python version
2119
run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
2220
- uses: actions/cache@v1

.github/workflows/test.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ on:
66
- "14.0*"
77
push:
88
branches:
9-
- "14.0*"
9+
- "14.0"
10+
- "14.0-ocabot-*"
1011

1112
jobs:
1213
unreleased-deps:

.pre-commit-config.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ repos:
4646
- --remove-duplicate-keys
4747
- --remove-unused-variables
4848
- repo: https://github.com/psf/black
49-
rev: 20.8b1
49+
rev: 22.3.0
5050
hooks:
5151
- id: black
5252
- repo: https://github.com/pre-commit/mirrors-prettier
@@ -120,7 +120,7 @@ repos:
120120
name: flake8
121121
additional_dependencies: ["flake8-bugbear==20.1.4"]
122122
- repo: https://github.com/PyCQA/pylint
123-
rev: pylint-2.5.3
123+
rev: v2.11.1
124124
hooks:
125125
- id: pylint
126126
name: pylint with optional checks
@@ -129,7 +129,7 @@ repos:
129129
- --exit-zero
130130
verbose: true
131131
additional_dependencies: &pylint_deps
132-
- pylint-odoo==3.5.0
132+
- pylint-odoo==5.0.5
133133
- id: pylint
134134
name: pylint with mandatory checks
135135
args:

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
[![Runboat](https://img.shields.io/badge/runboat-Try%20me-875A7B.png)](https://runboat.odoo-community.org/builds?repo=OCA/server-tools&target_branch=14.0)
23
[![Pre-commit Status](https://github.com/OCA/server-tools/actions/workflows/pre-commit.yml/badge.svg?branch=14.0)](https://github.com/OCA/server-tools/actions/workflows/pre-commit.yml?query=branch%3A14.0)
34
[![Build Status](https://github.com/OCA/server-tools/actions/workflows/test.yml/badge.svg?branch=14.0)](https://github.com/OCA/server-tools/actions/workflows/test.yml?query=branch%3A14.0)
@@ -82,12 +83,11 @@ addon | version | maintainers | summary
8283

8384
This repository is licensed under [AGPL-3.0](LICENSE).
8485

85-
However, each module can have a totally different license, as long as they adhere to OCA
86+
However, each module can have a totally different license, as long as they adhere to Odoo Community Association (OCA)
8687
policy. Consult each module's `__manifest__.py` file, which contains a `license` key
8788
that explains its license.
8889

8990
----
90-
9191
OCA, or the [Odoo Community Association](http://odoo-community.org/), is a nonprofit
9292
organization whose mission is to support the collaborative development of Odoo features
9393
and promote its widespread use.

auditlog/models/log.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class AuditlogLog(models.Model):
2727

2828
@api.model_create_multi
2929
def create(self, vals_list):
30-
""" Insert model_name and model_model field values upon creation. """
30+
"""Insert model_name and model_model field values upon creation."""
3131
for vals in vals_list:
3232
if not vals.get("model_id"):
3333
raise UserError(_("No model defined to create log."))

auditlog/tests/test_auditlog.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ def assert_values(self):
301301
self.assertEqual(self.auditlog_rule.model_model, "x_test.model")
302302

303303
def test_01_field_and_model_removal(self):
304-
""" Test field and model removal to check auditlog line persistence """
304+
"""Test field and model removal to check auditlog line persistence"""
305305
self.assert_values()
306306

307307
# Remove the field

auto_backup/tests/test_db_backup.py

+20-20
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def setUp(self):
3535

3636
@contextmanager
3737
def mock_assets(self):
38-
""" It provides mocked core assets """
38+
"""It provides mocked core assets"""
3939
self.path_join_val = "/this/is/a/path"
4040
with patch("%s.db" % model) as db:
4141
with patch("%s.os" % model) as os:
@@ -49,15 +49,15 @@ def mock_assets(self):
4949

5050
@contextmanager
5151
def patch_filtered_sftp(self, record):
52-
""" It patches filtered record and provides a mock """
52+
"""It patches filtered record and provides a mock"""
5353
with patch("%s.filtered" % class_name) as filtered:
5454
filtered.side_effect = [], [record]
5555
with patch("%s.backup_log" % class_name):
5656
with patch("%s.sftp_connection" % class_name):
5757
yield filtered
5858

5959
def new_record(self, method="sftp"):
60-
vals = {"name": u"Têst backup", "method": method, "days_to_keep": 1}
60+
vals = {"name": "Têst backup", "method": method, "days_to_keep": 1}
6161
if method == "sftp":
6262
vals.update(
6363
{
@@ -72,7 +72,7 @@ def new_record(self, method="sftp"):
7272
return self.Model.create(vals)
7373

7474
def test_compute_name_sftp(self):
75-
""" It should create proper SFTP URI """
75+
"""It should create proper SFTP URI"""
7676
rec_id = self.new_record()
7777
self.assertEqual(
7878
"sftp://%(user)s@%(host)s:%(port)s%(folder)s"
@@ -86,7 +86,7 @@ def test_compute_name_sftp(self):
8686
)
8787

8888
def test_check_folder(self):
89-
""" It should not allow recursive backups """
89+
"""It should not allow recursive backups"""
9090
rec_id = self.new_record("local")
9191
with self.assertRaises(UserError):
9292
rec_id.write(
@@ -98,7 +98,7 @@ def test_check_folder(self):
9898

9999
@patch("%s._" % model)
100100
def test_action_sftp_test_connection_success(self, _):
101-
""" It should raise connection succeeded warning """
101+
"""It should raise connection succeeded warning"""
102102
with patch("%s.sftp_connection" % class_name, new_callable=PropertyMock):
103103
rec_id = self.new_record()
104104
with self.assertRaises(UserError):
@@ -107,7 +107,7 @@ def test_action_sftp_test_connection_success(self, _):
107107

108108
@patch("%s._" % model)
109109
def test_action_sftp_test_connection_fail(self, _):
110-
""" It should raise connection fail warning """
110+
"""It should raise connection fail warning"""
111111
with patch(
112112
"%s.sftp_connection" % class_name, new_callable=PropertyMock
113113
) as conn:
@@ -118,15 +118,15 @@ def test_action_sftp_test_connection_fail(self, _):
118118
_.assert_called_once_with("Connection Test Failed!")
119119

120120
def test_action_backup_local(self):
121-
""" It should backup local database """
121+
"""It should backup local database"""
122122
rec_id = self.new_record("local")
123123
filename = rec_id.filename(datetime.now())
124124
rec_id.action_backup()
125125
generated_backup = [f for f in os.listdir(rec_id.folder) if f >= filename]
126126
self.assertEqual(1, len(generated_backup))
127127

128128
def test_action_backup_local_cleanup(self):
129-
""" Backup local database and cleanup old databases """
129+
"""Backup local database and cleanup old databases"""
130130
rec_id = self.new_record("local")
131131
old_date = datetime.now() - timedelta(days=3)
132132
filename = rec_id.filename(old_date)
@@ -142,7 +142,7 @@ def test_action_backup_local_cleanup(self):
142142
self.assertEqual(1, len(generated_backup))
143143

144144
def test_action_backup_sftp_mkdirs(self):
145-
""" It should create remote dirs """
145+
"""It should create remote dirs"""
146146
rec_id = self.new_record()
147147
with self.mock_assets():
148148
with self.patch_filtered_sftp(rec_id):
@@ -152,7 +152,7 @@ def test_action_backup_sftp_mkdirs(self):
152152
conn.makedirs.assert_called_once_with(rec_id.folder)
153153

154154
def test_action_backup_sftp_mkdirs_conn_exception(self):
155-
""" It should guard from ConnectionException on remote.mkdirs """
155+
"""It should guard from ConnectionException on remote.mkdirs"""
156156
rec_id = self.new_record()
157157
with self.mock_assets():
158158
with self.patch_filtered_sftp(rec_id):
@@ -164,7 +164,7 @@ def test_action_backup_sftp_mkdirs_conn_exception(self):
164164
self.assertTrue(True)
165165

166166
def test_action_backup_sftp_remote_open(self):
167-
""" It should open remote file w/ proper args """
167+
"""It should open remote file w/ proper args"""
168168
rec_id = self.new_record()
169169
with self.mock_assets() as assets:
170170
with self.patch_filtered_sftp(rec_id):
@@ -174,22 +174,22 @@ def test_action_backup_sftp_remote_open(self):
174174
conn.open.assert_called_once_with(assets["os"].path.join(), "wb")
175175

176176
def test_action_backup_all_search(self):
177-
""" It should search all records """
177+
"""It should search all records"""
178178
rec_id = self.new_record()
179179
with patch("%s.search" % class_name, new_callable=PropertyMock):
180180
rec_id.action_backup_all()
181181
rec_id.search.assert_called_once_with([])
182182

183183
def test_action_backup_all_return(self):
184-
""" It should return result of backup operation """
184+
"""It should return result of backup operation"""
185185
rec_id = self.new_record()
186186
with patch("%s.search" % class_name, new_callable=PropertyMock):
187187
res = rec_id.action_backup_all()
188188
self.assertEqual(rec_id.search().action_backup(), res)
189189

190190
@patch("%s.pysftp" % model)
191191
def test_sftp_connection_init_passwd(self, pysftp):
192-
""" It should initiate SFTP connection w/ proper args and pass """
192+
"""It should initiate SFTP connection w/ proper args and pass"""
193193
rec_id = self.new_record()
194194
rec_id.sftp_connection()
195195
pysftp.Connection.assert_called_once_with(
@@ -201,7 +201,7 @@ def test_sftp_connection_init_passwd(self, pysftp):
201201

202202
@patch("%s.pysftp" % model)
203203
def test_sftp_connection_init_key(self, pysftp):
204-
""" It should initiate SFTP connection w/ proper args and key """
204+
"""It should initiate SFTP connection w/ proper args and key"""
205205
rec_id = self.new_record()
206206
rec_id.write({"sftp_private_key": "pkey", "sftp_password": "pkeypass"})
207207
rec_id.sftp_connection()
@@ -215,7 +215,7 @@ def test_sftp_connection_init_key(self, pysftp):
215215

216216
@patch("%s.pysftp" % model)
217217
def test_sftp_connection_return(self, pysftp):
218-
""" It should return new sftp connection """
218+
"""It should return new sftp connection"""
219219
rec_id = self.new_record()
220220
res = rec_id.sftp_connection()
221221
self.assertEqual(
@@ -224,19 +224,19 @@ def test_sftp_connection_return(self, pysftp):
224224
)
225225

226226
def test_filename_default(self):
227-
""" It should not error and should return a .dump.zip file str """
227+
"""It should not error and should return a .dump.zip file str"""
228228
now = datetime.now()
229229
res = self.Model.filename(now)
230230
self.assertTrue(res.endswith(".dump.zip"))
231231

232232
def test_filename_zip(self):
233-
""" It should return a dump.zip filename"""
233+
"""It should return a dump.zip filename"""
234234
now = datetime.now()
235235
res = self.Model.filename(now, ext="zip")
236236
self.assertTrue(res.endswith(".dump.zip"))
237237

238238
def test_filename_dump(self):
239-
""" It should return a dump filename"""
239+
"""It should return a dump filename"""
240240
now = datetime.now()
241241
res = self.Model.filename(now, ext="dump")
242242
self.assertTrue(res.endswith(".dump"))

base_changeset/models/record_changeset_change.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ def get_new_value(self):
192192
return self[field_name]
193193

194194
def set_old_value(self):
195-
""" Copy the value of the record to the 'old' field """
195+
"""Copy the value of the record to the 'old' field"""
196196
for change in self:
197197
# copy the existing record's value for the history
198198
old_value_for_write = self._value_for_changeset(
@@ -261,7 +261,7 @@ def _check_previous_changesets(self, changeset):
261261
)
262262

263263
def cancel(self):
264-
""" Reject the change """
264+
"""Reject the change"""
265265
for change in self:
266266
if not change.user_can_validate_changeset:
267267
raise UserError(_("You don't have the rights to reject the changes."))

0 commit comments

Comments
 (0)