← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 806342] Re: Special chars in selection fields can not be selected on editable tree

 

Hello Guewen,

The values for selection will be in unicode i.e the server will send a
unicode strings. I tried out your case with recent trunk verison and
does not seem to be reproducible. Can you try out with latest trunk
version.

I would close the bug for sake of clarity on LP but you can open it
again if you still have problem.


Thanks

** Changed in: openobject-client
       Status: Confirmed => Invalid

-- 
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to 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:
  Invalid

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