c2c-oerpscenario team mailing list archive
-
c2c-oerpscenario team
-
Mailing list archive
-
Message #28504
[Bug 806342] Re: Special chars in selection fields can not be selected on editable tree
Hello,
Ok but obviously that doesn't work at least in the case I explained,
because self.attrs['selection'] contains string values.
Maybe in some case self.attrs['selection'] contains string and sometimes
unicode ? That could explain why Xavier ALT needed to convert the text
to unicode, and I needed not to convert it ?
I didn't investigate further to self.attrs['selection'] if it should be
unicode or string.
But what is certain is that in the case of the attendances type
selection, it contains string values.
Thanks
--
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/806342
Title:
Special chars in selection fields can not be selected on editable tree
Status in OpenERP GTK Client:
Confirmed
Bug description:
Hello,
This happens with the gtk client 6.0 (revno 1868).
To reproduce it, you need a selection field in a editable tree view.
For example, add editable="bottom" in the attendances tree view and set your client in french.
The "Sign In" choice becomes "Pointer l'entrée".
When you select this value in the selection field, as soon as you left
the field, it becomes empty.
This is displayed in the logs :
/opt/client_60/bin/widget/view/tree_gtk/parser.py:630: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
if txt[:len(text)].lower() == text.lower():
In the widget method
def value_from_text(self, model, text):
selection = self.attrs['selection']
text = tools.ustr(text)
res = False
for val, txt in selection:
if txt[:len(text)].lower() == text.lower():
if len(txt) == len(text):
return val
res = val
return res
Variables are equal to :
txt : "Pointer l'entr\xc3\xa9e"
text parameter input : "Pointer l'entr\xc3\xa9e"
text after tools.ustr u"Pointer l'entr\xe9e"
A unicode conversion is done on the text, but it is compared to a non-
unicode string so the selection is never found.
So, the fix is either not to convert the variable, or to convert the
two.
A patch is attached.
Thanks
Guewen
To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-client/+bug/806342/+subscriptions
References