We add the option to keep the completed activities to allow the user to keep
track of the past action, especially the uploaded files which are displayed
along the completed activities. This feature can be activated per activity
type and is disabled by default.
We also improve the activity view to give a better overview of what has been
done and what is still to be done and by whom.
We also add tests for those new features:
- check activity data for the views (server-side test)
* Details about the activity view improvements:
** Improvement of the column header:
- progressbar: previously, only visible activities were counted in the
progression bar. Now all are counted.
- activity counter: instead of displaying the total count (next to the
progression bar), we display now a ratio as 2 numbers (only if keep done is
enabled):
** Improvement of the activity cells:
- add assignees in activity cells of activity view (limit to 2 having the
activity with closest deadline, if more a + is displayed). Note: to avoid
spacing between avatar, we add the optional props noSpacing to the avatar
component.
- add done activity in activity cell popover
- increase by 50% the popover height
- display done activity cell in grey
- instead of displaying the activity count if greater than 1, we display a
ratio ongoing / activity count. Note: we don't display the denominator if all
activities are done or all are ongoing.
** Progress bar filter
The activity filter is slighly modified. Previously, when clicking on a color
of the progress bar, all cell with a different color where hidden (ex.: if we
were clicking on the green area to filter planned activities, red cell which
represents overdue activities were hidden even if there was also a planned
activities for this record and activity type). Now we also display cells with
other "color" if there exist for that record and that type an activity
corresponding to the filtered "color".
Technical note: mail_activity.get_activity_data returns now for the activity
types a list of dictionary instead of a list of list. This simplifies the
reading as we can now uses name instead of index (type[1] becomes type.name
for example).
Task-3300854
Part-of: odoo/odoo#138135
Fix some activity tests: use real test models, try to avoid date issues
by using freezegun.
Followup of odoo/odoo@a26e6e954c and odoo/odoo@06dee038dd .
Task-2654840
closesodoo/odoo#77120
X-original-commit: 2387c2ee6272a7c260386427c108208e747b819b
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
values for next activities are currently prepared inside the `mail_activity._action_done()` method which makes inheritance very difficult. This commit delegates the value computation to a sub-method and thereby improves the extensibility of the module.
required to support changes to enterprise documents odoo/enterprise#20769
Task-2627837
closesodoo/odoo#77004
X-original-commit: a26e6e954c5e6c773f37e9239138a7b94ded821f
Related: odoo/enterprise#21079
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Following the removal of read access on ir.model (odoo/odoo#69120),
the mail.activity.type model was not accessible to non-admin users due
to the res_model_id many2one field.
Before this commit, a project user could not access the Activity Type
menu.
Convert it to a selection field with the selection values being
computed in sudo.
closesodoo/odoo#74981
Related: odoo/enterprise#20214
Related: odoo/upgrade#2734
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
This commit adds tools methods related to activities in the mail.activity
mixin. It gives to models inheriting from the activity mixin an easy-to-use
API to schedule, unlink or mark activities as done. Purpose of those methods
is to avoid having people manually managing activities in the code to hide
the technical details of the activities model, notably access rights
or activity types.
A field is added on activity model to indicate they have been generated
automatically. This way when rescheduling or unlinking based on some
specific activity types we do not change user-created activities.
Those methods include scheduling activities, changing their dates, marking
them as done or unlinking them. Future commits will use those methods
in various addons to automatically generate activities based on workflow
we want to implement.
This commit also adds tests for the newly added code. Future commits should
probably have a look at activity security and add some tests cases to check
it is correctly taken into account. It is considered a bit out of scope for
this task.
Thanks to @jem-odoo for its in-depth review of this commit. Well thanks for
other commits also.