Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
3 Odpovědi
1820 Zobrazení

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

...

 

                

...


Avatar
Zrušit
Nejlepší odpověď

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

Avatar
Zrušit
Autor Nejlepší odpověď

inside xml is:

               

Avatar
Zrušit
Autor

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 Odpovědi Zobrazení Aktivita
2
kvě 24
1874
2
bře 21
3890
7
čvn 20
20661
1
led 24
14264
1
lis 24
3813