Commit Graph
334 Commits
Author SHA1 Message Date
Christophe Simonis 658989868c [MERGE] forward port of branch saas-10 up to aa6ebd1 2016-04-05 20:08:50 +02:00
Christophe Simonis aa6ebd146a [MERGE] forward port of branch saas-9 up to 549daaa 2016-04-05 19:27:34 +02:00
Joren Van Onder 7318ab6710 [FIX] web_calendar: fix read_slice race condition
When quickly changing the range in the calendar view, multiple
asynchronous read_slice requests will be launched. The read_slice
returns the records and sets the ids property on the dataset according
to a set domain, context etc.

This creates a race condition because although the read_slice calls will
be launched in the correct order, there is no guarantee that they will
resolve in the correct order. In practice issues will occur quite
frequently on a slower connection and with a big read followed by a
small read. The big read that matches a lot of records will be slower to
complete than the small read which will result in it resolving later
than the small read. This causes the dataset to not be in sync with the
rest of the view. When you click on an affected event everything will
look fine in the popup, but when clicking on edit the form view will
show a new event instead. The reason for this is that switching to the
form view requires a correct dataset.index, which is set by
dataset.get_id_index(id) which won't exist.

A potential way of fixing this would be guaranteeing the order of
read_slice calls by only allowing one of them to be active at a
time. This would not be ideal because you could end up with a long chain
of read_slice calls when changing the range fast on a slow
connection. In theory the UI would have to block as well then.

Instead of that, we will simply ignore responses to out-of-date
requests. This is done by manually resetting the ids property of the
dataset to its previous value when we detect the range of the calendar
has changed since the read_slice call was launched.

opw-673425
2016-04-05 09:29:53 +02:00
Christophe Simonis 79976bd779 [MERGE] forward port of branch saas-10 up to 6e95659 2016-04-01 19:10:34 +02:00
Christophe Simonis 6e95659a08 [MERGE] forward port of branch saas-9 up to f4d1adc 2016-04-01 18:51:55 +02:00
Denis Ledoux 69fa2d5662 [MERGE] forward port of branch saas-6 up to 8f1782b 2016-03-30 11:23:18 +02:00
Nicolas Lempereur 9be7a9535c [IMP] web_calendar: matching pivot and calendar week number
To format Week numbers in the pivot view, babel is used with format
`'W'w YYYY` in the current locale (eg: en_US) which will determine
print the week in the locale week numbering type.

This is inconsistant with the fullcalendar version (1.6.4) in Odoo until
at least version 9.0 where ISO is used by default. This behaviour has
been changed in more recent version of fullcalendar and is now in tune
with pivot view, but updating fullcalendar should be done in master.

This commit customize the week numbering on the old version of
fullcalendar getting the yearned result without updating fullcalendar.

This is only possible in saas-6 since momentjs is only present since
saas-6 and is required for this fix.

closes #11522
opw-653671
opw-668711
2016-03-29 14:23:00 +02:00
Aaron Bohy 002660a9b0 [IMP] openerp, web(_*): batch views RPCs
Load the fields_view of all views of the action together. If a searchview is
required, also load its fields_view and its filters.

Use lazy-loading for fields as they are required for the Pivot and Graph
views only, and may be used by Filters and GroupBy menus of the Search view
if the users clicks on 'Add a custom Filter/Group'.

The fields are thus also loaded directly if the first view of the action is
Pivot or Graph, and otherwise, they are lazy-loaded when/if the user opens
a Pivot or Graph view, or if he wants to add a custom Filter/Group.

Some refactoring of views API as well:
- Views must now be instantiated with their fields_view
- Move code requiring fields_view from start() to init(), or willStart() for
  heavy processing.
- Remove view_type attribute from views as it was used to call
  fields_view_get.
- Remove view_id parameter to views' init as it is no longer used.
- Move duplicate code from various views' init to the View widget.
- Remove view_loading() function from views as they now follow the classical
  lifecycle of widgets (init -> willStart -> start -> destroy).
- Searchview now extends View like all other views.
- Remove useless function guard_active() as it was used for the form_view's
  action buttons to wrap handlers to ensure that they are executed only if
  the form_view is the current active view. This is not useful anymore as
  from v9, views and their control panel are appended in the DOM
  simultaneously, so one can't click on a button of a view which is not the
  current active view.
2016-03-18 10:44:52 +01:00
Aaron Bohy b816cdbea9 [FIX] web(_*): views: render action buttons in dialogs
Commit 516b1a6c72 fixes a bug with action buttons not being displayed when they
should in dialogs. However, it makes the assumption that either $node or
this.options.$buttons exist, which is not always the case (e.g. dashboard).

