Merge lp:~openerp-dev/openobject-addons/trunk-bug-907723-nco into lp:openobject-addons

Proposed by Nimesh Contractor(Open ERP)
Status: Merged
Merged at revision: 6179
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-bug-907723-nco
Merge into: lp:openobject-addons
Diff against target: 14 lines (+6/-0)
1 file modified
base_action_rule/base_action_rule.py (+6/-0)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-907723-nco
Reviewer Review Type Date Requested Status
Atul Patel(OpenERP) (community) Approve
OpenERP Core Team Pending
Review via email: mp+86931@code.launchpad.net

Description of the change

Hello,

      complete date time if date_field contains only a date.

Thanks,
 NCO

To post a comment you must log in.
Revision history for this message
Atul Patel(OpenERP) (atp-openerp) :
review: Approve

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 2011-12-22 14:10:18 +0000
3+++ base_action_rule/base_action_rule.py 2011-12-27 09:36:25 +0000
4@@ -31,6 +31,12 @@
5
6
7 def get_datetime(date_field):
8+ '''Return a datetime from a date string or a datetime string'''
9+ #complete date time if date_field contains only a date
10+ date_split = date_field.split(' ')
11+ if len(date_split) == 1:
12+ date_field = date_split[0] + " 00:00:00"
13+
14 return datetime.strptime(date_field[:19], '%Y-%m-%d %H:%M:%S')
15
16

Subscribers

People subscribed via source and target branches

to all changes: