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
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
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.
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).
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).
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>
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
Adds slides ands slide.channels specific information (courses) into the website_profile template page.
As there can be more than one slide.channel,the profile page shows everything linked to every slide.channel,
except if the channel_id is given in url arguments.
Adds the 'Go to eLearning' button in the 'new rank reached' mail to encourage the users to continue
to be active on the eLearning platform as well, to gain more karma point and improve there rank.
Task ID : 1922159
PR #30988
New rules are
* on channel type documentation: can upload like before (employee or upload
groups specified); can publish like before (can upload and publisher)
* on channel type training: can upload like before (employee or upload
groups specified); can publish restricted to channel responsible
Tests are added.
This commit is a sub-part of task ID 1902304 (main eLearning task).
closesodoo/odoo#31082
Members is better computed using a sudo to avoid every access rights issues.
Moreover trigger is updated so that cache is correctly invalidated and
recomputed. Having the trigger on the relational model correctly triggers
the recompute when calling main API methods to add a channel member.
This commit is a sub-part of task ID 1902304 (main eLearning task).
Purpose
=======
A slide's 'Embedded views' are reworked as 'Public views' to simplify
the model and be more compliant with the new 'is_preview' field.
The rule is now the following:
A slide is a preview or the view is done as public user (once per session)
-> increment public_views
A slide is viewed as a logged in user that has access to the content
-> increment slide_views
Technically slide_views is a compute of the slide_slide_partner count.
Tests are also added to ensure it is effectively working.
This commit is a sub-part of task ID 1940360 (eLearning integration with
survey) and task ID 1902304 (main eLearning task).
The idea is a slide can be a HTML page completely customized by
user. So, you can now easily create custom content and publish
it on your website, like a normal slide.
Task-1938643
Having a unique constraint for a slide name in a channel look strange.
It force an RPC call to check this when uploading a slide, making the
process a little bit slow.
Morevover, name is a translatable field on slide.slide model, so the
constraint can not be fully respected.
To simplify the model, we decided to remove this.
Task-1938643
A slide can now have some external link. For instance, links to
the origin of the document (sources for scientifics papers, ...).
A new model is added to allow the user to provide several link
per slide. Those are display below the channel on website page.
Task-1938643
This commit provides the abilty to create channel from the website
instead of creating a slide. To do so, the user still have the "upload"
button on the channel home page.
The new modal allow user to set title, description, type and channel
tags. We prevent channel tag and group tag creation on the fly, as it
can impact the UI (coming in a future commits).
Task-1938643
Task #1937160
Purpose
=======
Performance improvement:
The members_count computed field now uses a compute_sudo with
a read_group allowing to compute all the members_count of the recordset
in a single query.
closesodoo/odoo#31013
Purpose
=======
With the new 'website_slides_sale' module users can now sell slide.channels.
This commit adds a setting to let the user know he has to install website_sale
to be able to sell courses / documentation.
Purpose
=======
Currently, the slide_channels having a visibility configured as 'invite' could
only add members manually.
This commit adds an 'Invite' button on top of the slide channel form that opens
a wizard allowing to send emails to contacts and also make them members of the
related slide channel.
Task #1937160
Purpose
=======
This commit adds a "Attendees" stat button on the slide.channel form view
showing the members (partner_ids) count.
On click, it redirects to a tree view of slide.channel.partner. The tree
view is configured as editable to be able to administrate members
(add/update/delete).
Task #1937160
Purpose
=======
This commit adds sale capabilities to a slide.channel. A slide.channel can
now have the 'payment' visibility, that requires a 'product_id' configured
on the channel.
When a customer purchases a product linked to a channel, he is added to the
members of the channel (see slide.channel.partner_ids) when his order is
confirmed.
The feature is added in a new module 'website_sale_slides' that comes as a
bridge auto-installed between 'website_slides' and 'website_sale'.
The final goal is to be able to sell "courses" (see task #1902304).
Purpose of this commit is to clean a bit channel model. Promoted slide
feature is removed as people can already choose an order for a given
channel. Moreover promoted slide will not be used when having a eLearning
display of a channel.
Image field on channels is added as it is not depending on promoted slide
anymore.
To simplify future additions a search-specific template is removed to
have a unique template to display a channel content. It will ease future
merge.
This commit is linked to task ID 1936153 and PR #30985.
Purpose of this commit is to add some statistics computation on slide.channel
model. We want notably to have a count of views and votes (likes and dislikes)
on channels. Completion is also computed.
Purpose is to be able to search and order channels based on those statistics.
Having stored computed fields for some statistics help achieving that purpose.
Tests are added.
This commit is linked to task ID 1936153 and PR #30985.
Purpose is to be able to filter, search and categorize channels. Notably
with eLearning in mind there will be more channels as a channel will also be
used to hold lessons.
For that purpose we add a model of tag linked to channels. Those tags are
organized by groups in order to be able to display them using a menu or
a small hierarchy of tags. Displaying a tag group as a specific navigation
element is controlled by a specific field.
Those models will be used to display a new and improved home page for
channels / courses.
This commit is linked to task ID 1936153 and PR #30985.
Just reflect access rights: publishers should be able to manage channel
members.
Co-Authored-By: Aurélien Warnon <awa@odoo.com>
Co-Authored-By: Thibault Delavallée <tde@odoo.com>
closesodoo/odoo#30960
To avoid security issues or exploits, public method to add a member on a
channel allows to add only itself, under given restrictions, like being
a channel maintainer to add self on a private channel.
A private method allow to subscribe other people. It will be used notably
to allow publishers to invite other people.
Co-Authored-By: Aurélien Warnon <awa@odoo.com>
Co-Authored-By: Thibault Delavallée <tde@odoo.com>
This commit changes decorated many2many between slides and participants
recently introduced [1]. It was done between slide and users as people have to
login to have slide information.
Another many2many between channel and partners to store notably completion
and soon add statistics has been added [2]. It has been done between
channels and partners.
In this commit we choose to have the same relationship for slides, aka a link
between slides and partners. It allows to easily compute statistics and find
information based on partner_id.
Co-Authored-By: Quentin Mourrier <qmo@odoo.com>
Co-Authored-By: Thibault Delavallée <tde@odoo.com>
[1] See c273e89d55
[2] See 748b9072d6
Fixes related to commit 748b9072d6
* fix template still having an unnecessary t-else whereas the t-if has
been removed;
* move order by strategy on right class;
* fix access rights on intermediate model between channels and partners. It
should be accessible to website publisher as they will have so manage
channel members;
* fix some typos;
closesodoo/odoo#30949
Purpose
=======
The 'state' field for a member of a channel did not imply anything functionally
so we decided to remove it. It allows to remove an unnecessary computed fields.
ACLs are updated accordingly.
If needed, we will soon be able to check partner_ids that have ordered but
not paid a channel / course product by searching the related 'sale.order' model
for such products.
Purpose is to add a new widget and its route allowing to join a channel.
As visibility is now mainly based on membership a widget to join channels
is required.
This commit is linked to task ID 1937411 and PR #30847.
Slide upload access is a bit cleaned. A can_publish field is added controlling
who can publish slides. Currently website publishers are allowed to publish
content. Not publishers people allowed to upload cannot publish their own
content. It stays in a submitted non published state.
This commit is linked to task ID 1937411 and PR #30847.
Purpose of this commit is to clean access rights on slide models and give
less access to public / portal / internal users. Website publishers and
editors have rights to edit slides content and manage channels.
Another purpose is to clean and refactor access options on channels and slides.
Access to a given slide depends on the current user being a member of the
slide channel. A channel can be either public (joined easily) or on invitation
only (manual addition of members).
Slide can be flagged as preview, meaning they are accessible without any
concern about channel membership. It is used as teasing or free promotion
of a channel.
Publish flag is orthogonal. Non published slides are not visible to everyone
except website content editor. It allows to work and improve slides without
displaying them to members or public people.
Technically a new model is added to model membership on channels. It is
a decorated m2m between channels and partners; on this m2m the state of
membership is added. In a near future additional information will be stored
on this model, like completion of channel or certification information.
Other technical changes implied by this commit
* visibility is simplified to either public or invite;
* can_see and can_see_full are removed, as well as concept of 'partial'
display of slides;
* group_ids related to private access is removed;
* a computed / searchable field is added to be able to efficiently find
and search active members of a channel;
This commit is linked to task ID 1937411 and PR #30847.
Purpose is to prepare the use of gamification tools in slides. In this commit
we add the dependency on website_profile (gamification front-end) in slides
and add the slides category on challenges.
Partial commit linked to eLearning project. Main specifications related
to gamification and user profile can be found on task 1922159 (PR #30514).
Main specifications related to eLearning can be found on task 1902304
(PR #29876).
Co-Authored-By: David Beguin <dbe@odoo.com>
Co-Authored-By: Thibault Delavallee <tde@odoo.com>
This commit allows user to rate a slide channel: using the new Popup
Rating Composer, users having access to the slide channel can submit
a rating with a comment. Then, lower in the page, they can see the
ratings of other users.
Task-1902304
Purpose of this commit is to prepare future code addition by making some
noise in a separate commit. In this commit we move compute methods below
fields definition because currently it is a complete mess and finding a
given field gives a headache.
Commit linked to task ID 1933820 and PR #30830.
In order to avoid spam and unwanted notification this commit limits auto
subscription on channel when
* creating a channel;
* automatically telling a channel a new publication has been done;
* creating a slide;
As being a follower of a slide channel means following its slides user should
choose manually to be follower of a channel, notably through the UI.
A new way of managing subscription will come with elearning in mind and
therefore auto subscription should be limited.
Commit linked to task ID 1933820 and PR #30830.
Purpose of this commit is to store a relationship between slides and users.
Indeed starting from now we will track more user interaction with the slides
module.
In this commit we introduce a model that is used to populate and decorate
the relationship between slides and users, slide.users. From slides or users
point of view it behaves like a many2many. It can also be used to store
more information about the user interaction with the slide.
We use it here to store the user vote. Like and dislike are not static
counters anymore but computed fields based on user votes. It is implemented
as a tristate field.
As it is a technical model no access on slide.users is granted. Controllers
and methods grant access to the relationship in order to avoid information
lead and keep technical details private.
Future commits improving the eLearning use of slides will notably store
information about user having read the slide, taken a quizz or gaining
karma depending on some actions performed on the slide.
This commit is linked to task ID 1934488 and PR #30620 .
Purpose of this commit is to clean a bit interface of slides
* separate can_see from can_upload;
* correctly set can_see on partial visibility channels;
* remove upload button for portal users as they have no rights to upload a
document and this is not supported in any way;
This commit is linked to task ID 1933820 and PR #30553.
Purpose of this merge is to polish a bit this module before turning
it into "courses" (see task #1902304 for more details on this)
Contains
* split python model into separate main files to ease models understanding;
* split views into separate main files to ease views finding;
* rename files according to guidelines;
* merge templates in the same file to have all available at hand;
* move assets in their own file in order to remove noise from templates;
* Split javascript widgets into their own separate files
No functional behavior change should occur with this commit. Only move
has been performed.
Note that we might lose part of the history as splitting files creates a new
history for new files.
Task: #1909281Closes: #28679
Purpose
=======
Remove the method 'render_template' in mail.compose.message as the indirection
is not useful. Call the method on the correct model (mail.template) directly.
This commit adapts the business code to changes introduced by
the parent commit in order to keep the same behaviour as before.
All readonly=False fields will have to be checked afterwards to confirm
that the business case requires write access to the source field.
156955de6b introduced a new property `website_meta_og_img` in
`website.seo.metadata`.
When rendering a template, `render()` is calling `get_website_meta` that will
end up reading `website.seo.metadata` fields.
But `website_slides` module is overriding `check_field_access_rights` to allow
partial read on the record.
The new `website_meta_og_img` was missing from the allowed fields, thus
crashing when an user without the required slide's group would try to read the
slide.
Purpose of this commit is to give description more "business oriented"
because those descriptions appears in Odoo Studio which is supposed to be used by end users, not only by developers.
Related Task ID : 37311
Set up env & tools for module website multiwebsite (blog, event, sale..)
website_id in modelConverter and ir_rule
add _compute_domain_keys to have a different cache per website
or rules would not be correctly website_dependant
eg: blog 1 on website 1, blog 2 on website 2
access blog 1 from website 1 => can access -> normal
access blog 1 from website 2 => can access -> should crash because (ir rule)
split mixing website.published.mixin and website.published.multi.mixin to have
website_id only on last one.
multi mixing will:
- override website_published compute to take current_website into account (not in backend)
- force website when clicking on published in backend
- website blog, website_sale, website_event, website_forum, website_slides are now multi website
Co-authored-by: Derie Romain <rde@odoo.com>
Co-authored-by: Kersten Jérémy <jke@odoo.com>