跳至内容
菜单
此问题已终结
3 回复
1791 查看

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

...

 

                

...


形象
丢弃
最佳答案

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
}

相关帖文 回复 查看 活动
2
5月 24
1855
2
3月 21
3887
7
6月 20
20637
1
1月 24
14258
1
11月 24
3800