[IMP] ir.filters: new filters are local to the menu/action by default
authorOlivier Dony <odo@openerp.com>
Mon, 30 Jun 2014 17:15:30 +0000 (19:15 +0200)
committerOlivier Dony <odo@openerp.com>
Tue, 1 Jul 2014 01:29:05 +0000 (03:29 +0200)
commit9132b1d3066771704e629c7303c9c339415191d4
tree0aa8be40a14fff0f04c9bd389216e567eb61f3f0
parent686fea4b3e4ea32fb63139774cbc4643ca1aecb8
[IMP] ir.filters: new filters are local to the menu/action by default

Allow binding an optional `action_id` to filters.
The web client will try to identify the specific
action ID when saving new filters. If no contextual
action exists, the filter is saved globally for
the model.

This will automatically keep filters within their
original menu when there are several menus/actions
leading to a given list of documents.
In some cases the action_id will not match the
filter model, which should be fine (e.g. when opening
a many2one completion popup for model `foo` within
a menu of model `bar`).

It is also still be possible to have a filter apply
to all actions/menus for a given model by manually
deleting the action_id value in the filter
(e.g. via the Manage Filters debug menu).

When updating a filter the action_id value is ignored
so that old global filters will be gradually replaced
by new "local" filters.

Also added an _order to ensure stable ordering of the
filters.
addons/web/static/src/js/search.js
addons/web/static/test/search.js
openerp/addons/base/ir/ir_filters.py
openerp/addons/base/ir/ir_filters.xml
openerp/addons/base/tests/test_ir_filters.py