mirror of
https://github.com/OCA/knowledge.git
synced 2025-12-23 05:42:13 -06:00
[12.0][ADD] attachment_category
This commit is contained in:
18
attachment_category/models/ir_attachment.py
Normal file
18
attachment_category/models/ir_attachment.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Copyright 2020 ACSONE SA/NV
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class IrAttachment(models.Model):
|
||||
|
||||
_inherit = 'ir.attachment'
|
||||
|
||||
category_ids = fields.Many2many(
|
||||
comodel_name="ir.attachment.category",
|
||||
relation="ir_attachment_category_rel",
|
||||
column1="attachment_id",
|
||||
column2="category_id",
|
||||
ondelete="restrict",
|
||||
index=True,
|
||||
)
|
||||
Reference in New Issue
Block a user