Anup(OpenERP) has proposed merging 
lp:~openerp-dev/openobject-client/6.0-opw-17563-ach into 
lp:openobject-client/6.0.

Requested reviews:
  Raphael Collet (OpenERP) (rco-openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-client/6.0-opw-17563-ach/+merge/75723

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.
-- 
https://code.launchpad.net/~openerp-dev/openobject-client/6.0-opw-17563-ach/+merge/75723
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-client/6.0-opw-17563-ach.
=== modified file 'bin/widget_search/custom_filter.py'
--- bin/widget_search/custom_filter.py	2011-05-09 12:57:29 +0000
+++ bin/widget_search/custom_filter.py	2011-09-16 12:05:27 +0000
@@ -38,6 +38,10 @@
         win_gl = glade.XML(common.terp_path("openerp.glade"),"hbox_custom_filter",gettext.textdomain())
         self.widget = win_gl.get_widget('hbox_custom_filter')
 
+        #Changing the date format when using custom filter         
+        self.Dt_Tm_format = tools.user_locale_format.get_datetime_format(True)
+        self.Dt_format = tools.user_locale_format.get_date_format()
+        
         # Processing fields
         self.combo_fields = win_gl.get_widget('combo_fields')
         self.field_selection = {}
@@ -106,6 +110,9 @@
                         if right_text:
                             if field_type == 'datetime':
                                 right_text = len(right_text)==10 and (right_text + ' 00:00:00') or right_text
+                                right_text = tools.datetime_util.local_to_server_timestamp(right_text, self.Dt_Tm_format, DHM_FORMAT)
+                            else:
+                                right_text = tools.datetime_util.local_to_server_timestamp(right_text, self.Dt_format, DT_FORMAT)
                         else:
                             cast_type = False
                     if cast_type:

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to