Commit Graph
102746 Commits
Author SHA1 Message Date
qmo-odoo c564ae6c87 [IMP] website_slides: Add elearning feature to slides
Purpose of this commit is to introduce a new way of displaying and managing
slides in eLearning module. Its purpose is to give a better experience to
users when going through a course. Notably a fullscreen mode allows to take
lessons one by one without going out of the elearning display. Integration
of all slide types eases taking the course step by step.

Quiz are introduced in this commit. Those are an addition to slides with
some question / answers (multiple choice). It allows customer to gain karma
and improves gamification. Certifications are still done using the survey
application. Quiz targets only small tests at the end of a given slide.

A new widget is added to display and control slide display in fullscreen
mode. Old display is still available for documentation channels or when
going out of fullscreen mode, to see details on comments / review / statistics
and have access to share options.

This commit is linked to task ID 1902304 and PR #29876. It closes the main
work on refactoring website slides into eLearning, with other tasks already
merged in current community [1][2][3][4][5].

[1] Task ID 1940360 landed at b2149bc7a2: certification inclusion
[2] Task ID 1936153 landed at 6c6179e57c: homepage inclusion
[3] Task ID 1937160 landed at 8b7605c9e5: selling courses
[4] Task ID 1922159 and 1940516 landed at 5fa651cb01 and 6a64c3ce82:
    new user profile and gamification of slides / forum
[5] Task ID 1938643 landed at 77b5673a0d: upload channel/slide
2019-02-19 13:11:15 +00:00
Vandan Shah 7a80ebe35e [IMP] *: Add progress bar on kanban views based on activities
Purpose
=======

If the activities are available on a model (i.e. inherits mail.activity.mixin),
add a progress bar based on the activities if nothing is defined yet.

closes odoo/odoo#24777
2019-02-19 11:01:40 +00:00
Vandan Shah d09ecc8b18 [IMP] web: improve kanban tooltip
1) Remove the total record tooltip from kanban group.
2) Remove progressbar help from kanban view.
3) Improvements in testcase since we have removed total record tooltip.
2019-02-19 11:01:40 +00:00
Antoine Guenet f5c269db12 [FIX] web_editor: properly position image handle in product configurator
The image handle (grey overlay over the image) was not properly
repositioning on scroll in the product configurator (a side effect of
not having a popover).

closes odoo/odoo#31226
2019-02-19 09:06:49 +00:00
Antoine Guenet d9a77bd846 [FIX] web_editor: stop wrapping text in p on delete in anchor
This notably fixes a bug with the accordion snippet (website) where
selecting a title and typing seemed to add a newline.

closes odoo/odoo#31222
2019-02-19 09:46:28 +00:00
Antoine Guenet 1f4b606ad0 [FIX] web_editor: remove invisible space on insert media where forbidden
The web editor inserts zero-width characters (unicode 200B) around media
when inserting them in the DOM so as to be able to edit before and after
said media (contenteditable caveat). It should however not do so in fake
not-editable nodes - such as the navbar - given that we do not expect to
edit in them but only to replace the media. This ensures that behaviour.

closes odoo/odoo#31200
2019-02-18 13:06:17 +00:00
Christophe Monniez fec86404e7 [IMP] tests: replace browser_js success and failure strings
When evaluating js tests using the browser_js method, they are
considered a success when 'ok' is found in the console log and a failure
if 'error' is found instead.

This is not very robust and recently failed with this commit : 7410de111f
It adds a filter named 'Error' in a view, when the 'click_all' test
clicks on this filter, a message with the name of the filter is written
in the console, wrongly leading to a test failure.

With this commit, the browser_js method expects a log message in the
browser console with the explicit text "test successful".
On the other hand, any error in the console log will lead to a test
failure but a test can be forced to fail with the explicit error message
in the browser console "test failed".

As a bonus, the python logger should now also log browser js trace messages.

closes odoo/odoo#31158
2019-02-19 08:06:07 +00:00
Aurélien Warnon 3c88e75c86 [FIX] website_slides: handle publishing rights of channel/slide
Purpose
=======

