Commit Graph
124166 Commits
Author SHA1 Message Date
Juhil Somaiya 02eebe15cd [IMP] mail_bot: Blocked notification alert to User
If user has blocked odoo push notifications
then there's no way to enable via the OdooBot notification in the systray as it depends on the navigator
so display the alert message under users preference section.

Related Task ID: 1929547

closes odoo/odoo#30496
2019-02-15 09:05:54 +00:00
svs-odoo b35d103cc0 [IMP] web: reload currencies when activating one
Active currencies are given in session_info, in the page source.
When the user activated a new currency, he had to reload the page
to make the browser aware of that new currency (without reloading,
there was no currency symbol displayed next to the amounts).

This rev. forces a reload of the currencies each time a currency is
edited.

Task #1838654

closes odoo/odoo#31192
2019-02-18 12:56:05 +00:00
Robot Odoo aa8aadd2ad [IMP] web,website_sale: add tests for product image and mixin
This commit add tests for new mixin product.image and resizing.
Purpose is to test feature merged by commit: 413c63556f

closes odoo/odoo#31181
2019-02-18 14:26:01 +01:00
Sébastien Theys 1302654646 [IMP] base,web,website_sale: add tests for product image and mixin
This commit will add tests for the PR #30656 which added the following commit:
7daa85dd12

The tests in the current commit achieve 100% code coverage for:
- the `image.mixin`
- the overridden `image.mixin` methods in `product.product`
- the `_get_images` methods of ecommerce
- the size logic in method `content_image` (route `/web/image`)

PR: #31181
2019-02-18 09:43:06 +00:00
Sébastien Theys 539fb375e1 [MOV] website_sale: rename zoom test to image test 2019-02-18 09:30:42 +00:00
Alexandre Kühn 2f1688868a [FIX] mail: correctly compute direct_partner_id for dm_chat
Revision on https://github.com/odoo/odoo/commit/975164473ccd51c00eee5917dddbd8be71b5aefc

The commit above improves the channel_info, so that there
are less DB queries.

However, the computation was wrong for partners on dm chat,
which resulted in omitting the name and email of the partner.

closes odoo/odoo#31033
2019-02-12 15:55:01 +00:00
David Monjoie 867df179ca [IMP] base,doc: re-add consolidation feature to gantt view
closes odoo/odoo#31159
2019-02-18 07:23:32 +00:00
David Monjoie e154d2c17b [FIX] hr_payroll: use calendar as default view
The webclient doesn't handle a non-existing view as the default
view. However, it must handle it correctly if it is not the
default one since it does it for mrp.production already.

closes odoo/odoo#31161
2019-02-15 18:01:31 +00:00
Robot Odoo f34a7eddde [MERGE][IMP] website_slides: improve inclusion of gamification and ranks
Purpose of this merge is to improve inclusion of gamification and ranking
in elearning new main pages [1][2]. Ranking and profile information, links
and templates are added.

Some fixes are included in this merge, notably statistics computation, better
slide image fetch and demo data. See sub commits for more details.

Commit linked to task ID 1941250.

closes odoo/odoo#31133
2019-02-15 19:52:20 +01:00
Thibault Delavallée 5822e3098c [FIX] website_slides: fix text / html mismatch in demo data
Slide description is actually a text field, no need to put html tags that
are displayed raw.

Commit linked to task ID 1941250 and PR #31133.
2019-02-15 17:46:03 +00:00
Thibault Delavallée bd2dae4f6d [IMP] website_profile, website_slides: add user ranking and karma on elearning main pages
Purpose of this commit is to improve karma and gamification inclusion in
elearning [1].

 * remove a border, replaced by a standard hr, in rank template. It allows to
   reuse it easier as we don't necessarily want that border in other templates
   using it;

Commit linked to task ID 1941250 and PR #31133.

