Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
1 Antworten
4285 Ansichten

Hi,

I want to integrate the Documents app in my custom module. I found the DocumentMixin Class with description 'Inherit this mixin to automatically create a `documents.document` when

an `ir.attachment` is linked to a record.
Override this mixin's methods to specify an owner, a folder or tags
for the document.'

This sounds very promising, but I have no clue how to begin with this.
Ideally, I want, when uploading a document, to specify tags, workspace etc, so that Odoo can create the Document accordingly.
Any suggestions?

Bart


Avatar
Verwerfen

Hello Bart.
I have the same problems, i need inherited _makefileupload function to overwrite because I want, when uploading a document, to specify some info of the context. You resolver this problems?. Sorry for my english

Hi Bart, same issue for me. I came across that Model too. How do I implement it?
Thanks
Friedrich

Beste Antwort

Hi,
I did this in crm.lead by doing 

class CrmLead(models.Model):
_name = 'crm.lead'
_inherit = ['crm.lead', 'documents.mixin']

then just use the methods from document.mixin to create a new folder and set other parameters

def _get_document_folder(self):
return self.env['documents.folder'].create({'name': 'Crm'})

def _get_document_partner(self):
return self.partner_id
Avatar
Verwerfen
Verknüpfte Beiträge Antworten Ansichten Aktivität
0
Sept. 24
1327
0
Sept. 24
850
1
Juli 23
5895
3
Mai 23
6466
0
Jan. 23
1716