← 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,

Thanks for the patch ! your patch  removes the conversion of the text to
unicode string to support accented characters in selection widget in
editable tree_view but the same text to unicode string conversion was
applied by Xavier @ 990.3.54 to support accented characters. here is the
full information.

revno: 990.3.54
committer: Xavier ALT <x.alt@xxxxxx>
branch nick: client
timestamp: Wed 2010-03-24 00:44:46 +0100
message:
  [FIX] can't save document with selection in tree_gtk view containing accentuated data

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