Se rendre au contenu
Menu
Cette question a été signalée
3 Réponses
1794 Vues

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
Ignorer
Meilleure réponse

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

Avatar
Ignorer
Auteur Meilleure réponse

inside xml is:

               

Avatar
Ignorer
Auteur

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
}

Publications associées Réponses Vues Activité
2
mai 24
1856
2
mars 21
3887
7
juin 20
20639
1
janv. 24
14258
1
nov. 24
3800