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

wrong value

By
soumaya
on 4/25/16, 6:26 AM 415 views

Hi 

I created a new module odoo 9 witch was correctly installed 
but when i trayed to save new information it shows me this error

Odoo Server Error

Traceback (most recent call last):
  File "C:\Program Files\Odoo 9.0-20160413\server\.\openerp\http.py", line 643, in _handle_exception
  File "C:\Program Files\Odoo 9.0-20160413\server\.\openerp\http.py", line 680, in dispatch
  File "C:\Program Files\Odoo 9.0-20160413\server\.\openerp\http.py", line 316, in _call_function
  File "C:\Program Files\Odoo 9.0-20160413\server\.\openerp\service\model.py", line 118, in wrapper
  File "C:\Program Files\Odoo 9.0-20160413\server\.\openerp\http.py", line 309, in checked_call
  File "C:\Program Files\Odoo 9.0-20160413\server\.\openerp\http.py", line 959, in __call__
  File "C:\Program Files\Odoo 9.0-20160413\server\.\openerp\http.py", line 509, in response_wrap
  File "C:\Program Files\Odoo 9.0-20160413\server\openerp\addons\web\controllers\main.py", line 892, in call_kw
  File "C:\Program Files\Odoo 9.0-20160413\server\openerp\addons\web\controllers\main.py", line 884, in _call_kw
  File "C:\Program Files\Odoo 9.0-20160413\server\.\openerp\api.py", line 250, in wrapper
  File "C:\Program Files\Odoo 9.0-20160413\server\.\openerp\api.py", line 354, in old_api
  File "C:\Program Files\Odoo 9.0-20160413\server\.\openerp\models.py", line 4150, in create
  File "C:\Program Files\Odoo 9.0-20160413\server\.\openerp\api.py", line 248, in wrapper
  File "C:\Program Files\Odoo 9.0-20160413\server\.\openerp\api.py", line 490, in new_api
  File "C:\Program Files\Odoo 9.0-20160413\server\.\openerp\models.py", line 4270, in _create
  File "C:\Program Files\Odoo 9.0-20160413\server\.\openerp\api.py", line 250, in wrapper
  File "C:\Program Files\Odoo 9.0-20160413\server\.\openerp\api.py", line 354, in old_api
  File "C:\Program Files\Odoo 9.0-20160413\server\.\openerp\models.py", line 2244, in _check_selection_field_value
  File "C:\Program Files\Odoo 9.0-20160413\server\.\openerp\fields.py", line 1529, in convert_to_cache
ValueError: Wrong value for mon_module.cas_sexe: u'\u0630\u0643\u0631'


can you post your code ?

Jignesh Mehta
on 4/25/16, 6:38 AM

this is the code: # encoding: utf-8 from openerp.osv import osv, fields class monmodule(osv.osv): _name = 'mon_module' _columns = { 'cas_lastname':fields.char('الإسم', size=50, required=True, readonly=False), 'cas_firstname':fields.char('اللقب', size=50, required=True, readonly=False), 'cas_birthday':fields.date('تاريخ الولادة'), 'cas_lieunaiss':fields.char('مكان الولادة', size=50, required=False, readonly=False), 'cas_cin': fields.integer('رقم بطاقة التعريف الوطنية'), 'cas_lieu_cin':fields.char('مكان اصدارها', size=64, required=False, readonly=False), 'cas_datecin': fields.date('تاريخ اصدارها'), 'cas_photo':fields.binary('صورة', filters=None), 'cas_ref':fields.char('المعرف',size=50,required=True,readonly=False), 'cas_sexe':fields.Selection(selection=[('femme','أنثى'),('homme','ذكر')],'الجنس'), 'cas_pere_id':fields.many2one('mon_module', 'الأب', required=False), 'cas_mere_id':fields.many2one('mon_module', 'الأم', required=False), 'cas_telcontacts_ids':fields.one2many('mon_module.telcontacts', 'cas_id','قائمة الهواتف', required=False), 'cas_etatcivil_ids':fields.one2many('mon_module.etatcivile', 'cas_id', 'الحالة المدنية', required=False), 'cas_adr_ids':fields.one2many('mon_module.address', 'cas_id', 'عناوين الحالات', required=False), 'cas_boulot_ids':fields.one2many('mon_module.boulot', 'cas_id', 'الشغل', required=False), 'cas_visite_ids':fields.one2many('mon_module.visite', 'cas_id', 'الزيارات', required=False), 'cas_aide_ids':fields.one2many('mon_module.aide', 'cas_id', 'المساعدات', required=False), 'cas_logement_ids':fields.one2many('mon_module.logement', 'cas_id', 'المسكن', required=False), }

soumaya
on 4/25/16, 6:44 AM

i think this ligne of code is the source of this error : 'cas_sexe':fields.Selection(selection=[('femme','أنثى'),('homme','ذكر') o],'الجنس'),

soumaya
on 4/25/16, 6:47 AM
0

Jignesh Mehta

--Jignesh Mehta--
2087
| 6 4 8
Surat, India
--Jignesh Mehta--


Jignesh Mehta
On 4/25/16, 6:52 AM

Hello Soumya,


Try this selection field

'cas_sexe':fields.selection([('key1','value1),('key2','value2')], string='string')


Thanks,

0

Ahmed M.Elmubarak

--Ahmed M.Elmubarak--
2988
| 5 3 5
Sudan
--Ahmed M.Elmubarak--


Ahmed M.Elmubarak
On 4/25/16, 6:56 AM

Hello, 

The problem in the selection field ...

try this one:

'cas_sexe':fields.selection([('femme', 'انثى'),('homme', 'ذكر')], 'Gender),

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: 4/25/16, 6:26 AM
Seen: 415 times
Last updated: 4/25/16, 6:56 AM