trunk - filter function fields

Bug #823049 reported by Ferdinand
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Web (MOVED TO GITHUB)
Fix Released
Medium
OpenERP R&D Web Team

Bug Description

trunk - funciton fields are slectable in custom filters but the filter does not work
Example
filter products real_stock is not 0 - a very common question

Related branches

Revision history for this message
Dhruti Shastri(OpenERP) (dhs-openerp) wrote :

Hello Dr. Ferdinand,

For the field real_stock, I could not find it in the drop-down list of custom filter as store=True is not applied to the field. It won't appear in the custom filter.

Did you make any changed to get the field in the list ?

Related to the problem I have checked similar example in crm.lead.
Fields "Day to Open" and it is working normally (shown in screenshot).

Let me know if I am missing anything.

Thanks.

Changed in openobject-server:
status: New → Incomplete
Revision history for this message
Ferdinand (office-chricar) wrote :

Please see attachment
I am using
http://client-web-trunk.runbot.openerp.com:9405

Changed in openobject-server:
status: Incomplete → New
Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

Confirming, but this is in the wrong project as it is related to the new (6.1) web client.
Just tried with the 6.0 one on the same runbot db you mentioned (but on port 9305 for the previous web), and 'Real Stock' is not in the custom filters of Products.

affects: openobject-server → openerp-web
Changed in openerp-web:
assignee: nobody → OpenERP R&D Web Team (openerp-dev-web)
status: New → Confirmed
importance: Undecided → Low
milestone: none → 6.1
Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

Just to compare with previous web client, here is an equivalent screenshot from http://client-web-trunk.runbot.openerp.com:9305 where non-stored function fields are not available as custom filters.

Revision history for this message
Ferdinand (office-chricar) wrote :

@Olivier
isn't "trunk" the upcoming 6.1?
I mention this in the subject of the report

Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote : Re: [Bug 823049] Re: trunk - filter function fields

On 08/10/2011 08:24 AM, Ferdinand @ Camptocamp wrote:
> @Olivier
> isn't "trunk" the upcoming 6.1?
> I mention this in the subject of the report

Yes the current trunk is the upcoming 6.1, why do you ask?

By wrong project I meant "server" -> "web", as it appears to be a web
issue. The reference to the web-6.0 on runbot was to illustrate why it
looks like a web-6.1 issue: it cannot be reproduced in web-6.0 *with the
same trunk/6.1 server/addons* :-)

Revision history for this message
Ferdinand (office-chricar) wrote :

as far as i understood all filtering and sorting is to be done on the server side in the future ?
so i do not know if the web client does not send it or the server does not do it.
it should work on GTK too (I didn*t test yet, too time consuming)

Revision history for this message
Ferdinand (office-chricar) wrote :

BTW also properties must be selectable
example
partner - accounting - payable account
http://server-trunk.runbot.openerp.com:9402
the field is shown but filter is not applied

Changed in openerp-web:
importance: Low → Medium
Changed in openerp-web:
milestone: 6.1 → none
Revision history for this message
Xavier (Open ERP) (xmo-deactivatedaccount) wrote :

Fixed in revision <email address hidden>: advanced filters don't display non-searchable function fields (function fields with stored=False which do not have a fnct_search) in the dropdown.

Changed in openerp-web:
status: Confirmed → Fix Released
Revision history for this message
Ferdinand (office-chricar) wrote :

Hello!
I have checked
http://web-trunk.runbot.openerp.com:9400/web/webclient/home?debug=#
of today
and tried to filter for products quantity availalbe != 0 ( very important IMHO should be a button !!!!)

the field
stock.py: 'stock_available': fields.function(_get_stock, fnct_search=_stock_search, type="float", string="Available", select=True,
is not available even though it should be accoding to comment #9

or do I missunderstand "in the dropdown" ?
or is it not merged ?

Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

Reopening to double-check Ferdinand's case, AFAICS that field should be available in the custom filters.

Changed in openerp-web:
status: Fix Released → Confirmed
Revision history for this message
Xavier (Open ERP) (xmo-deactivatedaccount) wrote :

Closing the bug again, the "Available" field is indeed available in advanced search of production lots, you can check at the URL you provided. See attached screenshot.

Changed in openerp-web:
status: Confirmed → Fix Released
Revision history for this message
Xavier (Open ERP) (xmo-deactivatedaccount) wrote :

Furthermore, I do not know which view you tested (I went to Warehouse > Traceability > Production Lots), note that the default filter is "stock_available > 0" (via the "Available" button).

Revision history for this message
Ferdinand (office-chricar) wrote :

#13
I went to warehouse - product - products
I just realized that i was checking the wrong module - sorry

in
product/product.py
        'qty_available': fields.function(_product_qty_available, type='float', string='Quantity On Hand'),
        'virtual_available': fields.function(_product_virtual_available, type='float', string='Quantity Available'),
the fnct_search as well as the buttons "QTY Available !=0" "QTY on Hand !=0" and is (badly) missing

especially if context location_id = "my search location" with only a few not 0 products

BTW
Warehouse > Traceability > Production Lots
is not available for the demo user

Revision history for this message
Xavier (Open ERP) (xmo-deactivatedaccount) wrote :

> 'qty_available': fields.function(_product_qty_available, type='float', string='Quantity On Hand'),
> 'virtual_available': fields.function(_product_virtual_available, type='float', string='Quantity Available'),
> the fnct_search as well as the buttons "QTY Available !=0" "QTY on Hand !=0" and is (badly) missing

Right, so the web client fix works as expected and the issue is in the model definitions in the addons correct?

> Warehouse > Traceability > Production Lots
> is not available for the demo user

This issue, along with the one above, should probably be reported to the addons team.

Revision history for this message
Ferdinand (office-chricar) wrote :

please read here for serverside search and sort of function fields
http://www.camptocamp.com/fr/blog/2011/10/sort-and-filter-options-for-function-fields-in-openerp/

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.