Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
6296 มุมมอง

I have a selection field in a custom module:

'firmFlagDescr': fields.selection([(1, u'ΕΠΙΤΗΔΕΥΜΑΤΙΑΣ'), (0, u'ΜΗ ΕΠΙΤΗΔΕΥΜΑΤΙΑΣ'), (2, u'ΠΡΩΗΝ ΕΠΙΤΗΔΕΥΜΑΤΙΑΣ')], u'Κατάσταση')

It shows up fine in UI as a drop down box with all 3 options.

The problem is however that whatever change I make in the selection, it is not saved (either through clicking save via UI or changing value from python code).

Any pointers?

PS. OpenERP v7.0

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

openERP doesn't like selection fields with integer keys.

Once the key-value tuple was changed to have string keys everything worked fine.
 

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

firmFlagDescr': fields.selection([('1',u'ΕΠΙΤΗΔΕΥΜΑΤΙΑΣ'), ('0',u'ΜΗ ΕΠΙΤΗΔΕΥΜΑΤΙΑΣ'), ('2',u'ΠΡΩΗΝ ΕΠΙΤΗΔΕΥΜΑΤΙΑΣ')], u'Κατάσταση')

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
0
ต.ค. 19
4918
2
มี.ค. 15
11667
1
มี.ค. 17
10730
2
ก.พ. 24
1894
4
ต.ค. 20
9650