Odoo Help


context_today in Tasks

Mohamed Hagag
on 12/27/13, 12:34 PM 1,768 views


I created a filter to filter tasks with no work in the last day, and it's working fine while applying it in filters.

While the filter is linked with automated action I get this error when i try to create or modify a task I get an error with :

openerp/addons/base_action_rule/base_action_rule.py", line 101, in _filter
    domain = [('id', 'in', record_ids)] + eval(action_filter.domain)
  File "<string>", line 1, in <module>
 NameError: name 'context_today' is not defined

If there's no automated action linked with the filter - I can modify tasks normally without errors.

The domain in the filter is:

['&', ['write_date', '<', ((context_today() - relativedelta(days=1)).strftime('%Y-%m-%d'))], ['progress', '<', 100]]

Can anyone tell me what's the problem ?

I have the same issue. Filter is working in the search. But when I use it with automated action I get the same error. Anyone an idea what to use if you want to work with this filter in an Automated action?

Geert Surkijn
on 1/21/14, 5:41 PM
Geert Surkijn
On 2/1/14, 11:39 AM

If someone could help us out here with some kind of directions what to do, would be much appreciated :)

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 12/27/13, 12:34 PM
Seen: 1768 times
Last updated: 3/16/15, 8:10 AM