PURPOSE:
When the user creates a new content for a course and specify an invalid
video link, the system will display a traceback when the 'onchange' hook
of the field is triggered (i.e: when the user unfocus the field).
Instead of displaying a traceback with the 'Warning' function, we will
rather use the 'UserError' function which is more user-friendly and does
not provide any debugging information.
SPECS:
- Replace the 'Warning' function call with 'UserError'.
LINKS
Task id: 2607238
closesodoo/odoo#74237
X-original-commit: 7e9949b9c1e2e98a4d5059de695dbed95751b8b5
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Replace text fields to html fields as we have our own 'OdooEditor'.
Indeed, it gives more options to users in the way they format their
content without weighting too much on the UI
(tools appear on demand and not by default).
Models -> Fields
1) slide.channel -> description
2) slide.channel -> description_short
3) slide.slide -> description
Task Id: 2499504
X-original-commit: 6d914c005183aa5ae69650e3002a5a85ca83b4a6
Steps to reproduce the bug:
- Go to elearning app > Courses > content
- Create new slide > Upload a PDF file with faulty content
Problem :
Pypdf2 throws errors because it does not support some content or syntax.
In our case we are just trying to get the number of pages in the PDF, so if we put `strict = false`
we just determine that the user should not be informed of all the errors that pypdf2 encounters,
the flag `strict` is not a security indicator.
FYI: https://pythonhosted.org/PyPDF2/PdfFileReader.html
``` strict (bool) - Determines whether user should be warned of all problems and also causes some correctable problems to be fatal. Defaults to True.```
opw-2530829
closesodoo/odoo#71756
X-original-commit: 3acd0d666af56c39e34fc551e182468cc7bedc42
Signed-off-by: Djamel Touati <DjamelTouati@users.noreply.github.com>
Currently, when you click the stat button "x Courses" on a contact, you land
on the dashboard of the courses that this user follows. But this information
in not much useful here. You'd like to see information like progress of this
member for each courses, or when the member was last active on a specific
course.
With this commit, when you click the 'x Courses' stat button from a contact,
you will see the list view of model 'slide.channel.partner', having the
default filter for the contact from which you clicked the button. This will
show the additional and relevant information you need, and by removing the
filter, you'll be able to see info about all the attendees and their progress
on courses they follow (Note that here if the partner is a company, you
won't get default filter set but the records will be filtered by domain,
because we need to show courses of current contact and it's children, and
so we have to set domain in action, instead of adding default filter in
action context).
The same way, on the Attendees View of a course (when seeing attendees from the
course dashboard), we add 'Last Action' field, and instead of fixed domain, we
use filter to view attendees of a particular course, removing which can allow
us to view information about all the attendees from all courses.
We also introduce new 'Attendees' menu under 'eLearning > Reporting' that will
show information about all the attendees from all courses, with a default group
of channels
Task Id-2409447
closesodoo/odoo#64152
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
The `search` function of the `re` package can return `None` if the
provided string does not match with the provided pattern
(https://docs.python.org/3/library/re.html#re.Pattern.search).
On the `_parse_youtube_document` function of the `slide.slide` model,
we are directly accessing the capture groups from the returned value
of the `search` function without checking that the returned value is
actually a 'match' object. As a result, an exception can be throw if
there is no match as, in that case, the `search` function will return
`None` and the `group` function will not be defined on `None`.
To avoid throwing an exception, we will check that the returned value
of the `search` function is not `None` before accessing the capture
groups via the `group` function.
LINKS
Task id: 2525007
closesodoo/odoo#70763
X-original-commit: 575a524474fe8866cc71b3befc6bbbde8d73075e
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Before, each time the name of a slide was modified then a new link
tracker was created.
After discussion, we agreed to remove the automatic creation of link
tracker and let the user creates it manually if he really wants one.
The slides already have a lot of statistics that can be used without
the need of a link tracker.
task-2511961
closesodoo/odoo#69734
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
In 13.0 and above, when looking at a quiz that was completed while not published, it would incorrectly show 2 XP awarded, when 0 XP should be awarded.
With this commit, we show instead the correct 0 XP awarded.
opw-2480343
closesodoo/odoo#70349
X-original-commit: 26f047633b919bd8f2a260305bfd80e15bf259b6
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Convert `embed_code` to a computed HTML field so it's considered markup-safe.
It needs to be sanitize=False because we're putting <iframe> elements
in it. Those get stripped by sanitize.
PURPOSE
Notification may be sent using a generic mail.thread record, notably when
sending user notifications. In that case links to view document are
incorrect.
HOW TO REPRODUCE
Issue
- Install "Approvals"
- Submit new approval with you as "Request Owner"
- Click on "View Approval Request" in your mailbox
The link redirects to a 505 error
Cause
The model is not the correct one and the res_id is undefined
Solution
Specify the model and the res_id to _notify_get_action_link
when creating the link with kwargs
SPECIFICATIONS
Propagate message value through various notification sub methods. That way
we can rely on them if model seems void.
Also limit values given as URL parameters to some white listed values.
LINKS
opw-2358846
Task ID-2379766
Followup of odoo/odoo#60998
Followup of odoo/odoo#61545Closesodoo/odoo#63292Closesodoo/enterprise#15585closesodoo/odoo#64229
X-original-commit: 58bac5d242d6548d54f0163328fa64b319852e40
Related: odoo/enterprise#15634
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Co-authored-by: Achraf Ben Azzouz <abz@odoo.com>
Co-authored-by: Thibault Delavallée <tde@odoo.com>
Backend tags are generally used internally for classification or daily
process. Frontend tags are used for filtering and menu definitions. These
two type of tags are not managed separately in eLearning channels right now.
This commit separates backend and frontend tags using the color field.
Along with that, it improves the following :
Frontend
- only displays channel tags that has color set;
- avoids showing void tag group / menu (without any frontend tags);
Backend
- prevents access of the backend tags for portal/public users with a
record rule (similar to online events);
- adds 'Tags (tag_ids)' field in the list view of 'Course Groups' that
shows all the tags (frontend as well as backend);
- hides the colorless tags in slide channel kanban;
- improves the form view for course channel tags;
Frontend and Backend
- adds a default color value while creating a new channel tag
Task ID-2357942
PR odoo/odoo#62138
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Before Commit :
-when user archive a course content, it's still visible
on the course itself, without real difference between
active content and archived. it was confusing.
After Commit :
-now when user archive a course content, it's not visible
anymore on the course.
closesodoo/odoo#63508
Task-id: 2411211
X-original-commit: 363dcd4e19e88854118e10c11ee2c6bbdf13b537
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
With this commit, all instances of errors being raised inside
`BaseModel.unlink` overrides are moved into methods decorated with
`api.ondelete` which is safer.
- Install website_slides
- Connect with an user (i.e. Mitchell Admin)
- Go to Website and open a Course quiz for the first time
(i.e. "Test Yourself" from "Basics of Furniture Creation" Course)
- Answer correctly
The number of won karma is the one from the last attempt reward and is not saved
in user's total xp.
When submitting the quiz, quiz_attempts_count is incremented via a SQL query,
but its value is not updated in cache directly.
When the karma gain is computed from the attempts count, the value used is the
old one in cache.
opw-2389969
closesodoo/odoo#62500
X-original-commit: d8254c130d4b04a0f1ff80990fe28e795bf9ad51
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Signed-off-by: Anh Thao PHAM <kitan191@users.noreply.github.com>
Due to recent legal changes in EU, you cannot install tracking cookies in a user's browser without explicit consent.
Before this patch, Odoo embedded youtube videos were violating that law (AFAIK & IANAL).
With this simple patch, you benefit from YouTube's offering to embed videos without cookies. The UI remains the same, but no tracking is done.
@Tecnativa TT26153
closesodoo/odoo#61828
X-original-commit: a1a1169f28233b69cd70d01621d605b36517ac73
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
PURPOSE
This commit fixes the behavior of archiving and un-archiving slide.channels.
SPECS
When archiving a slide.channel, you could run into an issue where the
associated slide.channel.partners would be marked as "completed" even though
the related slides were NOT completed by the user.
This happened because when computing the completion, it's searching for
slide.slide.partners marked as completed, and then comparing it with the count
of slide.slides in the channel, which would always return 0 since all slides
are archived when the channel is archived.
Marking channels as completed when they should not triggers undesired
side-effects (karma increase, completion email sent, ...).
Now, when the slide.channel is not active, we don't mark associated
slide.channel.partners as completed anymore.
The ordering in which we archive channel and slides was also altered, see
method docstring of 'slide.channel#toggle_active' for more info.
A new test ensures the correct behavior of archiving.
LINKS
Task 2170708
closesodoo/odoo#61773
X-original-commit: f7795f85ed66fcebaf8a96bf4e550b069fcf1e83
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: awa-odoo <awa-odoo@users.noreply.github.com>
PURPOSE
Fix the 'multi' behavior when sending completion emails for slide.channels.
SPECS
There was a typo in the 'slide.channel#_send_completed_mail' method that
prevented it from correctly working in "multi" mode.
A new test was introduced to ensure the fix is working.
LINKS
Task 2170708
closesodoo/odoo#61004
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
*blog, forum, slides
Based on https://github.com/odoo/odoo/pull/48552#discussion_r440061218 suggestion
Add a new method 'increment_skip_lock' in tools.sql to allow to easily
increment a specific field of 1 if the record is not locked.
The method return boolean if at least 1 record has been incremented.
closesodoo/odoo#58765
X-original-commit: d92e61e89f468c2db2fbd68b2f0d6b36c77f1065
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Since a recent refactoring[1] is merged, few compute methods are being
called at record creation, and throws traceback because of newID.
This commit fixes the traceback by improving the compute methods and
thus enable users to create records of slide contents and forums.
Note - compute fields should be assigned a value, and so we update
the recordset with default values while creation. See below PR for
more information.
[1] - https://github.com/odoo/odoo/pull/55995
Task - 2325605
closesodoo/odoo#58196
X-original-commit: a677859a03c86bf6ac791c31f52ce8609bcba594
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
PURPOSE
Clean code. Be more performance oriented.
SPECIFICATIONS
Improvements applied in this commit
* not all() --> any(not) for earlier returns;
* all([generator]) --> all(generator) to avoid unnecessary list casting.
This code construct is better managed by all;
This commit will probably not have a big performance effect on standard
production databases. However each performance and cleaning improvement
is welcomed.
LINKS
Task ID-2328619
closesodoo/odoo#56810
X-original-commit: 1cc6bb1231401ea7f501d2f5b5e9641ec8734850
Related: odoo/enterprise#12802
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
PURPOSE
After this commit, an email will be sent to congratulate the attendee
for the completion of a course.
SPECIFICATION
Adds a new 'Completion Email' template field in the slide.channel model
that will be sent automatically after an attendee completes a course.
LINKS
Task ID : 2216352
PR : #49592
PURPOSE
Before this commit, it was possible to send an email to all attendees only.
After this commit, it will be possible to send an email to attendees that
completed the course.
SPECIFICATION
Adds a searchable o2m field in the res.partner model to find all the completed
courses linked to that partner.
LINKS
Task ID : 2216352
PR : #49592
Use _for_xml_id to replace all the self.env.ref().read()[0]
This has the advantage of having a single point of control and to add
the fields filtering and model verification.
Add sudo for other operations on ir.actions.*
PURPOSE
Archiving a course should also archive its content, and unpublish it as it
should not be accessible from outside. Improve archive / publish management
between a course and its slides.
SPECIFICATIONS
Show the content of an archived course having archived slides. When slides and
course are archived its content should still be displayed. This is done using
an active test in context of field.
Propagate channel archive to content. Also unpublish archived slides.
LINKS
Continuity/IMP of task-2170708
Task-2225598
closesodoo/odoo#52233
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
PURPOSE
Improve elearning backend usability and onboarding
SPECIFICATIONS
Improve layout of email send when invite. Do like a SO, add the join button
in the notification email and not in the composer itself. It required to
create a new notification layout specific to that invite wizard.
Improve channel form view: remove statistics as they are already displayed
in various places, add a stat button for content/visits, better display of
karma (split gain from karma-based access rules).
Automatically publish channel's product to avoid de-synchronization of publish
flags.
Remove unused channel_url field on wizard.
LINKS
Task ID-2241513
PR #55698
PURPOSE
Improve onboarding and user experience and course frontend
SPECIFICATIONS
Overall improvements and onboarding :
* new and improved default images for both course types;
* preview / free preview badge update;
* copy writing and spacing update;
* allow to specifically choose a slide to promote. Display promoted slide is
not optional anymore as configured in backend;
* display a sample of lessons if no lesson in a course;
LINKS
Task ID-2241513
PR #55698
The linter would miss / fail to warn on injection of *local variables*
in some cases.
Try to improve it to be stricter and more reliable, after discussion
with odo, sql which is "correctly" dynamic should use psycopg2's sql
package in order to bypass the linter (bonus: it should also properly
escape & quote identifiers).
closesodoo/odoo#53938
Related: odoo/enterprise#11718
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
- Seta a value for the `ir.config_parameter` `mail.catchall.domain`
- Enroll user A to a course
- Add new content to the course
- Publish it
=> an email is sent to the users enrolled
- Reply to the email
The reply is considered as a review of the course.
It is not intended that users reply to such email; they are 'one-way'
notifications.
A solution is to be able to set the `reply_to` field on the mail
template. This way, it's possible to set it to a `noreply` value.
opw-2290521
closesodoo/odoo#54281
X-original-commit: 7ffc300e7c857bf743d7ab25631f9ee02419dea1
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Ensure deterministic sorting for slides with the same sequence.
opw-2283154
closesodoo/odoo#54008
X-original-commit: 46bd51dc5f7b674409beac2557cbd19ec001944b
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Issue
- Install website slides
- Create a slide with document url =
a youtube video URL with params like ?rel=0
- Check it on the website with debugger
The iframe url doesn't have ?rel=0
Cause
We only take the video ID and pass it
to a predefined string. We add light
theme params too.
Solution
Split the given url in order to
get the params and pass it to
the predefined string.
OPW-2275928
closesodoo/odoo#53334
X-original-commit: 5e8fcd3391525192f462cc44acd84d3badb4f132
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Wrong usage of self in for loops makes some apparently multi-friendly
methods not work correctly when called with a recordset of len > 1.
This commit replaces those references by the correct unique record
reference which should be used at this iteration of the loop, avoiding
potential exceptions or wrong behavior in the concerned methods.
closesodoo/odoo#53320
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Using a few regex like
\((_\(.*%s.*)(\) % )([\w\[\]][\w .\[\]\(\)'"]*)\)
($1, $3))
Old syntax is still compatible but starts the migration to the new
syntax that catches error.
Currently deleting a category with slides is not supported as it should
be voided before being unlinked. This commit allows to unlink a category
by moving all its slides in uncategorized section.
This require a small reordering of sequences as category computation is
based on sequence of slides in a given channel.
Task ID 2276559
Prepares Task ID 2093671
PR #52917
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
PURPOSE
Before this commit, a user could not contact a course responsible to ask him
to join. With this commit he is be able to do it.
SPECIFICATIONS
Change the message 'Contact website administrator' to 'Contact Responsible'.
Add the name of the course responsible in the course description panel. When
clicking on its name it opens a modal to request access to the course. It
creates an activity linked to the customer and assigned to the responsible.
When hovering the 'You're enrolled' button the fa-check icon changes to a
fa-times icon to show that you can unsubscribe when clicking.
LINKS
Task ID : 2127364
PR : #40708
SPECIFICATION
Changes enroll_msg default value to 'Contact Responsible' instead
of testing if it was empty or not. Since the FieldHtml widget sets
the default value to '<p><br></p>' it was never empty.
LINKS
Task ID : 2127364
PR : #40708
- Rename the 'Use Rating on Project' feature into 'Customer Ratings'
- Rename the 'Set Email Template to Stages' link to 'Set a Rating Email Template on Stages'
- Add an optional list view for the Stages menu
- display warning if the rating_template_id field is set and if one of the selected project_ids doesn't have the rating_status field set to true
- Project form view revamp
- rename the '% on tasks' stat button into 'Customer Satisfaction'
- Remove the 'no option' for the rating frequency field because it is required
- project form : Add a 'Go to Website' stat button
- Project dashboard: remove the 'Customer Ratings' menu item in more
- Ratings page: the 'Last 30 days' filter include ratings from today
- remove the Appointment / Helpdesk Customer Satisfaction / Live Support menu items
TASK ID : 1251
Some apps, once installed, automatically create a menuitem in website.
What complexify the UI and create useless menu withtout plusvalue.
It is not because you install livechat to make support online, that you want
a link in your menu to show stats e.g.
Now we remove the default menu created, and help user to find it when he create
a link. The autocomplete suggest most of the main App's controllers
task-2189613
closesodoo/odoo#49081
Related: odoo/enterprise#9733
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Steps to reproduce:
- install eLearning
- go to the website > courses > enroll in any course > leave the course
Previous behavior:
you are not unsubscribed from the slide channel and still receive mail
notifications
Current behavior:
you are unsubscribed from the channel when you leave the course
opw-2244716
closesodoo/odoo#50404
X-original-commit: cb262738a20fad3e5114e9df21b77f499347745e
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: mightyjol <jhk-odoo@users.noreply.github.com>
Purpose of this commit is to avoid de-synchronization where content could
be unpublished whereas slide was published.
Task ID 2239840
closesodoo/odoo#49908
X-original-commit: d0f4a3e85eab63e335766a823185fd6ada6e07b4
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
PURPOSE
To align on the v13.0 enable the 'Allow Download' option by default.
SPECIFICATION
Change the default value of slide_resource_downloadable from False
to True.
LINKS
Task ID : 2225802
PR : #49951closesodoo/odoo#50164
X-original-commit: 44bfb8c73f9abc563ce764411610f45e5bdf18b1
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Purpose of this commit is to make use of toggle_active to implement business
behavior linked to active field being changed. In this commit we move the
business specific code from write to toggle_active. When archiving a channel
its slides are archived.
In this commit we also track active field for courses and slides, allowing
to see flag changes in chatter.
Task ID 2170708
Community PR odoo/odoo#46563
* = event, website_event_track, website_sale, website_hr_recruitment,
website_livechat, website_sale, website_slides
The option to sanitize or not the forms was not available, this will
allow better flexibility on whether forms should be sanitized or not on
an HTML field.
Also we use this new param to allow forms to be added on some already
existing html fields where forms where sanitized out.
task-2209554
closesodoo/odoo#47318
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
With this commit, Selection fields with `required=True` which are
extended via `selection_add` are given proper ondelete policies to
ensure the cleanup of records containing these extended options during
uninstall of the extending module.
This commit also cleans up leftover uninstall hooks that were being used
to handle the same set of problems prior to the ondelete mechanism being
implemented for Selection fields.
closesodoo/odoo#46325
Related: odoo/enterprise#9117
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
This commit fixes the reordering of slides on upload or drag and drop
in frontend. This issue was due to the fact that in a previous commit
(c4eba6f) uncategorized slides were moved to the bottom of the list,
which broke the reordering after drag and drop.
Indeed we use the dom order itself to reorder the slides with a simple rpc
call to dataset/resequence. Instead we revert part of the previous fix
to display uncategorized slides at the top. It allows to be coherent with
resequence and with backend behavior that displays uncategorized at the
top of the list.
Another issue was that, on slide upload, in the controller, we used
the category_id on the slide (which seems to not always be correct at
this stage) instead of the one given by the javascript. This caused the slide
to not be uploaded in the right section.
This commit also adds some margin to the categories in frontend for training
courses. Otherwise uncategorized slides are too close to the first category.
Task ID 2090927
X-original-commit: 7bd042d6e20c44558b90641409a6e3f8fa8000ed
When new slides are added through frontend a resequencing of slides and
categories sequence is done by calling _resequence_slides on the channel.
However this method is not working as expected, and resequencing should
take a category in order to better know where to start its resequencing.
Otherwise it simply reorder slides in the same order as before, or in an
unpredicted or prodicted but fasly order if new slide category has just been
created.
Task ID 2090927
X-original-commit: f038946ae2e3f174bee086281a541c6bc770e354
Issue
- Go on Runbot V13
- eLearning
- In a course, try to delete a question
You can't
Cause
The linked answer is not deleted
If you want to delete the answer you should
add an extra menu
Solution
Add ondelete='cascade' on answer's question_id
Prevent course deletion if there are attendees
OPW-2210096
closesodoo/odoo#48372
X-original-commit: 799ee72facbca7a7eaf348938ed312a6d723854e
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
PURPOSE
Clean and rename code about language management and template rendering in mail
template model.
SPECIFICATIONS
Clean method naming and try to make code easier to understand and call. Also
add and/or clean docstrings of rendering methods.
Notably
* ``_classify_per_lang``: for each lang-contextualized template, give the list
of record ids;
* ``_render_template``: now working only on a valid list of IDs instead of
allowing both int / list and having a return type depending on the input
type. It allows to simplify code and delegate some processing to callers;
Introduce new API method
* ``_render_lang``: for each record id return the lang matching it;
* ``_render_field``: render a field of mail.template, on given set of record
ids. Usage: template._render_field('body_html', records.ids). Language
computation is available for this method;
Remove the "multi mode" support of rendering that either returned a rendered
value, either a dict based on given ids. Now all methods always work in batch
and caller have to fetch the correct result if necessary.
LINKS
Task ID 1963529
Community PR odoo/odoo#32397