Skip to content

Commit

Permalink
Merge PR #368 into 17.0
Browse files Browse the repository at this point in the history
Signed-off-by pedrobaeza
  • Loading branch information
OCA-git-bot committed May 2, 2024
2 parents a9e3bbf + e886c85 commit d011b2c
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Do NOT update manually; changes here will be overwritten by Copier
_commit: v1.19
_commit: v1.21.1
_src_path: gh:oca/oca-addons-repo-template
additional_ruff_rules: []
ci: GitHub
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Stale PRs and issues policy
uses: actions/stale@v4
uses: actions/stale@v9
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
# General settings.
Expand Down Expand Up @@ -48,7 +48,7 @@ jobs:
# * Issues that are pending more information
# * Except Issues marked as "no stale"
- name: Needs more information stale issues policy
uses: actions/stale@v4
uses: actions/stale@v9
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
ascending: true
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ jobs:
run: oca_init_test_database
- name: Run tests
run: oca_run_tests
- uses: codecov/codecov-action@v1
- uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Update .pot files
run: oca_export_and_push_pot https://x-access-token:${{ secrets.GIT_PUSH_TOKEN }}@github.com/${{ github.repository }}
if: ${{ matrix.makepot == 'true' && github.event_name == 'push' && github.repository_owner == 'OCA' }}
6 changes: 4 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ exclude: |
readme/.*\.(rst|md)$|
# Ignore build and dist directories in addons
/build/|/dist/|
# Ignore test files in addons
/tests/samples/.*|
# You don't usually want a bot to modify your legal texts
(LICENSE.*|COPYING.*)
default_language_version:
Expand All @@ -41,7 +43,7 @@ repos:
hooks:
- id: whool-init
- repo: https://github.com/oca/maintainer-tools
rev: f71041f22b8cd68cf7c77b73a14ca8d8cd190a60
rev: 9a170331575a265c092ee6b24b845ec508e8ef75
hooks:
# update the NOT INSTALLABLE ADDONS section above
- id: oca-update-pre-commit-excluded-addons
Expand Down Expand Up @@ -110,7 +112,7 @@ repos:
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format
- repo: https://github.com/OCA/pylint-odoo
rev: v8.0.19
rev: v9.0.4
hooks:
- id: pylint_odoo
name: pylint with optional checks
Expand Down
1 change: 1 addition & 0 deletions .ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ fix = true
extend-select = [
"B",
"C90",
"E501", # line too long (default 88)
"I", # isort
"UP", # pyupgrade
]
Expand Down
10 changes: 7 additions & 3 deletions fs_attachment/models/ir_attachment.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,8 @@ def write(self, vals):
# nor the mimetype, so the mimetype will be set to ``application/octet-
# stream``.
# We want to avoid this, so we take the mimetype of the first attachment
# and we set it on all the attachments if they all have the same mimetype.
# and we set it on all the attachments if they all have the same
# mimetype.
# If they don't have the same mimetype, we raise an error.
# OPW-3277070
mimetypes = self.mapped("mimetype")
Expand Down Expand Up @@ -560,7 +561,9 @@ def _fs_mark_for_gc(self, fname):
def _get_fs_parts(
self,
) -> tuple[fsspec.AbstractFileSystem, str, str] | tuple[None, None, None]:
"""Return the filesystem, the storage code and the path for the current attachment"""
"""Return the filesystem, the storage code and the path for the
current attachment
"""
if not self.store_fname:
return None, None, None
return self._fs_parse_store_fname(self.store_fname)
Expand Down Expand Up @@ -1069,7 +1072,8 @@ def _get_attachment_data(self) -> dict:
file_path = file_path.lstrip("/")
ret["checksum"] = self._filesystem.checksum(file_path)
ret["file_size"] = self._filesystem.size(file_path)
# TODO index_content is too expensive to compute here or should be configurable
# TODO index_content is too expensive to compute here or should be
# configurable
# data = self._file.read()
# ret["index_content"] = self.attachment._index_content(data,
# self.attachment.mimetype, ret["checksum"])
Expand Down
3 changes: 2 additions & 1 deletion fs_image/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,8 @@ def _update_alt_text(self, records, value: dict):
if not record[self.name]:
raise UserError(
_(
"Cannot set alt_text on empty image (record %(record)s.%(field_name)s)",
"Cannot set alt_text on empty image "
"(record %(record)s.%(field_name)s)",
record=record,
field_name=self.name,
)
Expand Down

0 comments on commit d011b2c

Please sign in to comment.