Merge lp:~openerp-community/openobject-addons/6.0-bug-907723 into lp:openobject-addons/6.0

Proposed by Niels Huylebroeck
Status: Needs review
Proposed branch: lp:~openerp-community/openobject-addons/6.0-bug-907723
Merge into: lp:openobject-addons/6.0
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-community/openobject-addons/6.0-bug-907723
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+96126@code.launchpad.net

Description of the change

Bugfix for 907723 as already merged in trunk

To post a comment you must log in.

Unmerged revisions

5110. By Yannick Vaucher@Camptocamp

[FIX]base_action_rule: complete date time if date_field contains only a date

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 2012-02-15 10:59:41 +0000
3+++ base_action_rule/base_action_rule.py 2012-03-06 14:14:18 +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