mirror of
https://github.com/OCA/knowledge.git
synced 2025-07-29 11:56:30 -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'
|
_inherit = 'ir.attachment'
|
||||||
|
|
||||||
document_type_id = fields.Many2one(
|
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>
|
<sheet>
|
||||||
<group>
|
<group>
|
||||||
<field name="name"/>
|
<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"/>
|
<field name="description"/>
|
||||||
</group>
|
</group>
|
||||||
</sheet>
|
</sheet>
|
||||||
|
Loading…
Reference in New Issue
Block a user