Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
1 Відповісти
4281 Переглядів

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


Аватар
Відмінити

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

Найкраща відповідь

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
Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
0
вер. 24
1326
0
вер. 24
849
1
лип. 23
5892
3
трав. 23
6463
0
січ. 23
1712