Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
3 Antwoorden
1799 Weergaven

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
Annuleer
Beste antwoord

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

Avatar
Annuleer
Auteur Beste antwoord

inside xml is:

               

Avatar
Annuleer
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
}

Gerelateerde posts Antwoorden Weergaven Activiteit
2
mei 24
1860
2
mrt. 21
3887
7
jun. 20
20641
1
jan. 24
14260
1
nov. 24
3801