Merge lp:~openerp-dev/openobject-client/6.0-opw-17563-ach into lp:openobject-client/6.0

Proposed by Anup(SerpentCS)
Status: Merged
Merged at revision: 1903
Proposed branch: lp:~openerp-dev/openobject-client/6.0-opw-17563-ach
Merge into: lp:openobject-client/6.0
Diff against target: 24 lines (+7/-0)
1 file modified
bin/widget_search/custom_filter.py (+7/-0)
To merge this branch: bzr merge lp:~openerp-dev/openobject-client/6.0-opw-17563-ach
Reviewer Review Type Date Requested Status
Raphael Collet (OpenERP) Pending
Review via email: mp+75723@code.launchpad.net

Description of the change

Hello,

When you change the date format other than '%Y-%m-%d' it does not behave properly when using custom_filter.

Try to change the date format say '%Y.%m.%d' and try to search using some string '01.03.2010' It will raise Invalid Input.

This fixes the issue.

Thanks.

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

I am confused. This has nothing to do with issue 17563.
Please check the issue number.

Thanks,
Raphael

Revision history for this message
Raphael Collet (OpenERP) (rco-openerp) wrote :

Please recreate the branch with the proper name (opw-17655) instead.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/widget_search/custom_filter.py'
2--- bin/widget_search/custom_filter.py 2011-05-09 12:57:29 +0000
3+++ bin/widget_search/custom_filter.py 2011-09-16 12:05:27 +0000
4@@ -38,6 +38,10 @@
5 win_gl = glade.XML(common.terp_path("openerp.glade"),"hbox_custom_filter",gettext.textdomain())
6 self.widget = win_gl.get_widget('hbox_custom_filter')
7
8+ #Changing the date format when using custom filter
9+ self.Dt_Tm_format = tools.user_locale_format.get_datetime_format(True)
10+ self.Dt_format = tools.user_locale_format.get_date_format()
11+
12 # Processing fields
13 self.combo_fields = win_gl.get_widget('combo_fields')
14 self.field_selection = {}
15@@ -106,6 +110,9 @@
16 if right_text:
17 if field_type == 'datetime':
18 right_text = len(right_text)==10 and (right_text + ' 00:00:00') or right_text
19+ right_text = tools.datetime_util.local_to_server_timestamp(right_text, self.Dt_Tm_format, DHM_FORMAT)
20+ else:
21+ right_text = tools.datetime_util.local_to_server_timestamp(right_text, self.Dt_format, DT_FORMAT)
22 else:
23 cast_type = False
24 if cast_type: