filter by date in move_line

Bug #646590 reported by Eric Vernichon
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
Fix Released
High
Jay Vora (Serpent Consulting Services)

Bug Description

In 5.0.14 the filter by date doesn't work for move_line

If I try by script it's the same thing

ids=obj.execute(base,uid,pwd, 'account.move.line','search',[('partner_id', '=', 151), ('account_id.type', 'in', ['receivable', 'payable']),('date', '>=', '2010-01-01'), ('date', '<=', '2010-01-29')])
for id in ids:
     print obj.execute(base,uid,pwd, 'account.move.line','read',id)['date']

The result is

 2010-02-18
 2010-02-18
 2009-03-03
 2009-03-03
 2008-11-27
 2008-11-07
 2008-10-16
 2008-10-16
 2008-10-07
 2008-07-01
 2008-07-01

If I replace the expression.py by the file of the version 5.0.6, it works

Revision history for this message
Christophe CHAUVET (christophe-chauvet) wrote :

Hi

I confirmed the problem

Regards,

affects: openobject-addons → openobject-server
tags: added: regression related
Changed in openobject-server:
milestone: none → 5.0.15
status: New → Confirmed
importance: Undecided → High
Revision history for this message
jftempo (jfb-tempo-consulting) wrote :
Revision history for this message
Eric Vernichon (eric-vernichon) wrote :

yes in 5.0.6 version is OK

but the problem is how to correct that.

For me this bug is really constraining

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Hello,

Would you please apply the attached patch on https://bugs.launchpad.net/openobject-server/+bug/626806?

This is an issue of search on fields.related.

Thanks.

Revision history for this message
Eric Vernichon (eric-vernichon) wrote :

sorry but not working

Revision history for this message
Eric Vernichon (eric-vernichon) wrote :

but if I supress the faulty commit 1950 in expression.py version 5.0.14 (thank you jftempo) , it's work

I wait your solution
But in waiting , I use mine

@ -149,22 +149,21 @@
                     self.__exp[i] = ('id', 'in', right1)

                 continue
-
- if field._properties and ((not field.store) or field._fnct_search):
-
+ if field._properties:
+ if not field.store:
                 # this is a function field
- if not field._fnct_search:
- # the function field doesn't provide a search function and doesn't store
- # values in the database, so we must ignore it : we generate a dummy leaf
- self.__exp[i] = self.__DUMMY_LEAF
- else:
- subexp = field.search(cr, uid, table, left, [self.__exp[i]], context=context)
- # we assume that the expression is valid
- # we create a dummy leaf for forcing the parsing of the resulting expression
- self.__exp[i] = '&'
- self.__exp.insert(i + 1, self.__DUMMY_LEAF)
- for j, se in enumerate(subexp):
- self.__exp.insert(i + 2 + j, se)
+ if not field._fnct_search :
+ # the function field doesn't provide a search function and doesn't store
+ # values in the database, so we must ignore it : we generate a dummy leaf
+ self.__exp[i] = self.__DUMMY_LEAF
+ else:
+ subexp = field.search(cr, uid, table, left, [self.__exp[i]], context=context)
+ # we assume that the expression is valid
+ # we create a dummy leaf for forcing the parsing of the resulting expression
+ self.__exp[i] = '&'
+ self.__exp.insert(i + 1, self.__DUMMY_LEAF)
+ for j, se in enumerate(subexp):
+ self.__exp.insert(i + 2 + j, se)

                 # else, the value of the field is store in the database, so we search on it

Revision history for this message
Eric Vernichon (eric-vernichon) wrote :

but if I supress the faulty commit 1950 in expression.py version 5.0.14 (thank you jftempo) , it's work

I wait your solution
But in waiting , I use this patch

Changed in openobject-server:
status: Confirmed → In Progress
assignee: nobody → Jay (OpenERP) (jvo-openerp)
Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Hello,

Fixed in : by

Stable : 2138 <email address hidden>
Trunk : 2831 <email address hidden>

Thanks.

Changed in openobject-server:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.