Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
3 Trả lời
1861 Lượt xem

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

...

 

                

...


Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

inside xml is:

               

Ảnh đại diện
Huỷ bỏ
Tác giả

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
}

Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 5 24
1914
2
thg 3 21
3914
7
thg 6 20
20735
1
thg 1 24
14308
1
thg 11 24
3858