[1] task ID 1922159 (landed at 5fa651cb01)
2019-02-15 17:45:55 +00:00
Thibault Delavallée 1bb7b242c0 [FIX] website_profile, website_slides: clean user avatar controller and add one for slides
Purpose of this commit is to

 * clean user avatar controller and its calls;
 * extract default image computation;
 * add a controller to get slide image even when not having access to the slide
   as all slide name and images are displayed even if not available to the
   current user;

Commit linked to task ID 1941250 and PR #31133.
2019-02-15 17:45:41 +00:00
Thibault Delavallée e7b3535884 [REF] gamification: clean next rank motivational implementation
Purpose of this commit is to clean motivational capabilities of gamification
ranks[1]. It makes more sense to store a motivational to achieve on next rank
itself. We therefore rename the field and provide nice demo data that will be
used in elearning use of gamification ranks.

Commit linked to task ID 1941250 and PR #31133.

[1] task ID 1922159 (landed at 91ee6ba5a7)
2019-02-15 17:45:11 +00:00
Thibault Delavallée 6a9f6876c1 [FIX] website_slides: fix some statistics and publication issues
This commit fixes various issues introduced by recent commits in slides

 * fix slide type computation: using a dict in a fromkeys makes a shared
   object for all keys. It is better to fix that behavior;
 * correctly display number of course steps in elearning homepage. Currently
   number of steps of a course is simply the length of its one2many;
   holding slides. However this one depends on access rights which give funny
   results like a course with 2 steps for public users and 7 for admin;
   Right computation is: number of published lessons, whatever your access
   rights are. This is already computed as total_slides;
 * people that cannot publish should not be able to unpublish;

Commit linked to task ID 1941250 and PR #31133.
2019-02-15 17:44:02 +00:00
Robot Odoo b2149bc7a2 [MERGE][ADD] website_slides_survey: add a new bridge between slide and survey
Task #1940360
Subtask of #1902304

Purpose
=======

Adds certification capabilities to the website_slides module.
Channel/courses can now include certifications as a new type of slide.

