Skip to content
Snippets Groups Projects
Commit b5b50848 authored by Herbert Riess's avatar Herbert Riess Committed by Martin Trigaux
Browse files

[FIX] base: reference attach, not self in _compute_raw()


Current behavior:
call to _file_read() within "for attach in self:" loop references self
rather than attach

Expected behavior:
execute _file_read() individually for every record in self (via "for
attach in self:" loop)

This is not an issue in standard where _file_read is an api.model
method but in case of overwrite (e.g. issue reported at
odoo/odoo#60016 has implemented an AWS integration) it makes sense

closes odoo/odoo#60342

X-original-commit: 160043a4
Signed-off-by: default avatarMartin Trigaux (mat) <mat@odoo.com>
parent 86831139
Branches
Tags
No related merge requests found
......@@ -201,7 +201,7 @@ class IrAttachment(models.Model):
def _compute_raw(self):
for attach in self:
if attach.store_fname:
attach.raw = self._file_read(attach.store_fname)
attach.raw = attach._file_read(attach.store_fname)
else:
attach.raw = attach.db_datas
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment