Merge lp:~openerp-dev/openobject-addons/5.0-opw-599251-msh into lp:openobject-addons/5.0
Status: | Needs review |
---|---|
Proposed branch: | lp:~openerp-dev/openobject-addons/5.0-opw-599251-msh |
Merge into: | lp:openobject-addons/5.0 |
Diff against target: |
37 lines (+6/-3) 1 file modified
crm/crm.py (+6/-3) |
To merge this branch: | bzr merge lp:~openerp-dev/openobject-addons/5.0-opw-599251-msh |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Martin Trigaux (OpenERP) | Pending | ||
Vinay Rana (OpenERP) | Pending | ||
Naresh(OpenERP) | Pending | ||
Review via email: mp+194984@code.launchpad.net |
Description of the change
Hello,
Fixed the issue of crm.case.rule, next action date set wrong, it becomes lesser than last action, it should be atleast >= then last action, also we should execute action if last action is <= then next action because there is possibility that while defining rule user don't give any delay so last action and next action becomes equal, once it becomes equal then other rules will fails to satisy the condition always.
Demo:- Create a new rule in "CRM &
SRM/Configurati
the values:
Case State : Pending
Trigger Date: Deadline
Set state to: Open
Active :True
Save it.
Now create a new case in " CRM &
SRM/Reporting/All Cases/All Cases"
with a deadline.
For example 17.10.2013
12:30:55
Set the
state to pending and save it
Run
the cron "Check cases rules" before the deadline has passed. The field "Next Action" will be written.
Then run the cron after the deadline has passed. Now the state of the case is open and the field "Last Action" is
higher than "Next Action".
Now Set the state of the case to pending again, set a new deadline that is in the future and save it.
Run the cron again after the new deadline has passed.
Expected result:
The case in state open after the deadline has passed.
Real result:
Nothing changed.
The field "Next Action" will be written only once with the lowest date that the "_action" method can find.
In every run of the cron the condition result in the method "_action" (crm/crm.py:456-465 ) is always false, because the date of the last action is bigger then the next action.
Reason: next action date is not written when rule is executed, so when rule executed also write next action date with delay added, also we should check last_action <= next_action instead of last_action < next_action because there may be no delay at all so next_action and last_action will be the same.
Thanks.
Unmerged revisions
- 2937. By Mohammed Shekha(OpenERP)<email address hidden>
-
[FIX]CRM: Refixed the issue of crm.case.rule, next action date goes wron, it becomes lesser than last action, it should be atleast >= then last action, also we should execute action if last action is <= then next action because there is possibility that while defining rule user don't give any delay so last action and next action becomes equal, once it becomes equal then other rules will fails to satisy the condition always.