Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
4296 Представления

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
1327
0
сент. 24
850
1
июл. 23
5901
3
мая 23
6471
0
янв. 23
1717