Commit Graph
75 Commits
Author SHA1 Message Date
Mathieu Duckerts-Antoine ba4ce71bf5 [FIX] web: favorites have unique descriptions
In the favorites menu, it was possible to create two
favorites with the same name (contrarily to the
specifications). The root cause of the problem was that
the submenus of the favorites menu were not updated at
all. This commit fixes that situation.

closes odoo/odoo#35495

Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2019-08-07 15:24:06 +00:00
Mathieu Duckerts-Antoine 691a8a690c [FIX] web: toggle favorite correctly updates other filters status
When toggling a favorite filter, the options used by
the active date filters/groupbys and the field created
via autocompletion were not correctly cleared, leading
to strange situations. This is fixed by this commit.
2019-08-07 15:10:57 +00:00
Mathieu Duckerts-Antoine 1631c9dbc9 [FIX] web: date filter options unselected after facet deletion
Select the option 'This Month' of a date filter
in the filter menu and then remove the facet created
correctly toggles the filter from the query but the
option is still shown as selected. This commit fixes
that situation.

closes odoo/odoo#35340

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-07-31 12:35:48 +00:00
Mathieu Duckerts-Antoine 3184059071 [FIX] web: no forced date matching in pie charts
In a graph view in mode 'pie', a matching of dates was
attempted each time a comparison and a grouping of data
using the same date/datetime field was done.
Unfortunately, since the read groups results are ordered using
the order of groupbys, the matching was not sensible in case
the date/datetime field was not the first groupby.
We thus restrict the matching to the sole case where it is
sensible. More work should be done to have sensible matchings
in all situations.

closes odoo/odoo#34379

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-07-16 07:55:04 +00:00
Mathieu Duckerts-Antoine 6ef6881a12 [FIX] web: style chart elements in graph views only locally
The elements style was set globally and thus used to modify
the style of any chart in Odoo after the first loading of a
graph view. For instance, the charts drawn in
sale_subscription_dashboard are not the same before and after
the first loading of a graph view. This is fixed by this
commit.
2019-07-16 07:55:04 +00:00
Mathieu Duckerts-Antoine a87cbcadbc [FIX] web: appropriate symbol in mobile embedded graph view groupby menu 2019-07-16 07:55:04 +00:00
Mathieu Duckerts-Antoine 89d5cc3b3d [FIX] web: measure/groupby many2one variation in pivot view
In case a many2one field (let us say 'foo') is used
simultaneously as a groupby and a measure in the pivot view,
the values returned by a read_group for that many2one are of
the form [id, label] and the aggregated values (always 1) are
missing in the read_group results (datapoints).
Thus typically, a datapoint is of the form

{'foo': [1, 'Bar'], '__count': 4, ...}

and does not contain information on the 'foo:count_distinct'
value (this is a read_group bug).

As a consequence, a special processing of the read_group
datapoints is done in the pivot model to handle that
situation and the value for 'foo:count_distinct' is infered
correctly to be 1.

In the pivot comparison mode, datapoints comming from the
period and the comparison period (data and comparisonData
sets) are identified if they have same values for the groupby
fields and the measure values become small objects containing
information on the the measure values for data and for
comparisonData and on the related variation.

Thus

{foo: [1, 'Bar'], __count: 4, ...}

from data and

{foo: [1, 'Bar'], __count: 3, ...}

from comparisonData should become a single datapoint

