openerp-india team mailing list archive
-
openerp-india team
-
Mailing list archive
-
Message #27361
[Bug 1190592] Re: base.action.rule is repeated ignoring the date it was last run
** Also affects: ocb-addons
Importance: Undecided
Status: New
** Also affects: ocb-addons/7.0
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Addons.
https://bugs.launchpad.net/bugs/1190592
Title:
base.action.rule is repeated ignoring the date it was last run
Status in OpenERP Community Backports (Addons):
New
Status in OpenERP Community Backports (Addons) 7.0 series:
New
Status in OpenERP Addons (modules):
Confirmed
Bug description:
This is related to:
http://help.openerp.com/question/2303/how-can-a-baseactionrule-be-run-just-one-time/
If you look at the code here:
http://bazaar.launchpad.net/~openerp/openobject-addons/trunk/view/head:/base_action_rule/base_action_rule.py#L272
if last_run and (last_run <= action_dt < now) or
(action_dt < now):
you see a misuse of the python and-or trick. What happens in that
specific case is that when (last_run <= action_dt < now) is False,
then Python checks (action_dt < now) which can easily be True.
I think this can be fixed using the inline if-else instead of the and-
or trick.
The bug seems to have been introduced just before releasing 7.0:
http://bazaar.launchpad.net/~openerp/openobject-addons/trunk/revision/8098.3.29
Thanks!
To manage notifications about this bug go to:
https://bugs.launchpad.net/ocb-addons/+bug/1190592/+subscriptions