Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
4287 มุมมอง

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
5897
3
พ.ค. 23
6466
0
ม.ค. 23
1717