Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
3 Odpowiedzi
1811 Widoki

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

...

 

                

...


Awatar
Odrzuć
Najlepsza odpowiedź

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

Awatar
Odrzuć
Autor Najlepsza odpowiedź

inside xml is:

               

Awatar
Odrzuć
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
}

Powiązane posty Odpowiedzi Widoki Czynność
2
maj 24
1869
2
mar 21
3888
7
cze 20
20649
1
sty 24
14262
1
lis 24
3806