Repository: OCA/server-tools

Issue:
Error Message on fetchmail_attach_from_folder
Hello all together,

I'm trying to use this plugin to archive emails in odoo. After installation I tried to configure a new incoming mail server but after clicking in "Create" the following Server Error appears:
`Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 537, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 574, in dispatch
    result = self._call_function(**self.params)
  File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 310, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/openerp/service/model.py", line 118, in wrapper
    return f(dbname, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 307, in checked_call
    return self.endpoint(*a, **kw)
  File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 803, in __call__
    return self.method(*args, **kw)
  File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 403, in response_wrap
    response = f(*args, **kw)
  File "/usr/lib/python2.7/dist-packages/openerp/addons/web/controllers/main.py", line 944, in call_kw
    return self._call_kw(model, method, args, kwargs)
  File "/usr/lib/python2.7/dist-packages/openerp/addons/web/controllers/main.py", line 936, in _call_kw
    return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 268, in wrapper
    return old_api(self, *args, **kwargs)
  File "/var/lib/odoo/.local/share/Odoo/addons/8.0/fetchmail_attach_from_folder/model/fetchmail_server.py", line 271, in fields_view_get
    UnquoteEvalContext({})
  File "/usr/lib/python2.7/dist-packages/openerp/tools/safe_eval.py", line 314, in safe_eval
    return eval(c, globals_dict, locals_dict)
  File "", line 1, in <module>
ValueError: "name 'false' is not defined" while evaluating
'{"readonly": [["match_first", "==", false]], "required": [["match_first", "==", true]]}'`

Can somebody help me to fix this problem?
I'm running odoo Version 8.0-20160125

Thank you very much!
Regards,
Matthias



Discussion:

Resolving patch:
diff --git a/fetchmail_attach_from_folder/model/fetchmail_server.py b/fetchmail_attach_from_folder/model/fetchmail_server.py
--- a/fetchmail_attach_from_folder/model/fetchmail_server.py
+++ b/fetchmail_attach_from_folder/model/fetchmail_server.py
@@ -26,7 +26,6 @@
 from openerp import models, fields, api, exceptions
 from openerp.tools.safe_eval import safe_eval
 from openerp.tools.translate import _
-from openerp.tools.misc import UnquoteEvalContext
 _logger = logging.getLogger(__name__)
 
 
@@ -266,10 +265,7 @@ def fields_view_get(self, cr, user, view_id=None, view_type='form',
                         'modifiers',
                         simplejson.dumps(
                             dict(
-                                safe_eval(
-                                    field.attrib['modifiers'],
-                                    UnquoteEvalContext({})
-                                ),
+                                simplejson.loads(field.attrib['modifiers']),
                                 **modifiers[field.attrib['name']]
                             )
                         ),


Test patch: