-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1532 from camptocamp/14.0-fix-build
[14.0][FIX] fix build
- Loading branch information
Showing
15 changed files
with
117 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ __pycache__/ | |
*.py[cod] | ||
/.venv | ||
/.pytest_cache | ||
/.ruff_cache | ||
|
||
# C extensions | ||
*.so | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[MESSAGES_CONTROL] | ||
disable=xml-deprecated-data-node,xml-deprecated-tree-attribute |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
# Copyright 2021 Camptocamp SA (http://www.camptocamp.com) | ||
# @author Simone Orsi <[email protected]> | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
from hashlib import sha1 | ||
|
||
from odoo import fields, models | ||
|
||
|
@@ -53,7 +54,11 @@ def _get_images_store_hash(self): | |
self.ensure_one() | ||
if not self[self._image_field]: | ||
return False | ||
return str(hash(self._get_images_store_hash_tuple())) | ||
# NOTE : from python 3.9 on we should use | ||
# usedforsecurity=False with sha1 | ||
return sha1( | ||
str(self._get_images_store_hash_tuple()).encode("utf-8") | ||
).hexdigest() | ||
|
||
def _get_images_store_hash_timestamp(self): | ||
"""Get the timestamp of the last modification of the images | ||
|
@@ -63,12 +68,11 @@ def _get_images_store_hash_timestamp(self): | |
:return: datetime | ||
""" | ||
images_relation = self[self._image_field] | ||
timestamps = [ | ||
*images_relation.mapped("write_date"), | ||
*images_relation.mapped("image_id.write_date"), | ||
timestamps = [x.write_date for x in images_relation] + [ | ||
x.image_id.write_date for x in images_relation | ||
] | ||
if "tag_id" in images_relation._fields: | ||
timestamps += images_relation.mapped("tag_id.write_date") | ||
timestamps += [x.tag_id.write_date for x in images_relation if x.tag_id] | ||
return max(timestamps) if timestamps else False | ||
|
||
def _get_images_store_hash_tuple(self): | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters