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

how we use file upload field in wtform in odoo controller

By
kartik
on 1/16/16, 2:51 AM 520 views

hi,

i want to add file upload field in odoo controller.

and then add in res.partner

i add filefield like

image = FileField(u'Image File')


after that i add object in res.partner like


customer = http.request.env['res.partner']

sur_name = form_data.get('sur_name', '')

maiden_nm = form_data.get('maiden_nm', '')

fore_nm = form_data.get('fore_nm', '')

cust = customer.create({

'name' : str(sur_name)+' '+str(maiden_nm)+' '+str(fore_nm),

'street': form_data.get('present_add_us', ''),

'phone': form_data.get('telephone', ''),

'birthdate': form_data.get('dob', ''),

'email': form_data.get('email', ''),

'image': form_data.get('image', ''),

})


but it return error like


cannot identify image file <cStringIO.StringI object at 0x7f89a4ab0b58>

in odoo v9

can you please suggest me how we use file field in wtform


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: 1/16/16, 2:51 AM
Seen: 520 times
Last updated: 1/16/16, 4:55 AM