Merge lp:~openerp-dev/openobject-addons/7.0-opw-595699-dhr into lp:openobject-addons/7.0

Proposed by Dharti Ratani(OpenERP)
Status: Approved
Approved by: Naresh(OpenERP)
Approved revision: 9309
Proposed branch: lp:~openerp-dev/openobject-addons/7.0-opw-595699-dhr
Merge into: lp:openobject-addons/7.0
Diff against target: 28 lines (+2/-2)
1 file modified
base_action_rule/base_action_rule.py (+2/-2)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/7.0-opw-595699-dhr
Reviewer Review Type Date Requested Status
Dharti Ratani(OpenERP) (community) Needs Resubmitting
Naresh(OpenERP) Pending
Review via email: mp+177317@code.launchpad.net

Description of the change

Hello Sir,

Resovlved the traceback when scheduler action executes an automated action using a time interval 'months'.

Thanks
dhr

To post a comment you must log in.
Revision history for this message
Naresh(OpenERP) (nch-openerp) wrote :

This seems fine ! but please remove the unnecessary 's' from 'months' @line 17 and 26.

9310. By Dharti Ratani(OpenERP)

[MERGE]Merged with latest

9311. By Dharti Ratani(OpenERP)

[IMP]removed extra s

Revision history for this message
Dharti Ratani(OpenERP) (dhr-openerp) wrote :

Hello sir,

Improved as per your suggestion and removed the extra 's' from months.

Thanks
dhr

review: Needs Resubmitting

Unmerged revisions

9311. By Dharti Ratani(OpenERP)

[IMP]removed extra s

9310. By Dharti Ratani(OpenERP)

[MERGE]Merged with latest

9309. By Dharti Ratani(OpenERP)

[FIX]Resolved traceback while executing an automated action using time interval months as months is not supported by timedelta

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'base_action_rule/base_action_rule.py'
2--- base_action_rule/base_action_rule.py 2013-05-29 10:42:02 +0000
3+++ base_action_rule/base_action_rule.py 2013-08-29 10:23:31 +0000
4@@ -20,6 +20,7 @@
5 ##############################################################################
6
7 from datetime import datetime, timedelta
8+from dateutil.relativedelta import relativedelta
9 import time
10 import logging
11
12@@ -33,7 +34,7 @@
13 'minutes': lambda interval: timedelta(minutes=interval),
14 'hour': lambda interval: timedelta(hours=interval),
15 'day': lambda interval: timedelta(days=interval),
16- 'month': lambda interval: timedelta(months=interval),
17+ 'month': lambda interval: relativedelta(month=interval),
18 False: lambda interval: timedelta(0),
19 }
20
21@@ -249,7 +250,6 @@
22 get_record_dt = lambda record: record[date_field]
23
24 delay = DATE_RANGE_FUNCTION[action.trg_date_range_type](action.trg_date_range)
25-
26 # process action on the records that should be executed
27 for record in model.browse(cr, uid, record_ids, context=context):
28 record_dt = get_record_dt(record)