Commit Graph

388 Commits

Author SHA1 Message Date
Denis Ledoux d9e48bae42 [MERGE] forward port of branch saas-3 up to 7ab4137 2014-11-14 16:58:24 +01:00
Denis Ledoux 7ab413724a [MERGE] forward port of branch 7.0 up to da15c9d 2014-11-14 15:59:33 +01:00
Rifakat Haradwala 69d60465ee [FIX] web: date autocompletion should use user's locale
search bar does not suggest date field format based on user's locale and always shows based on mmddyy using Date.parse,  opw:615276

Note: starting in 9.0, datejs has been replaced by momentjs, so this
problem should be solved in a better way.
2014-11-13 11:12:49 +01:00
Géry Debongnie e6a2d222d6 [FIX] correctly expand many2ones in autocompletion
The ManyToOneField widget evaluated the domain before doing a name_search,
but the domain should not be evaluated client side, because it can only
be static at that point. It caused crash in autocompletion because
some variables could not be found in the context (see stage_id in
project.task for example)
2014-09-18 11:04:01 +02:00
Mohammed Shekha 0db0df437a [FIX] web: traceback in search view when no field 2014-09-16 11:37:48 +02:00
Géry Debongnie 53a5c6d241 [FIX] correct domain for autocomplete in many2one
The domain was using '=', which is correct when selecting a specific
element in autocompletion, but not when searching for all elements
matching a string.
2014-08-20 11:55:15 +02:00
Olivier Dony e11eddf753 [MERGE] Forward-port of saas-5 up to 20cc18d 2014-08-13 20:46:47 +02:00
Denis Ledoux b49755b545 [MERGE] forward port of branch saas-3 up to 591326c 2014-08-13 10:29:14 +02:00
Denis Ledoux 8a7728790b [MERGE] forward port of branch 7.0 up to 60ab6f1 2014-08-12 17:49:12 +02:00
Martin Trigaux 7a50b3b057 [FIX] web: missing self initialisation
The self is needed in the _value() method below, opw 608878
2014-08-12 16:08:30 +02:00
Christophe Simonis 135962184d [FIX] web: make search by `id` possible.
+ correct tests
2014-08-06 17:27:27 +02:00
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