Solution to classify attachments (something like folder or tag)

Hello everyone.
I have a question regarding attachments to a model. I have a model named Vehicle, and I would like to attach many documents on this model (technical documents, legal documents, photos…etc).
In order to ease the managing of those documents, I would like to know if there is an existing solution to classify the attachments ?
Something like folders or tags ?
Does someone know if there an existing solution in tryton, or maybe in a community module ?

Thanks in advance for your help.

A tag system is indeed a Many2Many field with a target composed by only a name.
I think it could be a nice tool to be reuse in many places. We are only missing a nice widget to add/create, remove and auto-complete tags on the client-side.


Thank you for your response.
I agree that a generic tag system could be a nice addition to tryton. If I understand what you are saying, we would have to create a Model named Tag, and use a Many2Many field in the models where we want to add the tags ? Then we would have to create a widget to manage the tags like you said, and display it in the button tab bar on top of list an form ?

Anyway, this would be a good feature, but I don’t think it would have been sufficient for us. We would still have to override the attachment widget to display those tags.

However, we found a simple solution for our case : we override Attachment model to add a field named folder (of type Char). Then we override the view attachment_list to display the field via xpath. Finally, we override get_rec_name and search_read functions to display and order on the folder name, then file name.

Capture d’écran 2021-09-10 184642

1 Like