Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
3 Відповіді
1815 Переглядів

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

...

 

                

...


Аватар
Відмінити
Найкраща відповідь

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

Аватар
Відмінити
Автор Найкраща відповідь

inside xml is:

               

Аватар
Відмінити
Автор

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 Відповіді Переглядів Дія
2
трав. 24
1871
2
бер. 21
3889
7
черв. 20
20654
1
січ. 24
14263
1
лист. 24
3812