Commit Graph

377 Commits

Author SHA1 Message Date
Christophe Simonis dc9bcf479d [FIX] Allow search on `_inherits` fields.
As `_inherits` fields are now handled via `related`
fields (not stored, obviously), a new descriptor
`searchable` has been added to `fields_get()` result
to indicated if the field is searchable or not.
2014-08-06 15:01:01 +02:00
Denis Ledoux 64ed698a58 [FIX] web: return _super deferred in start method
Forget to include the _super method in the deferred returned by the start function of the search view
See previous rev. 70605240a9
2014-07-29 19:43:56 +02:00
Denis Ledoux 70605240a9 [FIX] web: headless search views are ready from start
function start, line 783, filters_ready waits for fields_view_get deferred to be resolved before calling prepare_filters, which prepare the view filters.

The thing is that, at line 416, if this.headless boolean is true, the searchview is marked as ready (by resolving the this.ready deferred), and the fields_view_get deferred will never be resolved, as it is resolved in the else case, where the this.headless boolean is false.

Therefore, in this.headless true case, this prevents the deferred $.when(this._super(), filters_ready) to be resolved, as the deferred filters_ready will never be resolved. Therefore, the deferred returned by the start function is never resolved, and the searchview will never be regarded as ready neither.

In views.js, the ViewManager is marked as ready when the deferred manager_ready = $.when(searchview_loaded, main_view_loaded, this.view_completely_inited) is resolved. In the this.headless true case, as the searchview is never marked as ready, the manager isn't neither.