Handle publishing of the slide.slide/slide.channel accordingly to the new
'can_publish' field in the website published mixin.
2019-02-19 07:08:03 +00:00
Aurélien Warnon 916968058d [IMP] website: add a field to handle publish rights for publish mixin
Purpose
=======

The "publish/unpublish" widget is always shown on the frontend as long as the user
is a website_publisher and the object has a "website_published" field.

In some modules (namely website_slides) we need to handle a more refined level of access.

This commit adds a "can_publish" computed field that can be overridden to add some additional
access rules to the object and hide the widget if the user doesn't have the rights to
publish/unpublish.
2019-02-19 07:07:02 +00:00
Xavier Morel 7065ea520c [FIX] *: various docstring formatting issues
Would yield block quotes instead of code blocks or lists or whatnot.
2019-02-18 08:56:07 +00:00
Xavier Morel 3f8d20b778 [FIX] web_editor: various levels of broken in docstrings 2019-02-18 08:55:57 +00:00
Yannick Tivisse 7cd45840fc [IMP] hr_payroll: Set structure on generated payslips from benefits
closes odoo/odoo#30432
2019-02-18 16:16:20 +00:00
RomainLibert 1e12ce3430 [IMP] hr_payroll: add multi company rules on benefit and payslip run
Task 1913733
2019-02-18 16:16:20 +00:00
RomainLibert afde04dd54 [IMP] point_of_sale: make pos_session multi company aware
When creating a pos session we try to link the session to
the first cash journal we find.

The problem is that we cannot link a journal comming from another
company this is strictly forbidden by a constraint.

This is why we should make sure that we search only for journals in the
same company as the config.

Task 1913733
2019-02-18 16:16:20 +00:00
Yannick Tivisse ef048c24de [IMP] l10n_in_hr_payroll: Remove useless reports
They don't show anything that is of interest.

Task 1913733
2019-02-18 16:16:20 +00:00
qsm-odoo 9d5fa81ba3 [REF] website_theme_install: update theme install screen design
task-1907934

closes odoo/odoo#31114
2019-02-18 09:50:03 +00:00
David Beguin 2c01452d4b [IMP] website(_profile,_forum,_survey) : redesign website all_users page
As the eLearning (website_slides) is also using website_profile users,
the All Users page is moved from website_forum to website_profile, to be
useable in both forum and eLearning.

This page displays also the number of karma point, badges and certificates
of each user.

The users are sorted by their karma points and the first 3 users are
promoted on a podium.

Use span instead of b tag in profile page

Task ID : 1922159
PR #31109
2019-02-18 15:15:06 +00:00
David Beguin 5125eecce5 [IMP] website_slides_survey : add certifications in website profile page
For users viewing their own profile page on the website,
a new section 'Certifications' is added to the about tab.
Thoses certifications are the survey that activated certificate.

Task ID : 1922159
PR #31109
2019-02-18 15:15:06 +00:00
David Beguin 3ab9f1d8ab [IMP] website_slides_forum : set communication on slide.channel at creation - frontend side
Since 556b6454dab07cdf716d404ec0db9aa51a09b165, channel can be linked to a dedicated forum.
But the link could only be done in backend, in the slide.channel configuration
For now on, website_publishers can create a new dedicated forum when they create
a new slide.channel.

Link buttons have been added in both forum and slide.channel headers to navigate easily
between them.

Fix the relation between course and forum in a model point of view.

Task ID : 1922159
PR #31109
2019-02-18 15:15:02 +00:00
David Beguin 705376a982 [IMP] website_slides : add karma gain rules
To gamify the new elearning, karma can be gained on various actions
- rank a slide_channel (course)
- vote for a slide
- finish a course

This commit also fix the 'completed' computation on slide.channel.partner

Task ID : 1922159
PR #31109
2019-02-18 15:01:40 +00:00
Thibault Delavallée 0fe26b382c [FIX] website_slides: fix computation of completed courses 2019-02-18 14:53:10 +00:00
David Beguin 16b0b18361 [IMP] website_slides : show completed and ongoing course on profile
Two new sections are added in the profile page : Completed courses and Followed courses
Thoses sections replace the former 'Courses' section.

Use span instead of b tag in profile page

Task ID : 1922159
PR #31109
2019-02-18 12:16:08 +00:00
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
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 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
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
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
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