← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 634634] Re: Searching on float fields does not work properly

 

** Changed in: openobject-server
   Importance: Undecided => Medium

** Changed in: openobject-server
     Assignee: (unassigned) => OpenERP's Framework R&D (openerp-dev-framework)

-- 
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
https://bugs.launchpad.net/bugs/634634

Title:
  Searching on float fields does not work properly

Status in OpenObject Server:
  Confirmed

Bug description:
  Trying to search with [('float_field','=',3.28)] or [('float_field','=','3.28')] may not work correctly because OpenERP converts the value in the right into float before doing the search in the database. This is an issue because it means that one cannot relay on the search, even if the field in the database is NUMERIC instead of FLOAT. The reason is that the final query may end up being:

WHERE float_field = 3.2800012

which will not exist.

The attached patch, checks if field is of type float and allows [('float_field','=','3.28')] to be used and thus allow searching for exact numbers.