تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
3 الردود
1869 أدوات العرض

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
}

المنشورات ذات الصلة الردود أدوات العرض النشاط
2
مايو 24
1922
2
مارس 21
3925
7
يونيو 20
20749
1
يناير 24
14320
1
نوفمبر 24
3875