Valid action domains using `time` cause server-side errors in the "need-action" mechanism. (e.g. NameError: name 'time' is not defined)

Bug #1273098 reported by Alexandre Fayolle - camptocamp
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
Confirmed
Low
OpenERP's Framework R&D

Bug Description

By using the the `time` module within an action domain it is possible to create server-side errors for 'need-action' enabled menus, even though the action domain itself is valid and works on the client-side.

========== Original description ====
I tried connecting to the runbot this morning, and after authenticating as admin, I got the following stack trace displayed on screen:

Server Traceback (most recent call last):
  File "/home/odoo/runbot/static/openerp-dev-7-0-28618/server/openerp/addons/web/session.py", line 89, in send
    return openerp.netsvc.dispatch_rpc(service_name, method, args)
  File "/home/odoo/runbot/static/openerp-dev-7-0-28618/server/openerp/netsvc.py", line 292, in dispatch_rpc
    result = ExportService.getService(service_name).dispatch(method, params)
  File "/home/odoo/runbot/static/openerp-dev-7-0-28618/server/openerp/service/web_services.py", line 626, in dispatch
    res = fn(db, uid, *params)
  File "/home/odoo/runbot/static/openerp-dev-7-0-28618/server/openerp/osv/osv.py", line 190, in execute_kw
    return self.execute(db, uid, obj, method, *args, **kw or {})
  File "/home/odoo/runbot/static/openerp-dev-7-0-28618/server/openerp/osv/osv.py", line 132, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/home/odoo/runbot/static/openerp-dev-7-0-28618/server/openerp/osv/osv.py", line 199, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/home/odoo/runbot/static/openerp-dev-7-0-28618/server/openerp/addons/audittrail/audittrail.py", line 514, in execute_cr
    return fct_src(cr, uid, model, method, *args, **kw)
  File "/home/odoo/runbot/static/openerp-dev-7-0-28618/server/openerp/osv/osv.py", line 187, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/home/odoo/runbot/static/openerp-dev-7-0-28618/server/openerp/addons/base/ir/ir_ui_menu.py", line 336, in get_needaction_data
    dom = menu.action.domain and eval(menu.action.domain, {'uid': uid}) or []
  File "/home/odoo/runbot/static/openerp-dev-7-0-28618/server/openerp/tools/safe_eval.py", line 241, in safe_eval
    return eval(test_expr(expr, _SAFE_OPCODES, mode=mode), globals_dict, locals_dict)
  File "", line 1, in <module>
NameError: name 'time' is not defined

The runbot URL used is http://7-0-28618.runbot.openerp.com/?db=7-0-28618-all&ts=1390809385502#menu_id=153&action=135

Related branches

description: updated
Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

Hi Alexandre,

It seems the error was caused by someone testing customizations of "action domains" on the runbot. If you try the previous or the next 7.0 build on runbot the error does not occur.

There is indeed a real issue in this case, so we can confirm your bug report after correcting the title/description (see the attached merge proposal)

However in general you should not bother reporting errors you see on runbot only, unless you can reproduce them on fresh builds that you know are untouched (which is hard to say, really). At least confirm the error in previous and next builds to be sure that there *is* a problem. It is quite possible to cause errors/invalid behavior on runbot instances by doing random changes as the administrator, and we don't want to have bug reports every time someone does that ;-) (OpenERP catches many such mistakes but not all of them, and covering all exotic cases is not a priority)

Thanks!

summary: - NameError: name 'time' is not defined when connecting to runbot 7.0
+ Valid action domains using `time` cause server-side errors in the "need-
+ action" mechanism. (e.g. NameError: name 'time' is not defined)
description: updated
Changed in openobject-server:
assignee: nobody → OpenERP's Framework R&D (openerp-dev-framework)
importance: Undecided → Low
milestone: none → 7.0
status: New → Confirmed
Revision history for this message
Alexandre Fayolle - camptocamp (alexandre-fayolle-c2c) wrote :

@odony: thanks for the quick and detailed answer. I'll triple check next time before submitting a report.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.