mirror of
https://github.com/camptocamp/odoo-cloud-platform.git
synced 2026-06-24 16:48:36 +00:00
Document a weird domain which is there for a reason
The reason being: https://github.com/odoo/odoo/blob/9032617120138848c63b3cfa5d1913c5e5ad76db/odoo/addons/base/ir/ir_attachment.py#L344-L347 I nearly deleted this domain but it was too weird to be there for no reason. A comment explaining the issue was really missing.
This commit is contained in:
@@ -243,6 +243,11 @@ class IrAttachment(models.Model):
|
|||||||
def _force_storage_to_object_storage(self, new_cr=False):
|
def _force_storage_to_object_storage(self, new_cr=False):
|
||||||
_logger.info('migrating files to the object storage')
|
_logger.info('migrating files to the object storage')
|
||||||
storage = self._storage()
|
storage = self._storage()
|
||||||
|
# The weird "res_field = False OR res_field != False" domain
|
||||||
|
# is required! It's because of an override of _search in ir.attachment
|
||||||
|
# which adds ('res_field', '=', False) when the domain does not
|
||||||
|
# contain 'res_field'.
|
||||||
|
# https://github.com/odoo/odoo/blob/9032617120138848c63b3cfa5d1913c5e5ad76db/odoo/addons/base/ir/ir_attachment.py#L344-L347
|
||||||
domain = ['!', ('store_fname', '=like', '{}://%'.format(storage)),
|
domain = ['!', ('store_fname', '=like', '{}://%'.format(storage)),
|
||||||
'|',
|
'|',
|
||||||
('res_field', '=', False),
|
('res_field', '=', False),
|
||||||
|
|||||||
Reference in New Issue
Block a user