filtering sale.order with act_window using context_today () error window opens but filters properly

Bug #1229270 reported by Antonio Fregoso
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
New
Undecided
Unassigned

Bug Description

I'm filtering by domain sale.order in the act_window.

[('state','not in',('draft','sent','cancel')),('date_confirm','>',(context_today()+datetime.timedelta(days=-30)).strftime('%Y-%m-%d'))]

when I access to sales menu openerp send me this error but de filter work fine:

2013-09-23 16:05:48,393 5324 ERROR demo openerp.tools.safe_eval: Cannot eval u"[('state','not in',('draft','sent','cancel')),('date_confirm','>',(context_today()+datetime.timedelta(days=-30)).strftime('%Y-%m-%d'))]"
Traceback (most recent call last):
  File "/home/antoniofregoso/workspace-openerp/sever/src/openerp/tools/safe_eval.py", line 243, in safe_eval
    except Exception:
  File "", line 1, in <module>
NameError: name 'context_today' is not defined
2013-09-23 16:05:48,394 5324 ERROR demo openerp.osv.osv: Uncaught exception
Traceback (most recent call last):
  File "/home/antoniofregoso/workspace-openerp/sever/src/openerp/osv/osv.py", line 131, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/home/antoniofregoso/workspace-openerp/sever/src/openerp/osv/osv.py", line 197, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/home/antoniofregoso/workspace-openerp/addons/src/audittrail/audittrail.py", line 514, in execute_cr
    return fct_src(cr, uid, model, method, *args, **kw)
  File "/home/antoniofregoso/workspace-openerp/sever/src/openerp/osv/osv.py", line 185, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/home/antoniofregoso/workspace-openerp/sever/src/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/antoniofregoso/workspace-openerp/sever/src/openerp/tools/safe_eval.py", line 243, in safe_eval
    except Exception:
  File "", line 1, in <module>
NameError: name 'context_today' is not defined
2013-09-23 16:05:48,394 5324 ERROR demo openerp.netsvc: name 'context_today' is not defined
Traceback (most recent call last):
  File "/home/antoniofregoso/workspace-openerp/sever/src/openerp/netsvc.py", line 292, in dispatch_rpc
    result = ExportService.getService(service_name).dispatch(method, params)
  File "/home/antoniofregoso/workspace-openerp/sever/src/openerp/service/web_services.py", line 626, in dispatch
    res = fn(db, uid, *params)
  File "/home/antoniofregoso/workspace-openerp/sever/src/openerp/osv/osv.py", line 188, in execute_kw
    return self.execute(db, uid, obj, method, *args, **kw or {})
  File "/home/antoniofregoso/workspace-openerp/sever/src/openerp/osv/osv.py", line 131, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/home/antoniofregoso/workspace-openerp/sever/src/openerp/osv/osv.py", line 197, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/home/antoniofregoso/workspace-openerp/addons/src/audittrail/audittrail.py", line 514, in execute_cr
    return fct_src(cr, uid, model, method, *args, **kw)
  File "/home/antoniofregoso/workspace-openerp/sever/src/openerp/osv/osv.py", line 185, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/home/antoniofregoso/workspace-openerp/sever/src/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/antoniofregoso/workspace-openerp/sever/src/openerp/tools/safe_eval.py", line 243, in safe_eval
    except Exception:
  File "", line 1, in <module>
NameError: name 'context_today' is not defined

Regards :-)

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.