This rev. moves that logic out of the views to the view_manager, and protects
the call of empty() on this.options.$buttons.
2016-02-29 08:47:20 +01:00
Christophe Simonis 60c9cac46b [MERGE] forward port of branch saas-9 up to 87a01c7 2016-02-17 18:07:21 +01:00
Nicolas Lempereur 924c2dee21 [FIX] {web_,}calendar: order contact sidebar
In 22051dc, the sidebar contacts of the calendar were ordered, this does
it in another way to solve several issues when selecting filters.
2016-02-11 16:34:33 +01:00
Nicolas Lempereur fb7bb95a11 [FIX] web_calendar: operator prirority typo from e029724 2016-02-11 16:34:33 +01:00
Yenthe e72afefaa7 [IMP] web_calendar: Remove one2one reference
This one2one reference is no longer needed since one2one fields have been
deprecated for ages

Closes #10746
2016-02-04 14:57:52 +01:00
Nicolas Martinelli faf781c550 [FIX] web_calendar: title of dialog
The title of the parent is located in the "title" field.

opw-666577
2016-01-25 17:55:43 +01:00
Martin Trigaux 8b4f052a38 [MERGE] Forwardport of branch saas-6 up to c649bb0df 2016-01-05 18:28:06 +01:00
Denis Ledoux aef8a4d618 [MERGE] forward port of branch 8.0 up to f9f7669 2015-12-21 18:24:22 +01:00
Nicolas Lempereur 73d5f62acd [IMP] web_calendar: refresh event after fail
If an event is moved at another time, its appearance would only be
refreshed if it was successful. But in this particular instance, the
refresh may even be more useful when the change failed.

part of #9837

second half of:
opw-657863
2015-12-10 17:01:49 +01:00
Martin Trigaux e029724403 [FIX] web_calendar: safer evaluation of color filters
In some loading cases, the all_filters may not be loaded yet so fail at the evaluation.
Making it safer and check the content.
opw 659052
2015-12-09 16:11:00 +01:00
Christophe Simonis 56a442e205 [MERGE] forward port of branch saas-6 up to dade7e3 2015-11-25 13:26:02 +01:00
Denis Ledoux d47ee18fef [MERGE] forward port of branch 8.0 up to c9fce1a 2015-11-17 13:19:14 +01:00
Xavier ALT 2f35c40714 [FIX] web_calendar: date/datetime fields format in calendar views
As everywhere else, dates & datetimes must be formatted according
to the format defined in the `res.lang` of the user, and within
the timezone of the user.

Before this revision, when adding a datetime field to a calendar view,
the raw value of the date was displayed, for instance:
`2015-01-01 10:00:00`
instead of
`01/01/2015 11:00:00`
for a user in English(US), in UTC +1.

fixes #5324
opw-653625
2015-11-04 12:47:28 +01:00
qsm-odoo 91ffe91f7d [IMP] web_calendar: calendar dimension/scroll/resize
The calendar has now a minimum height so that it appears bigger in
mobile. In mobile the height cannot be computed to maximum because
the webclient has not 100% fixed height. The height has been set
so that in appears maximum on a 720p android mobile on chrome at
the time of this commit.

The calendar is now also resizing itself correctly after a window
resize.

Before this commit, it was impossible to scroll the calendar
horizontally if needed. Notice that the solution breaks the full
calendar layout and require JS scrolling so that the events are
still positionned correctly.
2015-09-29 15:14:39 +02:00
qsm-odoo 4e20e44303 [FIX] web_calendar: calendar height
Calendar height was again a problem since the introduction of the
bootstrap layout (the .row had not height 100% and thus the calendar
was not able to compute its height anymore).
2015-09-25 18:10:55 +02:00
Thibault Delavallée 30e2d45ba7 [FIX] web_calendar: CompoundDomainnow in data, not instance.web anymore 2015-09-24 16:20:53 +02:00
Christophe Simonis 57168a9e90 [MERGE] forward port of branch saas-6 up to a669433 2015-09-23 14:34:26 +02:00
Olivier Dony 43a12e99bd [FIX] calendar: filter events by attendees when sidebar is used with useContacts
Add some missing deferred chains + change domain for loading calendar.events.
2015-09-17 13:57:04 +02:00
Christophe Simonis fb83a5479c [FIX] web_calendar: allow destroy of a non-loaded view 2015-09-07 12:08:08 +02:00
qsm-odoo 86f62ee559 [FIX] web_calendar: Calendar LESS layout (bootstrap)
Calendar row was not in a container and had so alignement problems
since the reintroduction of bootstrap grid gutter.
2015-09-02 13:22:36 +02:00
Christophe Simonis fc68565ea2 [FIX] web_calendar: fix typo in template 2015-08-24 20:45:46 +02:00
Christophe Matthieu 6baf611df1 [IMP] web: create generic controller '/web/content' and '/web/image'
Replace deprecate controllers like /web/binary/image, /web/binary/saveas...
Use ETag for all content with 'unique' option to cache the content if the content is never changed.
2015-08-21 22:06:52 +02:00
Christophe Matthieu ea3bfe1bd5 [FIX] web: readonly fields not transferred from dialog to 2many field
Transfer options to 'data_create' and 'data_update'
Add tour to check the fix
2015-08-17 10:17:58 +02:00
Aaron Bohy 6658c65851 [IMP] web_calendar: quick create: generic text
as the quick create is also used to create e.g. leads, not only events.
2015-08-17 09:27:44 +02:00
Aaron Bohy 40971b1b4f [FIX] calendar,web_calendar: calendar.event: start field readonly
The start field is a computed field but it doesn't have any inverse function
(write() is overridden in calendar.event to, among other things, play the
role of the missing inverse function). It is thus automatically set as
readonly, and the events can't be dragged and dropped in the calendar view,
since rev. d6d3d098 in which we start checking if the start_date is readonly
or not before allowing the drag and drop.

