You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

13 lines
369 B

  1. # Copyright (C) 2019 Akretion
  2. # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
  3. from odoo import fields, models
  4. class Base(models.AbstractModel):
  5. _inherit = "base"
  6. attachment_ids = fields.One2many(
  7. 'ir.attachment', 'res_id', string='Attachments',
  8. domain=lambda self: [('res_model', '=', self._name)], auto_join=True
  9. )