This leaded to some issues, like the action buttons in form views being disabled on click, and never re-enabled once the action/wizard executed. See opw-610723
2014-07-29 19:38:28 +02:00
Géry Debongnie 4ab85f2fb3 [FIX] prevent an incorrect state in autocompletion
When going up and wrapping around, the focus was on a hidden separator,
so hitting enter = stacktrace.  Now, the focus goes on the last
selectable list item.-
2014-07-01 09:39:26 +02:00
Olivier Dony 9132b1d306 [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.
2014-07-01 03:29:05 +02:00
Olivier Dony 686fea4b3e [IMP] search views: more generic name for saved filters
Also rename variables to a more neutral term
that will hopefully remain untouched (custom filters)
regardless of the UI label.
2014-07-01 03:29:04 +02:00
Géry Debongnie 88bb66e784 [FIX] fix tests in autocompletion 2014-06-30 16:13:02 +02:00
Géry Debongnie cde4ad1159 [IMP] remove useless code
the 'first' attribute is not used anymore
2014-06-30 14:58:12 +02:00
Géry Debongnie 2c43d60518 [FIX] don't display separators in the drawer
now, separators (defined by the tag 'group'!) are only displayed
in the autocomplete and not in the searchview drawer
2014-06-30 14:42:05 +02:00
Géry Debongnie e556fd735e [FIX] ignore separators when moving in autocomplet 2014-06-27 13:57:33 +02:00
Géry Debongnie 512f7acfdc [IMP] autocomplete now display separators
separators given in the search view are now displayed
in the autocomplete widget
2014-06-27 12:05:34 +02:00
Géry Debongnie 3c1c6888ba [FIX] fix 2 display bugs with expand autocomplete
* the order was reversed
* there was an useless facet with just the string name
2014-06-27 11:40:37 +02:00
Géry Debongnie 0a4a7f3d20 [IMP] new autocomplete widget
Task #5009

This new autocomplete widget (the one used in the search bar) does not
do remote calls automatically, but on demand. In theory, it should lead
to a better user experience, not having the ui blocked every time long
remote calls are done.

It also has the benefits of bringing us one step closer to not
depending on jquery.ui. Bonus point: the code is quite short (< 200 loc
i believe)
2014-06-25 13:26:41 +02:00
Christophe Simonis eef6330c55 [MERGE] forward port of branch saas-5 up to adf07a9 2014-06-19 16:23:32 +02:00
Christophe Simonis 5087612d1d [MERGE] forward port of branch saas-3 up to bf53aed 2014-06-19 15:44:07 +02:00
Christophe Simonis bf53aeda94 [MERGE] forward port of branch 7.0 up to e5533d0 2014-06-19 15:32:32 +02:00
Géry Debongnie 3d43f9d454 [FIX] fixes searchbar navigation (web client)
the code handling the keydown events was moved, but the variable this
was not adjusted accordingly, resulting in a broken navigation.

It is now possible to press LEFT and RIGHT again to move the focus
between facets.
2014-06-19 12:43:25 +02:00
Géry Debongnie 63c702f009 [IMP] better layout with pure css for web client
this patch removes javascript calls to adjust the layout.  It manages
to do the correct layout with only css, which will correct quite a few
issues.
2014-06-10 16:22:02 +02:00
Géry Debongnie c522fe6add [FIX] compute the correct offset to adjust view
the jquery method length() compute the height of its element, even if
it is diplay:none.  But in our case, we want the offset to be zero if
there is no visible view_manager_header.  (for example, general settings
in settings menu)
2014-05-30 15:10:18 +02:00
Géry Debongnie 6cbf8c5a28 [FIX] use _.isEmpty instead of Object.keys
Object.keys is not supported by all browsers (*cough* IE *cough*).
Also, bonus, isEmpty is more readable and more 'semantic'
2014-05-30 11:33:56 +02:00
Géry Debongnie 1a7101d94e [IMP] scroll back to top when opening searchview 2014-05-30 09:58:07 +02:00
Géry Debongnie 70052e1fd6 [FIX] correct some issues with scrolling area
the height of the oe_view_manager_header is variable, and the top can't
be positioned correctly with pure css without a lot of work, so this
commit adds a touch of javascript to make sure that the view is
correctly positioned.
2014-05-27 14:21:52 +02:00
Géry Debongnie bb8b659ce3 [FIX] adjust the tests after changes to the searchview
* oe_searchview_custom has been split in oe_searchview_custom and
oe_searchview_filter: a test need to take that into account
* in adjust_top, the parent might not have a $ method.
2014-05-26 16:43:04 +02:00
Géry Debongnie d657f0f598 [FIX] corrects some display problem in addon web
the drawer was displayed for all views instead of only graph views
2014-05-26 16:29:54 +02:00
Géry Debongnie e9732dab8d [FIX] fix various issues with the drawer (addon web)
* separate the css class oe_searchview_custom into oe_searchview_custom
and oe_searchview_savefilter to be able to style them independently
* by default, the drawer has display:none
* fix a bug occuring when the user removed a custom filter (it hid the
remaining filters)
2014-05-26 15:45:28 +02:00
Géry Debongnie 5e367d958c [FIX] adjust view top when header height changes
the header height is not fixed, it can change when the breadcrumbs
start a new line, or when there is only one view type (for ex, in most
reporting views).  So, the top value of the view_manager_body has to be
adjusted accordingly.
2014-05-26 14:51:47 +02:00
Géry Debongnie 8159f4a18c [IMP] improves searchview appendTo
after some thought, the extra method insert was not really necessary.
It was at first a way to force the user to give two nodes to determine
where the searchview and the drawer were to be inserted.  However,
the second node can be omitted, a perfectly reasonable default is
to append the drawer just after the searchview.

Then, the role of insert is exactly the same as appendTo, so it makes
sense to override appendTo and remove insert.  Simpler, and the job is done.
2014-05-22 09:55:04 +02:00
Géry Debongnie 36471c3955 [FIX] correctly loads default filters (addon web)
also, hide/show the custom reports list when it is empty/non empty
2014-05-21 14:27:17 +02:00
Géry Debongnie aec3ba08ae [IMP] improvements to inline searchview (web)
this commit splits the widget CustomFilters in two widgets:
CustomReports and SaveFilter.  CustomReports is the widget
displaying the list of reports, and SaveFilter obviously is the
Save Current Filter widget.

The goal was to put the custom reports in the first column and the
Save Current Filter form in the second.
2014-05-21 13:18:30 +02:00
Géry Debongnie 7c6c720425 [IMP] better architecture for searchview/drawer
Before, the searchview and the searchview drawer had to be instantiated by
the user and appended separately to their correct place.  Now, the
searchview is responsible for creating/destroying the drawer, and the
user is responsible for correctly using the insert method with
the node where the searchview/drawer are to be inserted.
2014-05-20 15:27:44 +02:00
Géry Debongnie 1c32d93115 [FIX] correctly display the searchview/drawer (addon web)
the searchview has been splitted in two widgets: SearchView and
SearchViewDrawer.  They are dependent of each other, so a drawer
has to be created for each searchview.  This was not the case in
some form views (inline, created by a wizard).
2014-05-20 11:41:28 +02:00
Géry Debongnie 72f532a463 [IMP] hide drawer when switching views (addon web)
the drawer wasn't closed when switching views, which might be a
problem when the user switches to a form view.  Also, renames the
variable 'searchview_drawer' to 'drawer'.
2014-05-20 10:54:58 +02:00
Géry Debongnie c70df56174 [IMP] lots of layout work for inline search view (addon web)
mainly to correctly style the custom filters list.
2014-05-19 17:03:05 +02:00
Géry Debongnie 646de9e5af [FIX] add support for default filters in search view
support for default filters was broken in the previous commit,
now it works again.
2014-05-19 15:40:45 +02:00
Géry Debongnie 7e6d223e9e [IMP] work on inline search view in web client
incomplete work.  So far, the search view widget has been split in
two widgets: SearchView and SearchViewDrawer.  The SearchViewDrawer
has been inserted inline, and some preliminary work has been done
to improve the layout.
2014-05-19 14:16:09 +02:00
Christophe Simonis 7a7d7febf8 [MERGE] forward port of branch saas-3 up to revid 9429 chs@openerp.com-20140424123538-rxk9got9k2on1ki1
bzr revid: chs@openerp.com-20140424131824-4ksluvhnegp7kplb
bzr revid: chs@openerp.com-20140424134533-lhhcd32n3s0m9cqk
2014-04-24 15:45:33 +02:00
Denis Ledoux 5ff7146e15 [MERGE] Forward-port of latest 7.0 bugfixes, up to rev. 4179 revid:dle@openerp.com-20140422150918-nxv2v4bcvi6u3v6g
bzr revid: dle@openerp.com-20140417101315-2pjn31wb7ald3qe4
bzr revid: dle@openerp.com-20140417161003-g3mchwrucp6ab8tu
bzr revid: dle@openerp.com-20140422160712-iq4yur3jmw5n01ar
2014-04-22 18:07:12 +02:00
Denis Ledoux 6083ed4b46 [FIX] web: abitility to do exact id matching with child_of operator for searchs on many2one fields
bzr revid: dle@openerp.com-20140422150918-nxv2v4bcvi6u3v6g
2014-04-22 17:09:18 +02:00
Gery Debongnie f584b030bc [FIX] correct fix for the scrolling problem in graph view: the view now saves its scrolling position before redrawing itself (addon web_graph)
bzr revid: ged@openerp.com-20140422150316-m51u750732re8qib
2014-04-22 17:03:16 +02:00
Olivier Dony e80a179d02 [FIX] search widgets: m2o autocompletion had been disabled when @operator or @filter_domain were set, but it was actually useful
Was disabled at rev 3878 revid:xmo@openerp.com-20131107111231-nkrllqv0afqdmix6

bzr revid: odo@openerp.com-20140326170818-sc5hqnmq89ayufso
2014-03-26 18:08:18 +01:00
Christophe Simonis 541a5d3f82 [MERGE] forward port of branch saas-2 up to revid 3904 chs@openerp.com-20140318112743-tqv492026y2pnbff
bzr revid: chs@openerp.com-20140318115516-sn3laxqseam1oz3f
2014-03-18 12:55:16 +01:00
Christophe Simonis acb010a985 [MERGE] forward port of branch 7.0 up to revid 4162 launchpad_translations_on_behalf_of_openerp-20140318062141-rdiqz2ptnz3qmxd0
bzr revid: chs@openerp.com-20140129095637-mbfz82r5pyz4dctc
bzr revid: dle@openerp.com-20140210140818-5mtk1qhheo219bm1
bzr revid: dle@openerp.com-20140214114445-krexrwm9o2nrxepk
bzr revid: mat@openerp.com-20140219111353-cxo860z7ctz7om30
bzr revid: dle@openerp.com-20140221120519-1pj3wc8kqgkr5uda
bzr revid: chs@openerp.com-20140318112743-tqv492026y2pnbff
2014-03-18 12:27:43 +01:00
Denis Ledoux 477a87e2b1 [FIX] web: widget selection on many2one in search view is deprecated, it was used in some cases but it is now pointless as the basic many2one handle these cases
bzr revid: dle@openerp.com-20140313182004-symalqn8m9offm14
2014-03-13 19:20:04 +01:00
Denis Ledoux 6e9f3ad806 [FIX] web: set z-index of 9999 for autocompletion pane of search bar, to avoid being behind jquery ui dialogs. Besides, this pane should always be on top, therefore we can assume that setting 9999 will not have bad side effects
bzr revid: dle@openerp.com-20140311104947-is5qpw71y1m2oakf
2014-03-11 11:49:47 +01:00
Olivier Dony 15a1aef33c [MERGE] Forward-port of latest saas-2 bugfixes, up to rev. 3901 dle@openerp.com-20140214114445-krexrwm9o2nrxepk
The following fixes have intentionally been reverted,
as the code has significantly changed and the bugs cannot
be reproduced:
 - web_calendar fix (revid:dle@openerp.com-20140214114258-0hcsfdwyl61gph0v)
 - CSS fix for buttons (revid:mat@openerp.com-20140213145755-txvtwqbfc83vnw9o)

bzr revid: odo@openerp.com-20140217102806-qg6kwk2jomdvvmlj
2014-02-17 11:28:06 +01:00
Denis Ledoux 749e05ccb8 [FIX] close autocomplete listing on input
Closing previously occured on search request (so that a user wouldn't be able
to select "old" data on new search request), but ``search`` is only triggered
after the search delay. Worked when delay was 0, with it being moved to 250 a
user can get results matching the previous search instead of the current one.

Trigger a closing of the current results list on any ``input`` event, which is
when text is entered in any of the searchview's ``InputView``

bzr revid: dle@openerp.com-20140210140032-06dnlxepcc5ae21f
2014-02-10 15:00:32 +01:00
Xavier Morel 0821af1af9 [FIX] close autocomplete listing on input
Closing previously occured on search request (so that a user wouldn't be able
to select "old" data on new search request), but ``search`` is only triggered
after the search delay. Worked when delay was 0, with it being moved to 250 a
user can get results matching the previous search instead of the current one.

Trigger a closing of the current results list on any ``input`` event, which is
when text is entered in any of the searchview's ``InputView``.

bzr revid: xmo@openerp.com-20140210123416-cfc0x24bfkiv4lse
2014-02-10 13:34:16 +01:00
Cecile Tonglet df0076c67d [FIX] getParent() js error when clicking to fast on menu items of dashboards
bzr revid: cto@openerp.com-20140204150544-nkuhxree6qijihq2
2014-02-04 16:05:44 +01:00
Christophe Simonis 83345e4414 [MERGE] forward port of branch saas-2 up to revid 3899 chs@openerp.com-20140129095637-mbfz82r5pyz4dctc
bzr revid: chs@openerp.com-20140129101004-44ft0oaeo201guhd
2014-01-29 11:10:04 +01:00
Martin Trigaux 263693e44e [FIX] search: add delay of 250us (was 0) on autocomplete fields in search bar and m2o fields.
This avoids making a search request for each keypressed

bzr revid: mat@openerp.com-20140120160147-q7lg4j93c836ec44
2014-01-20 17:01:47 +01:00