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

FileName Attribute(binary Field) Not Working With Wizard

By
Ali Abdelmonem Mustafa Amer
on 12/29/13, 3:51 AM 2,215 views

Hi Guys

I Have Binary Field In Wizard I Also Add The Name field But Still Get Me Non Type File When Downloading

This Is My Code

from openerp.osv import osv, fields from openerp.tools.translate import _

class pdf_wizard(osv.osv_memory): _name = "pdf.wizard" _columns = { 'pdf_report':fields.binary('PDF File',readonly=True), 'pdf_filename' :fields.char('File name', readonly=True), }

def _get_value_pdf(self, cr, uid, context=None): if context is None: context = {} return context.get('pdf_reports')

_defaults = { 'pdf_report' : _get_value_pdf , 'pdf_filename' : 'Purchase.pdf', }

pdf_wizard()

<openerp> <data> <record id="pdf_wizard_form" model="ir.ui.view"> <field name="name">pdf.wizard.form</field> <field name="model">pdf.wizard</field> <field name="arch" type="xml"> <form string="Print" version="7.0"> <field name="pdf_report" filename="pdf_filename"/>

            </form>
         </field>
    </record>


</data>

</openerp>

How I Can Do It ?

Thanks

Hi, it's a sadly well know issue : https://bugs.launchpad.net/openerp-web/+bug/1252458

Mind & Go, Mind And Go
on 7/4/14, 5:52 AM

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: 12/29/13, 3:51 AM
Seen: 2215 times
Last updated: 3/16/15, 8:10 AM