diff options
| author | Adrian Torres <adt@odoo.com> | 2018-12-12 09:46:02 +0000 |
|---|---|---|
| committer | Adrian Torres <adt@odoo.com> | 2019-07-05 09:04:45 +0000 |
| commit | 9e71d57d11faf3fabd00b8a09188e9d4f9808c63 (patch) | |
| tree | 4dfda85fb19bf1f68954cadbd8a39bbb582ef775 /addons/web_editor/models | |
| parent | f5676fabea8a09f5702d00e75f3cf55f01ed5b22 (diff) | |
[REM] *: remove calls to `api.one` and adapt code
Adapt all code that was using `api.one` to recordset-style method and
remove any and all calls to `api.one` in preparation for its removal.
Diffstat (limited to 'addons/web_editor/models')
| -rw-r--r-- | addons/web_editor/models/ir_attachment.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/addons/web_editor/models/ir_attachment.py b/addons/web_editor/models/ir_attachment.py index ac441d821e8..b0c48defee8 100644 --- a/addons/web_editor/models/ir_attachment.py +++ b/addons/web_editor/models/ir_attachment.py @@ -15,12 +15,12 @@ class IrAttachment(models.Model): image_width = fields.Integer(compute='_compute_image_size') image_height = fields.Integer(compute='_compute_image_size') - @api.one def _compute_local_url(self): - if self.url: - self.local_url = self.url - else: - self.local_url = '/web/image/%s?unique=%s' % (self.id, self.checksum) + for attachment in self: + if attachment.url: + attachment.local_url = attachment.url + else: + attachment.local_url = '/web/image/%s?unique=%s' % (attachment.id, attachment.checksum) @api.multi @api.depends('mimetype', 'url', 'name') |
