Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
3 Vastaukset
1793 Näkymät

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
Hylkää
Paras vastaus

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

Avatar
Hylkää
Tekijä Paras vastaus

inside xml is:

               

Avatar
Hylkää
Tekijä

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
}

Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
2
toukok. 24
1855
2
maalisk. 21
3887
7
kesäk. 20
20639
1
tammik. 24
14258
1
marrask. 24
3800