コンテンツへスキップ
メニュー
この質問にフラグが付けられました

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'Κατάσταση')

アバター
破棄
関連投稿 返信 ビュー 活動
0
10月 19
4926
2
3月 15
11696
1
3月 17
10744
2
2月 24
1898
4
10月 20
9662