Odoo Help

Welcome!

This community 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.

1

"context_today() is not defined" in marketing campaign segments. Problems with filters on date periods - openerp 7

By
giovanni crisona
on 9/5/15, 5:59 PM 652 views

1) On project I have created the following filter 'date selection': [['date_start', '>', ((context_today() - datetime.timedelta(8)).strftime('%Y-%m-%d') )]]. It works normally.

2) I have a marketing campaign addressed to 'projects' and I implement a segment using the filter 'date selection'.

The segment process stops with the following error:

File "/opt/openerp/v7/addons/marketing_campaign/marketing_campaign.py", line 358, in process_segment  criteria += eval(segment.ir_filter_id.domain)

File "/opt/openerp/v7/server/openerp/tools/safe_eval.py", line 285, in safe_eval return eval(test_expr(expr, _SAFE_OPCODES, mode=mode), globals_dict, locals_dict)

File "", line 1, in <module>

NameError: name 'context_today' is not defined

 Anyone can help me?

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 9/5/15, 5:59 PM
Seen: 652 times
Last updated: 10/27/15, 9:00 AM