Odoo Help


Alerts for contract expiration

on 7/17/14, 3:04 AM 1,722 views

I read the question "How to configure alerts for employee contract expiration" and I followed the video to configure an Automated Action that send me an email a month before a contract expire, but for me this does not work.

This is my configuration screenshots: http://www.yogile.com/bf2om8i3#41m

In the log file I see the scheduler running:

openerp.addons.base.ir.ir_cron: Starting job `Check Action Rules`.
openerp.addons.base.ir.ir_cron: cron.object.execute(u'test', 1, '*', u'base.action.rule', u'_check')
openerp.addons.base.ir.ir_cron: 0.005s (base.action.rule, _check)

But no email arrives in my mailbox.

I tried different things and I checked the record directly on the database, but I'm not able to discover the problem.

Someone can help me, please?

I tried http://www.yogile.com/t26qv3he#41m but nothing happened.. I also tried to create a new contract (because of the sentence "An action rule is checked when you create or modify the "Related Document Model"") that satisfy the trigger, but nothing happened

on 7/18/14, 10:55 AM

Ludo - 21South

--Ludo - 21South--
| 2 2 5
Zwijndrecht, Netherlands
--Ludo - 21South--


Ludo - 21South
On 7/17/14, 5:01 AM

Maybe you should first try to send a message to the commandline, so you can see the scheduler actually works. Once you have confirmed that you should try to manually send out emails. If both work, check that mails do not get stuck in the outbox of your account.

On 7/18/14, 10:59 AM

I know that the Automated Action is checked because of a bug (?)

If for "Delay After Trigger Date" field I set "Months" i can read in the logs:

ERROR test openerp.addons.base.ir.ir_cron: Call of self.pool.get('base.action.rule')._check(cr, uid, *()) failed in Job 6
Traceback (most recent call last):
  File "/opt/openerp/oe/server/openerp/addons/base/ir/ir_cron.py", line 136, in _callback
    method(cr, uid, *args)
  File "/opt/openerp/oe/addons/base_action_rule/base_action_rule.py", line 261, in _check
    delay = DATE_RANGE_FUNCTION[action.trg_date_range_type](action.trg_date_range)
  File "/opt/openerp/oe/addons/base_action_rule/base_action_rule.py", line 37, in <lambda>
    'month': lambda interval: timedelta(months=interval),
TypeError: 'months' is an invalid keyword argument for this function

Thank you Med Said BARA. I review the steps and all it's ok. I discovered that if I delete and recreate the Automated Action, it works correctly but ONLY FOR THE FIRST TIME (an email arrives to my mailbox as I expect), then stop to work even if the scheduler still check the action.

on 7/19/14, 3:07 AM

I discovered that after the first time the "run" method of addons/base/ir/ir_actions.py is not executed.

on 7/19/14, 4:02 AM

In the form "Check Action Rules" there is a field "doall : Repeat Missed" (to be checked or unchecked) which "Specify if missed occurences should be executed when the server restart". this also means that if the action succeeded it will not be repeated. I think this is why the action could not be run after running successfully the first time.

Med Said BARA
on 7/21/14, 6:56 PM

Thank you again Med Said BARA. I already tried to check that flag, but nothing changes: the action will be execute only the first time. Now I think this is another bug.

on 7/23/14, 2:43 AM

Med Said BARA

--Med Said BARA--

| 5 5 7
--Med Said BARA--
Med Said BARA
On 7/19/14, 12:57 AM

1- As stated by Ludo-Neobis begin by checking if your mail system is configured correctly (Outgoing Server - SMTP).

2- The error indicated in your LOG: "months" is an invalid keyword.

Perhaps, it's a bug.

3- Try to use: -30 Days instead, to see if it works.

4- Try to review the steps here:  https://www.odoo.com/forum/help-1/question/trigger-an-action-on-date-field-a-step-by-step-guide-48945#answer-48970


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: 7/17/14, 3:04 AM
Seen: 1722 times
Last updated: 3/16/15, 8:10 AM