This rev. simply adds a "do_nothing" inverse function so that the date field
is not readonly.

In web_calendar, the date_start attribute is mandatory so fallbacking on
date_end and date_delay is unnecessary.
2015-08-12 15:39:15 +02:00
Aaron Bohy 10f2df8e59 [REF] web(_*): views: view_switcher icon
Add a key icon in the view's prototype corresponding to the font-awesome icon
to display in the view switcher.
2015-08-07 14:05:07 +02:00
Christophe Simonis 95ac2cfd10 [MERGE] forward port of branch saas-6 up to be58335 2015-08-06 16:09:19 +02:00
Christophe Simonis 3d26eb02ab [MERGE] forward port of branch 8.0 up to d3e9bde 2015-08-06 11:54:32 +02:00
Denis Ledoux 91417516ae [FIX] web_calendar: use of selection fields as color filters
Using a selection field as color filters in a calendar view
had as effect to display the second letter of the state name
(The state name string, index 1)
as filter, instead of the full state name.

Besides, the colors of the filters did not match.

e.g., Sales > Sales > Sales Orders > Calendar View

opw-646486
2015-08-05 14:25:45 +02:00
qsm-odoo f330d35324 [FIX] web_calendar: double scrollbar + hour format
* Change 12A -> 11A in 12am -> 11pm
* Compute calendar height so that it fits the web client content height
2015-08-05 11:48:40 +02:00
qsm-odoo 82e166bb6f [FIX] (web_)calendar: Refresh code + Filters
- Contact filters were dropped with the new design
- The 'me' filter was not working correctly (wrong colors)
- Remove some useless/unnecessary code
- Use new API confirm dialogs
- Convert CSS to LESS
2015-07-29 15:00:06 +02:00
Christophe Simonis 2cf91d16a5 [MERGE] forward port of branch saas-6 up to 63e92cb 2015-07-22 16:17:54 +02:00
Aaron Bohy 27df65c878 [IMP] board,google_spreadsheet,web,web_calendar: Favorites menu
Adapt the Favorites menu so that addons appending stuff in it are compliant with
the enterprise edition.

Mainly, creation of dashboard.less from of dashboard.sass so that we can use mixins
defined in the web addon.

Some changes as well in the dashboard view to make it compliant with the enterprise
edition.

Use correct naming convention: classnames with underscores, less mixins with hyphens.
2015-07-15 13:32:56 +02:00
Aaron Bohy 45373eb1fc [REM] web_calendar: unused css
it has been converted into less by rev. 46bf047e86 and
is unused since rev. d6d3d0983f.
2015-07-15 13:32:28 +02:00
Christophe Matthieu 500c33b184 [IMP] web: split model.js into model.js and data_model.js. Web js modules must call web.DataModel. 2015-07-10 16:32:35 +02:00
Aaron Bohy 9de57b7a7b [IMP] web_calendar: fine tuning less
Use webclient horizontal padding in calendar view for its content
to be well aligned with the rest of the webclient.
2015-07-06 16:07:09 +02:00
Christophe Simonis 4c2a1de75a [MERGE] forward port of branch 8.0 up to 22bd3bd 2015-07-01 18:11:32 +02:00
Olivier Dony e3bd2a5914 [FIX] web_calendar, website: avoid rendering errors with special characters 2015-07-01 17:58:28 +02:00
Christophe Simonis a304194936 [MERGE] forward port of branch saas-6 up to 81b5c60 2015-06-25 00:26:31 +02:00
qsm-odoo 46bf047e86 [IMP] web, web_*, mail, board : New modals and dialogs 2015-06-17 09:49:46 +02:00
qsm-odoo d6d3d0983f [IMP] web, web_calendar: New calendar 2015-06-17 09:49:46 +02:00
Christophe Simonis 4647778758 [MERGE] forward port of branch 8.0 up to ea59856 2015-06-15 12:28:32 +02:00