Signed-off-by LoisRForgeFlow
@ -7,7 +7,7 @@ from odoo import fields, models
class Base(models.AbstractModel):
_inherit = "base"
attachment_ids = fields.One2many(
'ir.attachment', 'res_id', string='Attachments',
assigned_attachment_ids = fields.One2many(
'ir.attachment', 'res_id', string='Assigned Attachments',
domain=lambda self: [('res_model', '=', self._name)], auto_join=True
)
@ -8,7 +8,7 @@ from datetime import timedelta
class IrAttachment(models.Model):
_name = "ir.attachment"
_inherit = ["ir.attachment", "autovacuum.mixin"]
_autovacuum_relation = 'attachment_ids'
_autovacuum_relation = 'assigned_attachment_ids'
def _get_autovacuum_domain(self, rule):
domain = super()._get_autovacuum_domain(rule)