mirror of
https://github.com/OCA/knowledge.git
synced 2025-07-27 02:48:41 -06:00
Filter possible document types on the model
When choosing a document type for an attachment, only document types of the related record model are proposed.
This commit is contained in:
parent
9b7799d749
commit
d67f4b616b
@ -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)]')
|
||||
|
@ -11,7 +11,9 @@
|
||||
<sheet>
|
||||
<group>
|
||||
<field name="name"/>
|
||||
<field name="document_type_id"/>
|
||||
<!-- Needed for the automatic domain on document_type_id -->
|
||||
<field name="res_model" invisible="True"/>
|
||||
<field name="document_type_id" options="{'no_create': True}"/>
|
||||
<field name="description"/>
|
||||
</group>
|
||||
</sheet>
|
||||
|
Loading…
Reference in New Issue
Block a user