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

Here is the code for this:


document_page (folder)

document.py

class DocumentPage(models.Model):

​_name = "document.page"

...

​ document_attached = fields.Binary("Attached Document")

    def download_document_attached(self):        #Download the document_attached


download_document_attached.xml

...

 

                

...


อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Maybe this would help you.

https://www.odoo.com/forum/help-1/how-to-download-attachment-on-button-click-action-121621

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

You want to create a new one and don't use this right

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

inside xml is:

               

อวตาร
ละทิ้ง
ผู้เขียน

yes i want a new one which is in the header of the form and says "Download Content" so an administrator of the app just upload files and the other people enter and see the big green button saying "Download". I want it that way because thats how they said they wanted it :/

Try this
def download_document_attached(self):
self.ensure_one()
return {
'type': 'ir.actions.act_url',
'url': '/web/content/document.page/%s/document_attached' % self.id
}

Related Posts ตอบกลับ มุมมอง กิจกรรม
2
พ.ค. 24
1893
2
มี.ค. 21
3895
7
มิ.ย. 20
20705
1
ม.ค. 24
14285
1
พ.ย. 24
3833