mirror of
https://github.com/camptocamp/odoo-cloud-platform.git
synced 2026-06-23 18:04:34 +00:00
Update base_fileurl_field/fields.py
Co-Authored-By: grindtildeath <akim.juillerat@camptocamp.com>
This commit is contained in:
committed by
Akim Juillerat
co-authored by
Akim Juillerat
parent
d83aca68e6
commit
2d8d1f808b
@@ -58,9 +58,7 @@ class FileURL(fields.Binary):
|
|||||||
fname = record[self.filename]
|
fname = record[self.filename]
|
||||||
vals['datas_fname'] = fname
|
vals['datas_fname'] = fname
|
||||||
if fname and self.storage_path:
|
if fname and self.storage_path:
|
||||||
storage_key = self._build_storage_key(
|
storage_key = self._build_storage_key(fname)
|
||||||
record[self.filename]
|
|
||||||
)
|
|
||||||
if not fname:
|
if not fname:
|
||||||
storage_key = False
|
storage_key = False
|
||||||
env['ir.attachment'].sudo().with_context(
|
env['ir.attachment'].sudo().with_context(
|
||||||
@@ -75,8 +73,7 @@ class FileURL(fields.Binary):
|
|||||||
if self.filename:
|
if self.filename:
|
||||||
fname = record[self.filename]
|
fname = record[self.filename]
|
||||||
if fname and self.storage_path:
|
if fname and self.storage_path:
|
||||||
storage_key = self._build_storage_key(
|
storage_key = self._build_storage_key(fname)
|
||||||
record[self.filename])
|
|
||||||
super().write(
|
super().write(
|
||||||
records.with_context(
|
records.with_context(
|
||||||
storage_location=self.storage_location,
|
storage_location=self.storage_location,
|
||||||
|
|||||||
Reference in New Issue
Block a user