diff --git a/document_type/models/document_type.py b/document_type/models/document_type.py index 114b11a6..11d8ae95 100644 --- a/document_type/models/document_type.py +++ b/document_type/models/document_type.py @@ -15,4 +15,5 @@ class IrAttachment(models.Model): _inherit = 'ir.attachment' document_type_id = fields.Many2one( - 'document.type', string='Document Type') + 'document.type', string='Document Type', + domain='[("ir_model_id.model", "=", res_model)]') diff --git a/document_type/views/attachment.xml b/document_type/views/attachment.xml index 810b08d3..d9dbaeeb 100644 --- a/document_type/views/attachment.xml +++ b/document_type/views/attachment.xml @@ -11,7 +11,9 @@ - + + +