{
foo: [1, 'Bar'],
__count: {
data: 4,
comparisonData: 3,
variation: {
magnitude: +33 (%)
}
}
fooAggregate: {
data: 1,
comparisonData: 1,
variation: {
magnitude: 0 (%)
}
}

It turns out that the code responsible for merging the data
and comparison datapoints made a mistake by mixing the keys
'foo' and 'fooAggregate', with the consequence that the
variations were not correctly computed in the situation
described above.

This is fixed in this commit.

closes odoo/odoo#33118

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-06-25 11:18:02 +00:00
Mathieu Duckerts-Antoine 92a1f215c0 [FIX] web: pie chart structure not modified by favorites
A pie chart widget aims to instantiate a graph view in mode
'pie', with a measure and a single groupby specified via some
attributes. It turns out that if a pie chart is instantiated
in a context in which the keys 'graph_mode', 'graph_measure',
and 'graph_groupbys' are present, that keys prevail over the
pie chart specification. This can produce a line chart for
instance. This fix corrects that situation.

A test has been added in a corresponding commit in enterprise
(historically, the pie chart widgets are tested in dashboard
views).

closes odoo/odoo#34234

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-06-19 08:36:44 +00:00
Mathieu Duckerts-Antoine 98e4540fe9 [FIX] web: call super in AbstractAction willStart
The commit https://github.com/odoo/enterprise/commit/19a144d6af2974e964c6487170e6bca1b14d3898 has
modified how libraries are loaded at several places and has
introduced a bug in sale_subscription_dashboard where the
libraries are no longer loaded at all. We fix that situation
by calling super in the willStart method of AbstractAction
that inherits from Widget. Abstract actions can now also
benefit from the mechanism present in Widget willStart.

closes odoo/odoo#32209

Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2019-03-28 12:47:01 +00:00
Mathieu Duckerts-Antoine 596206cdf6 [IMP] web: remove nvd3 library
It has been decided to use Chart.js instead of nvd3 to render charts.
Now that nvd3 is no more in use, we remove it.

Task ID: 1946138
2019-04-01 14:40:51 +00:00
Mathieu Duckerts-Antoine 0eba50dd1c [IMP] survey: use Chart.js instead of nvd3 in survey results
This commit is one part of the task 'removing nvd3'.
We use now Chart.js to draw charts.

Task ID: 1946138
2019-04-01 14:40:51 +00:00
Mathieu Duckerts-Antoine 0d7ebb6d14 [IMP] sales_team: remove useless css rules
This commit is one part of the task 'removing nvd3'.
We use now Chart.js to draw charts. This makes old CSS rules
related to nvd3 useless.

Task ID: 1946138
2019-04-01 14:40:51 +00:00
Mathieu Duckerts-Antoine 3ab3082a32 [IMP] website: use Chart.js in community dashboard
This commit is one part of the task 'removing nvd3'.
We use now Chart.js to draw charts.

Task ID: 1946138
2019-04-01 14:40:51 +00:00
Mathieu Duckerts-Antoine 604c43640a [IMP] web: use Chart.js in graph view
It has been decided to use Chart.js instead of nvd3 to render charts.
In this commit the graph view has been largely rewritten to benefit
from the options offered by Chart.js.

Task ID: 1946138
2019-04-01 14:40:51 +00:00
Mathieu Duckerts-Antoine a8d3ca771f [IMP] web: add library Chart.js
This commit makes possible to use the Chart.js library to create
various charts.

Task ID: 1946138
2019-04-01 14:40:51 +00:00
Mathieu Duckerts-Antoine a9bcb12f64 [IMP] web: graph view improvements
This commit extends the support of comparison mode for the graph view
and refine the tooltips and rendering in line mode.
The graph view code has also been slightly refactored.

Task ID: 1946138
2019-04-01 14:40:51 +00:00
Mathieu Duckerts-Antoine d23419fd86 [FIX] web: call super in AbstractAction willStart
The commit https://github.com/odoo/enterprise/commit/19a144d6af2974e964c6487170e6bca1b14d3898 has
modified how libraries are loaded at several places and has
introduced a bug in sale_subscription_dashboard where the
libraries are no longer loaded at all. We fix that situation
by calling super in the willStart method of AbstractAction
that inherits from Widget. Abstract actions can now also
benefit from the mechanism present in Widget willStart.
2019-04-01 14:40:51 +00:00
Mathieu Duckerts-Antoine 4315e1b4aa [FIX] web: on_attach_callback of form renderer widgets
Before this commit, the 'on_attach_callback' method of a subwidget of
the form renderer would not be called when the renderer renders
itself but is already in the dom. This can cause problems when a
subwidget has to know if it is in the dom for its own rendering.
This commit fixes that situation.
2019-04-01 14:38:44 +00:00
Mathieu Duckerts-Antoine a804585700 [FIX] web: correct quarter format in mockReadGroup
Before this commit the value of a field (of date/datetime type)
used as a groupby was not correctly formatted in the test environment
when the granularity was 'quarter'. This commit fixes that situation.
2019-04-01 14:38:44 +00:00
Mathieu Duckerts-Antoine 863de16a91 [FIX] web: correctly update this.widgets
Old subwidgets of a widget inhereriting from BasicRender were not
correctly destroyed. This was the cause of various problems when
cycling over this.widgets.
2019-04-01 14:38:44 +00:00
Mathieu Duckerts-Antoine 01c159fd9f [FIX] web: quotes and backslashes in search view
The commit 6d3ada178f
aimed to solve problems occuring whith (single or
double) quotes when creating new custom filters.
Unfortunately, the point was missed and bugs were
still present. The present commit solves the
orginial problem satisfactorily.
There was also a problem in the management of
backslashes. Type '\\' in the search bar would
lead to a domain like
[('...', 'ilike', '\\\\\\\\\\\\\\\\')].
This has also been fixed. Note that it is
necessary to input "\\" if one is looking for a
backslash in db (as before).

A remark on the _formatAST function (py_utils.js):

We deescape only the chars `'`, `"`, and `\`
because it does not seem possible to produce a
string in the search view that would intend a
search for a line return or a tab for example.

A general remark:

Domains should always be in normalized form.
In that way they could be manipulated and combined
together without a tokenization/parsing!

closes odoo/odoo#29756
2019-02-12 12:45:51 +00:00
Mathieu Duckerts-Antoine 24b0f092b4 [FIX] web: remove human_number limitations
The formatting of very big numbers (like
1.0045e+22) was not handled adequately by
the function 'human_number' in web.utils.
For those numbers, it seems more appropriate
to use the scientific format. The only
difference introduced here is the following.
Beyond a magnitude of e+21, we represent the
numbers by themselves but we keep the
number of decimals provided as parameter
(or zero by default) and we remove useless
zero decimals like in the other cases.
For instance, 1.0045e+22 is replaced by 1e+22
instead of 1.00e+22 if ask 2 decimals of
precision (and by 1.005e+22 for 3 decimals).

We have also fixed a small bug occuring in the
previous version of the function: the symbol
'E' was never used. So by the past the above
number would have be represented as
10045000P and, even worse, 1.01e+45 by
1.012e+28P.

closes odoo/odoo#31140
2019-02-15 10:51:01 +00:00
Mathieu Duckerts-Antoine 84abddfe90 [FIX] web: quotes and backslashes in search view
The commit 6d3ada1
aimed to solve problems occuring whith (single or
double) quotes when creating new custom filters.
Unfortunately, the point was missed and bugs were
still present. The present commit solves the
orginial problem satisfactorily.
There was also a problem in the management of
backslashes. Type '\\' in the search bar would
lead to a domain like
[('...', 'ilike', '\\\\\\\\\\\\\\\\')].
This has also been fixed. Note that it is
necessary to input "\\" if one is looking for a
backslash in db (as before).

A remark on the _formatAST function (py_utils.js):

We deescape only the chars `'`, `"`, and `\`
because it does not seem possible to produce a
string in the search view that would intend a
search for a line return or a tab for example.

A general remark:

Domains should always be in normalized form.
In that way they could be manipulated and combined
together without a tokenization/parsing!

closes odoo/odoo#31025
2019-02-15 12:38:22 +00:00
Mathieu Duckerts-Antoine 1e0b370b16 [FIX] google_spreadsheet: adapt code to refactoring
This commit adapts the code for the 'Add to Google Spreadsheet'
entry in the Favorites menu, according to the large refactoring of
the SearchView/ControlPanelView in web.

Part of task 1893568
2018-12-07 13:16:11 +00:00
Mathieu Duckerts-Antoine 38dc5c18b4 [REF] board: adapt code to search refactoring
This rev. adapts the code of the 'Add to Dashboard' entry of the
Favotires menu, according to the large SearchView refactoring. It
also does some tweaks for the dashboard app due to the move of the
ControlPanel from the ActionManager to the controllers.

Part of task 1893568
2018-12-07 13:16:10 +00:00
Mathieu Duckerts-Antoine 7618f84beb [FIX] web: sort pivot rows in comparison mode
Before this commit, it was not possible to sort
the rows of a pivot view while in comparison
mode. This fix makes it now possible. Note that
in comparison mode, a click on a header of type
"measure" will sort the rows according to the
column values coming from the data of interest.

closes odoo/odoo#28411
2018-12-18 12:56:06 +00:00
Mathieu Duckerts-Antoine 7fb7522cfe [FIX] web: JournalDashboardGraph widgets appear at kanban views updates
closes odoo/odoo#27892
2018-10-17 13:01:56 +00:00
Mathieu Duckerts-Antoine aaa5ea920d [REF] doc: update search view documentation
closes odoo/odoo#27893
2018-10-17 13:03:28 +00:00
Mathieu Duckerts-Antoine ebd23f36fb [REF] doc: update search view documentation
closes odoo/odoo#27893
2018-10-17 13:03:28 +00:00
Mathieu Duckerts-Antoine 5141f42d0e [IMP] crm: add new leads in demo data 2018-10-02 22:03:22 +02:00
Mathieu Duckerts-Antoine 64d7da4198 [FIX] web: fix update problems in graph view
The graph view was not updated correctly with respect to
time range menu data. We fix that problem in this commit.
2018-10-02 13:04:34 +02:00
Mathieu Duckerts-Antoine 9b5dabd399 [FIX] web: right labels in bar chart and comparison mode
For a single groupby selected, the graph view didn't render well
the data when simultaneously in bar chart and comparison mode.
The labels were in that case always integers.
This commit fixes that situation.
2018-10-01 16:42:12 +02:00
Mathieu Duckerts-Antoine a4b1c4193e [IMP] web: count measure first if selected in pivot view
The count measure is now put first in the order
of selected measures.
2018-10-01 10:38:14 +02:00
Mathieu Duckerts-Antoine 53a9bdf900 [FIX] web: only default time range works
If a default time range was set in the action but no
other default filter or groupby, the time range wasn't applied.
This commit fixes that situation.
2018-09-27 12:34:01 +02:00
Mathieu Duckerts-Antoine 3c093a8108 [FIX] web: human numbers and percentages
A recent modification of the float and integer
formatters allowing the rendering to be human readable
causes a bug in the percentage formatter for large values.
The reason is that the latter formatter uses formatFloat (wich can
now produce 'numbers' like 3k) and then parse the result. In the case
of 3k an error is raised since 3k is not recognized as a true number.

This fixes avoid to parse the number in case it has been formatted
to be 'readable'. Note that the parsing was essentially used
to produces better percentages like 10% instead of 10.00%.
This is not necessary in our case since utils.human_number takes care
of the unwanted (not all) decimals for us (the original number is always
rounded by utils.human_number).
2018-09-27 11:58:39 +02:00
Mathieu Duckerts-Antoine 692b557284 [FIX] web: avoid empty header in pivot.
In comparison mode, a useless line with an
empty header was sometimes created due to
problem in the treatment of read_group results.
This is no longer the case.
2018-09-26 18:21:39 +02:00
Mathieu Duckerts-Antoine 61253cbf6b [FIX] web: better submenu switcher style in groupby menu 2018-09-26 17:42:55 +02:00
Mathieu Duckerts-Antoine 8513aa0f98 [IMP] web: readable format of numbers
The functions 'formatFloat' and 'formatInteger' now format
a number x like utils.human_number when a predicate 'humanReadable'
is available in options and humanReadable(x) is true.
2018-09-26 15:37:03 +02:00
Mathieu Duckerts-Antoine 5ca2d15b24 [IMP] web: center texts of measures cells in pivot view 2018-09-24 11:41:41 +02:00
Mathieu Duckerts-Antoine 4cbc9b8d61 [FIX] account: translate default overdue_msg
opw-1880132

Closes #26852
2018-09-12 16:52:29 +02:00
Mathieu Duckerts-Antoine c4557580ef [IMP] web: review time range menu rendering
This commit changes two things in the time range menu
appearance:

	- the order of range options
	- the spacing between them (now two different groups
	  are separated by an empty lines)

Some tests had to be changed accordingly.
2018-09-04 17:37:14 +02:00
Mathieu Duckerts-Antoine 5510d808b8 [FIX] web: return information on pivot measures and groupbys
This commit fixes a bad behavior of the pivot view. By the
past, if there were no data to present in the pivot view, no
information on the pivot view configuration was returned by
the get function. This does not cause problems to the pivot
renderer (by design) but causes problems elsewhere, for
instance in a dashboard view that contains a pivot view.
Indeed, at each update, the dashboard view reinstantiates its
subviews, so that information can be lost if a subview is of
pivot type.
2018-09-04 17:37:14 +02:00
Mathieu Duckerts-Antoine d4b26c3372 [FIX] web: pivot model accept no __count key or null values
The _mergeData function used in pivot view comparison mode
was not designed to accept the absence of the __count key or
null values for measures in the objects returned by a 'read_group'.

The absence of the __count key would result in a traceback and null
values for measures into wrong calculations (infinities).

One could ask why null values did not cause problem before.
The simple reason is that the formatters used to format cell values
render a 'null' value like they render a zero.
This fix makes explicit that null values have to be considered
as zeros and avoid in that way Infinity values when computing
variations.
2018-09-04 17:37:07 +02:00
Mathieu Duckerts-Antoine 004b6e8b1c [FIX] web: fix time range menu button style in mobile mode
The search view in mobile mode has been redesigned and looks a bit different
from the search view in desktop mode. This commit adapts the time range menu
appearance in mobile mode.
2018-09-04 17:34:47 +02:00
Mathieu Duckerts-Antoine 39cfd5baa1 [FIX] web: export to excel in pivot view
Exporting data of a pivot view in comparison mode ends in a
crash. The root cause is that _t was replaced by _lt
so that some strings were replaced by objects with a toString method.
This does not cause problems when rendering a pivot view since
both QWeb or JQuery call that method. The function _exportData does not.

This commit fixes that situation and adds a test of _exportData.
2018-09-04 17:34:19 +02:00
Mathieu Duckerts-Antoine 4f4f111349 [FIX] web: disable buttons when no data presented in pivot view
The buttons 'Flip Axis', 'Expand All', and 'Download xls' are
now deactivated when no data are displayed in the pivot view
(those buttons are useless in that situation).
2018-09-04 17:34:02 +02:00
Mathieu Duckerts-Antoine 3ec6624754 [FIX] web: time range menu flickering
The search view always instantiates a time range menu but hides it
when it is not used.

Now, when the time range menu is not used, every time the search view
facets are rendered, the time range menu is also rendered entirely
and becomes visible shortly before being hide again. This caused
a bad screen flickering.

This commit fixes that problem by avoidind the unnecessary rendering of
the time range menu.
2018-08-17 10:26:31 +02:00
Mathieu Duckerts-Antoine db1eec2851 [FIX] web: tooltips in filters menu
There were tooltips on period options in the submenus of
filters menu. With the switch to Bootstrap 4, the html
structure of filters menu has changed (no more 'ul') and has
altered the way the menu items are rendered causing the
disparition of tooltips. With this commit, the tooltips come
back.
2018-08-16 12:11:14 +02:00
Mathieu Duckerts-Antoine ad0a758b75 [FIX] web: autocompletion in the new search view
A lot of new features have been implemented in search view
but autocompletion was forgotten. This commit fixes many
small problems that were introduced:

	- synchronization of facets created through
		autocompletion with filters and groupby menus
	- filters created through autocompletion can be saved
2018-08-14 12:37:44 +02:00
Mathieu Duckerts-Antoine 333ac27cd5 [IMP] web: new TimeRangeMenu widget in search view
This commit introduces a new widget 'TimeRangeMenu' used in
the search view. It allows a user to easily:

	- search data with a given date or datetime field value
		in a specified period of time

	- compare the data of interest with data of the previous
		period or the previous year.

The time range menu is available in the search view when one
of the four following view types is instantiated:
graph, pivot, cohort, or dashboard.

Task Id: 1835644
2018-08-14 12:30:51 +02:00
Mathieu Duckerts-Antoine 3523694b6c [IMP] web: add a patchDate function in testUtils
This function allows to properly mock Dates in js Tests
2018-08-14 12:30:51 +02:00
Mathieu Duckerts-Antoine dc1904d3ab [FIX] web: manage correctly deletion of facets
This commit fixes many synchronization problems between search view bar
and the filters and groupby menus.

forward-port of @94c027efd
2018-07-06 14:30:40 +02:00
Mathieu Duckerts-Antoine 11b7857af6 [DOC] web: improve documentation of search view 2018-07-06 14:09:09 +02:00
Mathieu Duckerts-Antoine 097464de6f [IMP] web: easy selection of a period in filters menu
This commit allow to create easily a range of periods (related to a field
of date or datetime type) to select in the filters menu.

Two new attributes on elements with tag 'filter' are now usable
in combination in a search view arch:

- date: string.

		A valid field name with associated type date or datetime

- default_period: string (optional).

		To choose in the following list:
			- 'today'
			- 'this_week'
			- 'this_month' (default)
			- 'this_quarter'
			- 'this_year'
			- 'yesterday'
			- 'last_week'
			- 'last_month'
			- 'last_quarter'
			- 'last_year'
			- 'last_7_days'
			- 'last_30_days'
			- 'last_365_days'

Example:

<filter string="Creation Date" name="period_generator" date="create_date" default_period="this_quarter"/>

Note: the attribute 'domain' can not be used for such filters.
The generated domains are dynamic and can be saved as such
via the favorites menu.
2018-07-06 14:09:09 +02:00
Mathieu Duckerts-Antoine 5d3f42a9ad [IMP] web: implement assemble domain utility function
In this commit, we implement a function which allow to combine
a list of domains into a single normalized using a 'OR' or an
'AND' operator.
We also refactor slightly py_utils.
2018-07-06 14:09:09 +02:00
Mathieu Duckerts-Antoine 64f3580af7 [IMP] web: add support of modulo in pyeval 2018-07-06 14:09:09 +02:00
Mathieu Duckerts-Antoine c71148cc70 [DOC] web: amelioration of inline documentation 2018-07-06 14:09:09 +02:00
Mathieu Duckerts-Antoine 94c027efdd [FIX] web: manage correctly deletion of facets
This commit fixes many synchronization problems between search view bar
and the filters and groupby menus.
2018-07-06 13:28:17 +02:00
Mathieu Duckerts-Antoine 4094f75527 [FIX] web: groups of filters ordered correctly
In the filters menus, the order of groups of filters comming
from the search view arch was not always preserved in the filters menu.
This commit fixes that situation.
2018-07-06 13:28:17 +02:00
Mathieu Duckerts-Antoine af999f40dd [IMP] *: review date type groupbys in search views archs
The parent commit allows to select a specific interval for any
date or datetime field in the groupby menu. This makes some filter
akward, for instance "Order Month".

Accordingly, we have rewritten the string and help attributes in
search views archs and removed groupbys related to the same field
(that would have become redundant).
2018-06-12 09:22:30 +02:00
Mathieu Duckerts-Antoine e1aac71769 [IMP] web: add support for interval selection in groupbys
In this commit, we extend the search view to allow the selection
of some intervals for date or datetime fields in groupby menu.
The valid intervals are day, week, month, quarter, and year.

It is also possible to add a button 'Group By' in the control panel
owned by a graph view in case it is declared 'embedded' (e.g. in a
dashboard view).

Note that have three new generic reusable widgets have been introduced
in this commit: DropdownMenu, GroupByMenu, and FiltersMenu.
2018-06-12 09:22:20 +02:00
Mathieu Duckerts-Antoine 7bf5dd687b [REF] web: split search_menus in separate files 2018-06-12 09:22:04 +02:00
Mathieu Duckaerts-Antoine 299ebb2cdf [IMP] mail: add moderation on channels
Purpose of this commit is to allow moderation on incoming messages in
discussion channels. On some channels on which moderation is required
messages should be in a pending moderation stage. Moderators can accept
or refuse messages as well as always allow or ban messages coming from
a given set of emails.

Channels now have an option to be moderated. Moderators can be added on
channels. They have access to a specific UI in Discuss to see and take
action on messages waiting for moderation.

Concerning mail.thread message that are pending moderation are not notified.
It means nobody receives a notification about them. Moderation process calls
the notification once the message is validated.

Various features included in this commit :

 * a model is added to store the decision about emails, allow or ban;
 * access rights are updated so that only moderators can modify moderation
   fields on message;
 * specific bus notifications are send to moderated people as well as to
   moderators on incoming emails as well as when a decision is taken;
 * options are added on channels to send explanations to moderated emails;
 * options are added on channels to write and send guidelines explaining
   why and how moderation is performed;
 * a reminder is send daily to moderators with remaining messages to moderate;
 * discuss UI is adapted and a new channel is added below Inbox and Starred
   giving access to moderation tools;
 * chanenl UI is adapted allowing to moderate directly inside channels;

This commit is linked to task ID 29521. Closes #21921.
2018-06-06 16:01:33 +02:00
Mathieu Duckerts-Antoine 3cfd3e6b0b [FIX] web: proper rendering of widget tag
There was no consideration of the fact that the widget
rendering process could be asynchronous. This commit
fixes that situation so that render a node of type
<widget name="..."> is now possible.
2018-05-30 12:03:24 +02:00
Mathieu Duckerts-Antoine e7ecdb8c46 [MOV] mail: move crons into their own data file
Purpose is to avoid mixing various data types in the same generic mail_data
file. We already have 2 crons and the upcoming moderation feature will add
some more. Let us put them in their file to ease the finding.

This commit is linked to task ID 29521.
2018-05-22 12:29:08 +02:00
Mathieu Duckerts-Antoine d082fa0d95 [REF] web: simplify calls to read_group in pivot model
The commit [3079415fb17232117b0d5059a23ae89232eaf5e8] allows the read_group groupby parameter not to be contained in the fields parameter. This makes possible the simplification made here. Similar changes could certainly be applied elsewhere.
2018-04-18 11:38:57 +02:00
Mathieu Duckerts-Antoine 1f5cce174c [FIX] models: remove useless assertion in _read_group_raw
For historical reasons, a field in the read_group grouby parameter was required to be in the list of fields parameter without any necessity. This is not the case anymore. A byproduct of this commit is that it fixes a bug in pivot view introduced earlier in [47395c6].
2018-04-18 11:38:34 +02:00
Mathieu Duckerts-Antoine 96867cb0e3 [DOC]: doc: amelioration of dashboard view documentation
No mention of the group_operator attribute was made in the dashboard view documentation.
This fixes remedies this situation and slightly ameliorates the previous documentation.
2018-04-11 13:53:29 +02:00
Mathieu Duckerts-Antoine 49662242dd [FIX] web: fix bad types in parameters
This fix allows the documentation to be built again.
2018-04-11 12:00:36 +02:00
Mathieu Duckerts-Antoine 47395c6e51 [IMP] web: allow using many2one as measure in pivot view
With this commit, we add the possibility of using many2ones as measure.
The way a many2one is aggregated is by using the count distinct
operator.

Some care had to be done to gracefully support the situation when a
pivot view is grouped by a m2o field F, and the same field F is used as
a measure.
2018-04-10 17:41:12 +02:00
Mathieu Duckerts-Antoine 5144414a3a [IMP] web: graph views can now aggregate many2ones
The read_group method was recently modified to allow more flexibility.
With this commit, we add the possibility of aggregating many2one fields.
These fields can be aggregating by counting the number of distinct IDs,
directly in postgres.

Also, note that we had to modify the mock server to implement the
corresponding functionality.
2018-04-05 15:59:40 +02:00
Mathieu Duckerts-Antoine e5b109b422 [IMP] web: update mock server to better match server semantics
The read_group method (from the server) is implemented in the mock
server, to allow easy unit testing in javascript.  However, the
behaviour was not exactly the same: a read_group call on a domain with
no records returns null for aggregates.  But the mock implementation
returned a value of 0.

We fix this in this commit, to allow more precise testing of Odoo
javascript.
2018-04-05 10:33:24 +02:00
Mathieu Duckerts-Antoine 166319fa4a [IMP] web: GraphView: remove hack to render in DOM
The graph view uses the nv(d3) lib to render the graph. This lib
requires that the rendering is done directly into the DOM (so that
it can correctly compute positions). However, the views are always
rendered in fragments, and appended to the DOM once ready (to
prevent them from flickering).

Before this rev., the graph view circumvented this by performing
the rendering in a setTimeout(0), letting the framework append the
widget to the DOM first.

This rev. removes this hack and uses the on_attach_callback hook
instead, which is called when the widget is attached to the DOM.
This ensures that the rendering is always done in the DOM, and we
keep the rendering part synchronous.
2018-04-03 15:19:42 +02:00
Mathieu Duckerts-Antoine 8e017ee296 [IMP] web: add a percentage formatter
This rev. adds a new formatter for numerical values to fieldsUtils.
2018-04-03 15:19:42 +02:00
Mathieu Duckerts-Antoine ee44d238f1 [IMP] web: close dialogs when navigating to another action.
This commit fixes a problem of usability. By the past if several dialogs were opened
(e.g. after having clicked on several one2manys) and a user would click on a many2one in a dialog,
a new view was charged but the dialog was kept open so that the change was unnoticed.
This behavior has been changed. Now all dialogs are automatically closed in such a situation.
2018-02-14 10:12:24 +01:00