Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

button download ?

By
kaisusr
on 9/19/14, 6:56 AM 437 views

Hello

someone can tell me how to make a button to download the current document ? the current document is a document which is saved in the datatbase

1
hajar el hamdani
On 9/19/14, 7:45 AM

you have to add this code to your XML code 

<button name="summary_print" type="object" string="Print" class="oe_highlight"/> ou <button name="cancel" string="Annuler" special="cancel" class="oe_link"/>

ans this to code python

def summary_print( self, cr, uid, ids, context = None ):
        stats_obj = self.pool.get( 'class.name' )
            
        datas = {
            'ids': ids,
            'model': 'class.name',
            'context': context,
        }

        return {
            'type': 'ir.actions.report.xml',
            'report_name': 'report.name',
            'context': context,
            'datas': datas,
            'nodestroy' : True
        }

Thanx Hajar for ur answer but i want to download a document which is saves in the database, not a report ??

kaisusr
on 9/19/14, 12:24 PM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 9/19/14, 6:56 AM
Seen: 437 times
Last updated: 3/16/15, 8:10 AM