Hello Francois Degrave, I think one thing you are missing at the time, You need to pass string format when you declaring a function and
returning a list of tuples value in following way. def _get_levels(self,cr,uid,context=None): return [('1','1'),('2','2')] Above function will solve your issue. Yes I am agree with you when use this things directly in the particular field it is not creating any problem from client side due to automatically conversion from integer to string. Hope this will help you. Thanks. ** Changed in: openobject-client-web Status: New => Opinion -- You received this bug notification because you are a member of C2C OERPScenario, which is subscribed to the OpenERP Project Group. https://bugs.launchpad.net/bugs/816439 Title: [trunk] Selection field value not displayed in tree view (except in edit mode)) Status in OpenERP Web Client: Opinion Bug description: Hi everyone! When I define a selection field in which the list of pairs is computed by a function, the value of this field is not displayed in tree view if it is not in "edit" mode. For example, let us assume I define something like this (not very useful here of course): def _get_levels(self,cr,uid,context=None): return [(1,'1'),(2,'2')] _columns = { 'level':fields.selection(_get_levels,'Level'), } Let us assume now I define an (editable) tree view in which this field appears. The corresponding column exists, and I'm able to choose a value when I edit the field; however when I click "save" and consequently quit the "edit" mode, the value is not displayed (although it is recorded in the DB, and if I turn back on the "edit" mode, the value is visible again). Of course, this problem does not arise if I define the field like this: _columns = { 'level':fields.selection( [(1,'1'),(2,'2')] ,'Level'), } Also note that there is no problem with a form view. Chromium 14.0.825.0 Ubuntu 11.04 Web client Trunk rev 4673 To manage notifications about this bug go to: https://bugs.launchpad.net/openobject-client-web/+bug/816439/+subscriptions _______________________________________________ Mailing list: https://launchpad.net/~c2c-oerpscenario Post to : c2c-oerpscenario@lists.launchpad.net Unsubscribe : https://launchpad.net/~c2c-oerpscenario More help : https://help.launchpad.net/ListHelp