Reviewers: ,


Please review this at http://codereview.tryton.org/696002/

Affected files:
  M trytond/ir/model.py


Index: trytond/ir/model.py
===================================================================
--- a/trytond/ir/model.py
+++ b/trytond/ir/model.py
@@ -134,7 +134,9 @@
                 ])
         access = ModelAccess.get_access([m.model for m in models])
         s = StringMatcher()
-        s.set_seq2(text.decode('utf-8'))
+        if isinstance(text, str):
+            text = text.decode('utf-8')
+        s.set_seq2(text)

         def generate():
             for model in models:
@@ -144,6 +146,8 @@
                 if not hasattr(Model, 'search_global'):
                     continue
                 for id_, rec_name, icon in Model.search_global(text):
+                    if isinstance(rec_name, str):
+                        rec_name = rec_name.decode('utf-8')
                     s.set_seq1(rec_name)
                     yield (s.ratio(), model.model, model.rec_name,
                         id_, rec_name, icon)


--
--
[email protected] mailing list

--- You received this message because you are subscribed to the Google Groups "tryton-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to