Merge PR #3026 into 16.0

Signed-off-by bguillot
pull/3035/head
OCA-git-bot 2024-09-11 12:37:55 +00:00
commit 9567287145
1 changed files with 1 additions and 5 deletions

View File

@ -211,11 +211,7 @@ class AttachmentSynchronizeTask(models.Model):
with self.env.registry.cursor() as new_cr:
new_env = api.Environment(new_cr, self.env.uid, self.env.context)
file_name = file_path.split(fs.sep)[-1]
# avoid use of cat_file because it may not be implemeted in async
# implementation like sshfs
with fs.open(file_path, "rb") as fs_file:
data = fs_file.read()
data = base64.b64encode(data)
data = base64.b64encode(fs.cat_file(file_path))
attach_vals = self.with_env(new_env)._prepare_attachment_vals(
data, file_name
)