Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
4617 Visualizzazioni

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


Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
1
feb 16
5470
3
gen 16
6976
0
lug 16
3669
3
dic 19
8041
2
apr 19
6410