This new type of slide is available as a "Certification" button on the slide creation
frontend view (next to "Video", "Presentation", ...).
Users have to link the slide to an actual survey that has the 'certificate' field
set to true (that will populate the slide's survey_id field).

Slides of type certification are handled in frontend in a very simple way for now:
- A button "Begin certification" that redirects the user to the related survey frontend.
- A button "Download certification" when the user has succeeded the certification.
  (A new download route has been added in the survey module to make it work.)
- When the survey is done, if it's linked to a slide, a button "Go back to course" allows
  the user to go back to the slide frontend.

(There is a special use case for when the website_publisher designing the survey lands on a
certification slide: he is allowed to test the survey with a survey_input created as test_entry)

Survey creation as well as limited time, limited number of attempts, ... are still completely
handled in the survey module. That means that the user will have to first create a suitable survey
that is a certification and only then create a slide of type "certification" and link
the created survey to it.

Ideally, the taking of the survey should be transparently included in the slide frontend but
it requires a full refactoring of the way surveys are submitted. This will most likely come in
a later commit.

This commit is an advanced merge of full eLearning module (see task #1902304).

closes odoo/odoo#31060
2019-02-15 17:29:08 +01:00
Aurélien Warnon 171c7028dd [FIX] website_slides: fix channel statistics computation
Purpose
=======

Channel statistics computation in the _compute_slides_statistics method
did not work for a batch of channels.

(The stats dict was shared for all the channels).
2019-02-15 15:32:47 +00:00
Aurélien Warnon f322816ae8 [ADD] website_slides_survey: add a new bridge between slide and survey
Task #1940360
Subtask of #1902304

Purpose
=======

Adds certification capabilities to the website_slides module.
Channel/courses can now include certifications as a new type of slide.

This new type of slide is available as a "Certification" button on the slide creation
frontend view (next to "Video", "Presentation", ...).
Users have to link the slide to an actual survey that has the 'certificate' field
set to true (that will populate the slide's survey_id field).

Slides of type certification are handled in frontend in a very simple way for now:
- A button "Begin certification" that redirects the user to the related survey frontend.
- A button "Download certification" when the user has succeeded the certification.
- When the survey is done, if it's linked to a slide, a button "Go back to course" allows
  the user to go back to the slide frontend.

(There is a special use case for when the website_publisher designing the survey lands on a
certification slide: he is allowed to test the survey with a survey_input created as test_entry)

Survey creation as well as limited time, limited number of attempts, ... are still completely
handled in the survey module. That means that the user will have to first create a suitable survey
that is a certification and only then create a slide of type "certification" and link
the created survey to it.

Ideally, the taking of the survey should be transparently included in the slide frontend but
it requires a full refactoring of the way surveys are submitted. This will most likely come in
a later commit.

This commit is an advanced merge of full eLearning module (see task #1902304).
2019-02-15 15:32:46 +00:00
Aurélien Warnon dcce7716b3 [IMP] website_slides: support slide_type param in slides/all route
Task #1940360
Subtask of #1902304

Purpose
=======

The slide/all route now supports a 'slide_type' param that will filter channels
to contain at least one slide of type 'slide_type'.

This is a preliminary work for the slides_survey bridge.
2019-02-15 14:59:32 +00:00
Aurélien Warnon b5c90c7866 [IMP] survey: add a route to download a certification pdf
Task #1940360
Subtask of #1902304

Purpose
=======

This commit adds a route allowing to download a certification for
a user that has succeeded it.

It's currently not used in any views but it's a preliminary work
for the future slide bridge.
2019-02-15 14:04:52 +00:00
Aurélien Warnon 949f641254 [FIX] website_slides: fix publisher slides frontend access
Purpose
=======

Website publisher should be allowed to access slides on the frontend even if
he's not a member of the channel.
2019-02-15 14:04:52 +00:00
Aurélien Warnon 1cb7290c20 [IMP] website_slides: add visibility criteria to some slide fields
Task #1940360
Subtask of #1902304

Purpose
=======

Some fields displayed on the slide.slide form view are not relevant
for all slide_types and should be hidden.
2019-02-15 12:54:00 +00:00
jem-odoo 98052fb51c [FIX] rating: value range of star notation
When rating with the smiley mecanism, the rating value will be 1,
3 or 7. The rating model allow value in range [0, 10]. When using
the star mecanism, usually, only 5 stars are used to introduced a
rating. This will set a rating value in the range [0, 5], which
is not aligned with the range of the model, nor the smiley range.

Purpose of this commit is to uniformize the range of rating, so if a
model is using both mecanism, the average will be correct. Solving
this problem implies to apply a conversion factor between the
database value and the displayed one.

Migration:
As only product.template was using star mecanism in odoo community,
a migration step should be applied to multiply of ratings of
product.template by 2.

Task-1941432

closes odoo/odoo#31141
2019-02-15 10:52:53 +00:00
jem-odoo 3d607880e6 [FIX] portal: posting message without token
This commit e84779749b factorize the check of
special access to post a message using a token mecanism, but it breaks the
case without token. Indeed, on some models, it is allow to post a message
on a document when having a certain access. This is handle with the
`_mail_post_access` attribute on model inheriting mail.thread.
Using this mecanism, a user that can read (or write) the document can also
post a message. This is used in the eShop to review product and in blog to
comment blogpost.

This commit restore posting a message without token. the normal access rights
will be applied by message post and raise if the user can not post message,
taking `_mail_post_access` into account.
The balance is now restored in the universe.

Task-1902304
2019-02-15 10:42:40 +00:00
Geoffroy Larue 400f769796 [REM] project, hr_timesheet: remove date_start
Remove date_start in project.task model, because it is not
useful. Now using date_assign instead for reporting.

Add two ids in settings views to refer from enterprise modules.

closes odoo/odoo#31101
2019-02-15 08:48:55 +00:00
Aaron Bohy 872c11dda4 [FIX] web_tour: consume step on click
Before this rev., steps were consumed on 'mousedown' events. This
caused an issue with the RainbowMan displayed at the end of tours
(which closes itself on 'click' events outside its $el).

Here is what occured when the user clicked on the last step's
element:
 - 'mouseenter' event triggered
 - current step consumed, as well as the tour, and a RainbowMan
   is instantiated and appended to the DOM
 - 'click' event triggered
 - RainbowMan closes itself because of that 'click' event

closes odoo/odoo#31148
2019-02-15 12:35:54 +00:00
qsm-odoo 8f4c595f5b [REF] website: remove useless code
Part of https://github.com/odoo/odoo/commit/f4ba72a7593b67595852fc52ec0997d3276dbc67
became useless after forward-port in the new editor. Indeed, that
commit handled what happened with data-editor-message attributes on
save but as the new editor can discard changes without reloading the
page, the forward-port of that commit made the code handle the attribute
removal on editor *close*.

closes odoo/odoo#31143
2019-02-15 11:17:58 +00:00
qsm-odoo bd2624a7ba [REF] web_editor, website: remove useless code
Commit https://github.com/odoo/odoo/commit/29075a8e2c734624cec4f6009185616634f70dea
introduced some python methods which became useless with commit
https://github.com/odoo/odoo/commit/aef6a5aaed22b250799ce92b5021d240fed9e12e

They were not removed with that commit since it was a stable version and
because it would have made forward-port difficult because of master
tasks. Now that those tasks are merged, this commit removes the useless
methods.
2019-02-15 11:15:37 +00:00
Lucas Lefèvre ff9be59309 [FIX] hr_payroll: Use jquery API to build benefit buttons
Use the proper jquery API instead of handcrafting dom elements.
+ fix traduction

closes odoo/odoo#31137
2019-02-15 11:09:25 +00:00
Pierre Masereel 49597e3f9c [FIX] crm_iap_lead_website: change name
The module has the same name as the module crm_iap_lead.

closes odoo/odoo#31134
2019-02-15 10:04:23 +00:00
Robot Odoo 6c6179e57c [MERGE][IMP] website_slides: introduce a new home page for slides
This merge proposes a new homepage for slides module evolving towards
an eLearning platform. This merge closes task 1936153 and PR #30770.
More generally this merge is linked to currently under heavy work slides
module update to eLearning [1][2].

It includes

 * a new main page displaying top courses / channels. It displays 3 most
   popular and newest channels as well as its ongoing courses (if logged).
   Achievements and karma update done by eLearning community allow to
   give a gamification look and feel;
 * an 'All' page displaying all courses / channels. Tag groups and tags
   allow to search / filter displayed courses;
 * a new pimped and revamped display for main course / channel page;
 * new demo data for slides and small addition of demo data in bridge module
   with website_sale and website_forum;

Some features may not be completely working as other tasks will continue to
improve the display, notably new slide display [1], some forum / slide
link improvements [3] and certification integration [4]. Some code cleaning
will come in future update as this merge allows to unblock those other tasks.

For more details see sub commits. And thanks to the RD Fun SM Team. Much
fun, much SM.

[1] main eLearning task: task ID 1902304 - PR #29876
[2] new user profile /gamification: task ID 1922159 - PR #30514
[3] forum and comments upgrade: task ID 1940516 - PR #30514 and #31097
[4] certification inside eLearning: task ID 1940360 - PR #31060
2019-02-15 11:00:28 +01:00
Thibault Delavallée e900e9b06e [IMP] website_slides_forum: add forum navigation tab in course display and add demo data
Purpose of this commit is to add the forum tab in course main new page
when the course is linked to a forum. Some demo data are added.
Some more work to better include forums and courses are ongoing [1].

This commit is linked to task ID 1936153 and PR #30770.

[1] forum and comments upgrade: task ID 1940516 - PR #30514 and #31097
2019-02-15 09:58:27 +00:00
Thibault Delavallée 2efb7e09ce [REF] website_sale_slides: improve demo data
Pimp my demo data. Purpose is to have some additional informations on demo
data defined in bridge module sale / slides. This one notably defines
a payment-based channel.

This commit is linked to task ID 1936153 and PR #30770.
2019-02-15 09:58:27 +00:00
Thibault DelavalléeandAurélien Warnon ded92c62d2 [IMP] website_sale_slides: support payment channels in new channel homepage
Purpose of this commit is to effectively support payment channels in the
new channel homepage. Specifications

 * display a 'Buy Course' button on payment based channels;
 * redirect to eCommerce;
 * display price;

We used everything available from eCommerce and product configurator to
find a real price to display. I must say I am quite happy with it.

This commit is linked to task ID 1936153 and PR #30770.

Co-Authored-By: Aurélien Warnon <awa@odoo.com>
Co-Authored-By: Thibault Delavallee <tde@odoo.com>
2019-02-15 09:58:26 +00:00
Thibault DelavalléeandAurélien Warnon 8f295a64f3 [REF] website_slides: propose new shiny (incomplete) demo data
Purpose of this commit is to rewrite slides demo data. More channels, more
slides, more images, less Odoo oriented content.

Everything is still not completely clean but at least it begins to look like
something we could show to people. Thanks to @awa-odoo who gave some demo
data. No thanks to @xmo-odoo who did not give demo data about the emu war.

This commit is linked to task ID 1936153 and PR #30770.

Co-Authored-By: Aurélien Warnon <awa@odoo.com>
Co-Authored-By: Thibault Delavallee <tde@odoo.com>
2019-02-15 09:58:26 +00:00
Thibault Delavalléeandqmo-odoo 2cfacfc632 [IMP] website_slides: new homepage and main channel page
This commit proposes a new homepage for slides module evolving towards
an eLearning platform. It includes

* a new main page displaying top courses / channels. It displays 3 most
  popular and newest channels as well as its ongoing courses (if logged).
  Achievements and karma update done by eLearning community allow to give
  a gamification look and feel;
* an 'All' page displaying all courses / channels. Tag groups and tags
  allow to search / filter displayed courses;
* a new pimped and revamped display for main course / channel page;

For more details about specifications, send an email to aware people that
will be able to send you mockups. Or see the related task. Thanks to
@qmo-odoo who helped developing this homepage based on its work.

This commit is linked to task ID 1936153 and PR #30770.

Co-Authored-By: qmo-odoo <qmo@odoo.com>
Co-Authored-By: Thibault Delavallee <tde@odoo.com>
2019-02-15 09:58:26 +00:00
Thibault DelavalléeandAurélien Warnon c437832e55 [REF] website_slides: perform some model code cleaning
This commit squashes several fixes / light improvements related to the new
slides / elearning homepage [1][2].

Containing notably

 * clean promote strategy field on channel model: less entries as they
   are now used only to display lessons in a given order on channels of
   documentation type;
 * remove promotional fields, not used anymore since partial access on channel
   allowing to have some kind of small preview of slides has been removed;
 * use standard image field (image, image_medium and image_small) and use
   image_resize_image from tools like all other odoo applications;
 * improve image resizing to have medium images better looking on frontend
   and use that nice image_large that broke my build yesterday;
 * add last publication date change on channel;
 * clean dead code;

[1] new homepage task: ID 1936153 and PR #30770
[1] main elearning task: ID 1902304 and PR #29876

Co-Authored-By: Aurélien Warnon <awa@odoo.com>
Co-Authored-By: Thibault Delavallée <tde@odoo.com>
2019-02-15 09:58:25 +00:00
Thibault Delavallée c971b622c0 [IMP] gamification, website_slides: add challenges in slides and improve ranks
Purpose of this commit is to add challenges related to slide / elearning
module. 5 new challenges with their badges are added. Portal user partner
is now also published to have bioutifoul demo data. Commit linked to
eLearning tasks [1][2]

Co-Authored-By: David Beguin <dbe@odoo.com>
Co-Authored-By: Thibault Delavallee <tde@odoo.com>

[1] new homepage task: ID 1936153 and PR #30770
[2] new user profile / gamification task: ID 1922159 and PR #30514 and #30988
2019-02-15 09:57:46 +00:00
Thibault Delavallée 00bf73cd4a [IMP] website_profile: add a specific route to access avatar of users
Purpose of this commit is to give a specific route to access users image
used as avatar in profile and various frontend applications.

Indeed current web/image controller basically checks record access rights
with current user. However in some cases we want to display user avatars
even if current user cannot read user records, which is generally the case.
Indeed res.users is a private and technical model.

To solve that issue we add a controller for avatar. Basically published
and frontend active user avatars are available.

This commit is linked to task ID 1936153 and PR #30770.
2019-02-15 09:57:46 +00:00
Thibault Delavallée cab98785e9 [IMP] website_rating: improve popup / composer rating display
This newly introduced widget for rating [1] is very cool. This commit
simple improves a bit the display and have the stars + review button
displayed as a small one liner to take less place when displayed.

This commit is linked to task ID 1936153 and PR #30770.

[1] See https://github.com/odoo/odoo/commit/4cb228d823e0346e6052091d397249b8e39d576b
2019-02-15 09:57:46 +00:00
jem-odoo d233ac239d [FIX] website_rating: default value is not 'false' in composer
When website_rating is installed, all frontend chatter will have
the string 'false' by default in the composer. This commit fixes
that, restoring the placeholder

closes odoo/odoo#31097
2019-02-14 15:27:35 +00:00
jem-odoo 8ad65abd00 [IMP] website_slides: allow comments on slides
With this commit, the user can activate review on channel content when
creating a channel from frontend, or editing it from backend. Once
activated, the comment tab below the slide content will allow user
to post a comment with optional rating.
The way of commenting is different regarding channel type:
- documentation: user can post comment and vote (list/dislike) on
slide content
- training: user can post comment with review (rating)

Task-1902304
2019-02-14 15:27:35 +00:00
jem-odoo 1878ea95fe [IMP] website_slides: allow to set cover image for webpage slide
Before this commit, the user can only create a webpage slide
by setting its name, category and tags. On the channel grid,
no tumbnail was shown.
This commit allow the user to upload a cover image from the
slide upload modal and to modify it from form view. the
mimetype of webpage slide is now 'forced' through the
modal to 'text/html' to avoid conflit with 'image/png'
when setting the cover image.

Task-1902304
2019-02-14 09:32:43 +00:00
Martin Geubelle 70606f5285 [IMP] hr_payroll: add gantt view for benefits
closes odoo/odoo#30263
2019-02-14 16:44:40 +00:00
57b5e8d9f5 [IMP] base, doc: adapt according to the new gantt view
The view has been rewritten from scratch so the doc and the RNG validation
needed to be adapted.

Co-authored-by: dmo-odoo <dmo@odoo.com>
Co-authored-by: aab-odoo <aab@odoo.com>
Co-authored-by: jat-odoo <jat@odoo.com>

See odoo/enterprise#3437

Task 1856235
2019-02-14 16:44:40 +00:00
Christophe Matthieu b49745e52d [IMP] web_editor: lazy load the wysiwyg
Issue: wysiwyg asset slow down the loading of the website, error
inadvertently introduced: https://github.com/odoo/odoo/pull/29775

The assets are now loaded assynchroneously, when the editor is needed,
its assets will be loaded.

closes odoo/odoo#30700
2019-02-14 15:11:19 +00:00
7daa85dd12 [IMP] base,product,website_sale,*: improve product images
* = account, purchase, website_sale_comparison, website_sale_wishlist

Raw Image & Mixin
=================

Previously, the main image from a product was stored resized. This caused
inconsistencies with the size of the images on ecommerce: the main image was
resized, but the extra images were not.

Now, we always store all raw images, thanks to the new mixin. This way, product
images that were created before the installation of ecommerce will be ready to
be used in ecommerce without any other change.

We also store the resized versions instead of computing them on the fly: this
will take more disk space, but significantly increase the speed of the
pages when displaying images, as well as reduce server CPU load.

Images on variants
==================

Previously, it was only possible to set the extra product images on a template,
and not on a variant.

Now, we allow extra images also on the variants, this gives more flexibility to
the user.

Both extra images on template and variant have been given a sequence field to be
able to sort them easily.

On /shop we always display the image of the template for performance reasons.
On /product we never display the image of the template, unless the variant has
no image, then the template image is the fallback.

Carousel
========

The carousel view has been cleaned and improved:

- remove the duplicate XML that was created with the product configurator fix
- use a single loop from a single source to get all the images, instead of
	merging the different sources in the view with complex conditions
- improve the HTML structure, reduce the CSS with appropriate classes

Preview Image
=============

Both in website and backend: make better use of `preview_image` to display
a small image whenever possible, to reduce download size for the end user.

task-34045
PR: #30656

Co-authored-by: Parth Gajjar <pga@odoo.com>
Co-authored-by: Sébastien Theys <seb@odoo.com>
2019-02-14 16:37:25 +00:00
Sébastien Theys 413c63556f [IMP] tools,base,web: improve image tools
Add support for a 256*256 image, to be used in the following commit.

Define sizes in named variables instead of being hard-coded in several places in
the code.

Allow parameters `preserve_aspect_ratio` and `upper_limit` to be passed from
the different helper methods.

Factorize the code inside `image_resize_images` to make it easier to read.

Add new function to compute whether the size of an image is above a given size.

task-34045
PR: #30656
2019-02-14 16:03:09 +00:00
Dharmraj Jhala 38843624d4 [IMP] web: allow preview_image option for image widget of qweb field
With this option we can define which field is going to be displayed by the qweb
image widget, while logic is still applied to the original field.

For example, we want to show a thumbnail image but when user updates it with the
web editor, we want to update the actual field instead of the thumbnail field.

This is similar to the preview_image of the JS image widget.

task-34045
PR: #30656
2019-02-14 16:03:08 +00:00
Robot Odoo 1f2766a955 [IMP] Add employee profile
[IMP] hr_*: introduce the employee profile
================================

## General Purpose

We want an 'Employee profile' gathering every data about an employee.
The main form view is modified to become this employee profile.
A user can also see his own profile through the Preferences menu.
The new profile replaces the current Preferences view if the `hr` module is installed and the current user is linked to an employee. The Profile will show the employee of the current company.

A user should be able to see and edit his own profile.

*Problem*:
Many fields on hr.employee are protected by `groups="hr.group_hr_user"`.
Therefore, a regular user cannot see or edit those fields.

This protection must be bypassed to allow read/write access to the regular user's own data.
A similar mechanism already exists for `res.users` (for Preferences)

The better (least worst) solution found is to reuse this mechanism by adding related fields on `res.users`.

Pros:
- Don't change security access on hr.employee
- Don't implement yet another custom security layer, risking to add new security breaches
- A lot of fields are added by other modules on hr.employee.
  It would have required to integrate them with the custom security layer.
- Fields added by other modules on the user's preferences view (normal view, not the profile)
  are automatically included in the employee's profile view.
- Allow the hr.employee form view to be different than the user profile accessible
  through the Preferences menu.
  E.g. add custom buttons only relevant to the logged in user such as "Request a leave".
Cons:
- Each field from hr.employee that you want to appear on its profile
  must be added as a related field on res.users
- Those related fields must be added to user's preferences view (duplicate views)
- They also must be added to `SELF_[READABLE | WRITABLE]_FIELDS`

Note:
When the front-end loads the views it gets the list of available fields for the user (according to its access rights). Later, when the front-end wants to populate the view with data, it only asks to read those available fields. However, in this case, we want the user to be able to read/write its own data, even if they are protected by groups (groups are kept on the related fields on res.users). The front-end need to be made  aware of those fields by sending all field definitions.

## Changed modules

### hr_attendance

Adds a stat button to this employee profile showing the number of hours worked last month.

Remove the Boolean computed field `manual_attendance`.
This field is just a shortcut to add/remove the employee's user in the "Manual Attendance" group.
The checkbox is confusing on the employee's form and this should be done through the normal group management screens.

### hr_presence

Display the presence status on the employee kanban template.
The status is a colored chip which can be green (present), orange (to define) or red (absent).

Currently, the presence status is only computed when accessing the report view. As this commits displays it on the employee kanban, it should be updated more frequently.
The state should not be updated every time the kanban view is loaded since the computation is a bit heavy. Instead: add a cron to update status every hour.
-> The status is accurate on the report view (status is still updated
   when loading the view)
-> The status in accurate at 1 hour on the kanban view

### [ADD] hr_attendance_presence

Bridge module between `hr_attendance` and `hr_presence`.

This PR integrates `hr_presence` module in the employee profile and adds the presence status on the employee kanban view. But `hr_attendance` adds at the same place a similar status icon for checkin/checkout.
This bridge module makes the status from `hr_presence` invisible as `hr_attendance` should be the main presence control mechanism.

Also, this commit adds the ability (through a new setting option) for `hr_presence` to take into account checkin/checkout to determine the presence status.

### l10n_be_hr_payroll
integration with employee profile

[ADD] hr_skills: Introduce a new module for employee resumé and skills
=======================================================

Purpose
-----------

Consultancy companies need resumé and skills of their consultants.
For big projects, they often need to send them to their customers.
These information are also useful to statistics.

Specification
-----------------

### New models

####  `hr.resume.line.type`
Types of resumé lines. e.g. *Experience*, *Education*, *Hobbies*

#### `hr.resume.line`
It is a line in the resumé of an employee.

#### `hr.skill`
Name of a skill. e.g *French*, *Python*, *Piano*

#### `hr.skill.type`
Skills can belongs to a particular type. A skill type has skill levels associated.
e.g. *Languages*, *Dev*, *Music*

#### `hr.skill.level`
Levels available for a particular skill type. Each level has a label
and a progress (between 0 and 100) associated.
e.g. *Intermediary (20%)*, *Advanced (85%)*, *Expert (100%)*

#### `hr.employee.skill`
These are skills which employees have. It links an employee with a particular skill
and level.
e.g. Mitchell has an *Intermediary* level in *Python*

### Access Rights

Only a `hr_user` can create/edit `hr.resume.line.type`, `hr.skill`, `hr.skill.level`, `hr.skill.type`.
If employees are allowed to edit their infos (setting), they can also create/edit `hr.resume.line`,
`hr.employee.skill` for themselves.

### UI

Resumé lines are displayed, grouped by type, in a new 'Resumé' tab in the employee
form. Resumé lines can be reordered (handle widget)

Emloyee skills are displayed in the Resumé tab, grouped by skill type.

[IMP] hr, hr_holidays, hr_expense: Change onchange parent_id behaviour
=========================================================

Purpose
-----------

When the manager (parent_id) of an employee changes, it doesn't always mean that other responsibles (Leave responsible, expense responsible, coach) should also change.

Specification
-----------------

When changing the employee's manager, the leave responsible, the expense responsible and the coach should be changed only if the field was not set or if the responsible is the previous manager. In that case, they should be set to the new manager. Otherwise, it means the field was most probably set manually and it should be left unchanged.

Task 1913089

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

closes odoo/odoo#30502
2019-02-14 19:09:34 +01:00
Lucas Lefèvre bad9190730 [FIX] hr_holidays: reload dashboard on new allocation
When a new allocation is requested from the leave dashboard,
the page is not reloaded. Therefore the displayed data is not
up to date with the new allocation count.

This commit makes the page reload after each new allocation.
2019-02-14 16:28:55 +01:00