When displaying a channel content all its slides are displayed in a
list view or cards view. Even slides current user cannot read because
he is not member of the channel are displayed, even if there is no link
(and access rights prevent them for effectively accessing the slide).
Purpose is to display a channel content without giving access through
ACLS at its slides.
However this domain computation was not correctly matching real use case
* publishers should see everything;
* public users should not see unpublished slides;
* members not publishers should not see unpublished slides unless they
uploaded it;
Commit linked to task ID 1941250 and PR #31708.
Purpose of this commit is to have a method allowing to fetch slides
and have them ordered by category with some info on the category. It
fully supports uncategorized slides.
This commit also fixes the lessons list view of a training course. When
having rights to edit the channel the category name was not editable.
We now use a real browse record allowing to edit the category names
directly in this reorderable list view.
Commit linked to task ID 1941250 and PR #31708 .
Display
* improve color of trophy displayed on top of course main page (success if
course done, warning while working on it);
* correctly fetch and display karma/xp points on course lesson list. It is
either gain of next try, either awarded points depending on slide
completion;
* fix control buttons in course main page (prev, next, set done,
set completed, fullscren), notably correctly set them disabled;
Linting / Code
* put demo in no update;
* rename some parameter in website_slides_survey to avoid conflict between
quiz (on a slide) and certification (a survey);
Commit linked to task ID 1941250 and PR #31697.
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
In order to se the 'next rank card' and the user karma on user's profile page,
not only the first rank is needed but also higher ranks. Otherwise everyone
will be 'Newbie', even the admin.
Moreover it is easier to update existing data for things like rank than having
to figure out how it works.
Task ID : 1941250
PR #31697
This commit sets the completed flag to True for a slide of type certification
when this certification is succeeded (quizz_passed set to True).
Also, the Download certification button has been added to the fullscreen mode
if the certification is passed by the user.
Task ID : 1941250
PR #31697
If there are too much users to show on the page and to avoid performance
issues, a pager is now applied on the all users page.
A new pager based on website_pager is added in order to ease the navigation
through the potential high number of pages. 'Go to first page' and 'Go to last
page' buttons have been added and the design of the pager have been adapted
to be more integrated into the new eLearning platform.
Also add the pager on the slide page if search category is applied. The pager
was already computed in the controller but not displayed.
Task ID : 1946160
PR #31697
Purpose of this commit is to perform a cleaning and upgrade of the lesson
view in front-end when not using the fullscreen mode. This page had not
been updated since eLearning addition.
A method is added on slide model to have a protected method computing quiz
related information on a given set of slides, notably potential karma gain,
gained karma and number of attempts. It is mainly a code move from controllers
now working in batch.
Some linting is also done, notably a badly-named file.
See original eLearning task for main specifications [1].
Commit linked to task ID 1941250 and PR #31657.
[1] See task ID 1902304
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Currently Odoo JavaScript code base support only ecmascript <= 5
So using a non compliant ES5 syntax can trigger a javascript engines
crash for some browsers like: IE, webview used by some old mobile
devices.
This commit fixes non compliant JS code syntax found to avoid potential
crash.
closesodoo/odoo#31522
Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
Currently Odoo JavaScript code base support only ecmascript <= 5
So using a non compliant ES5 syntax can trigger a javascript engines
crash for some browsers like: IE, webview used by some old mobile
devices.
This commit fixes non compliant JS code syntax found to avoid potential
crash.
Previously, when user edited record having 'field_html' widget and
tried to save the record immediately, a traceback was faced sometimes
because content was not loaded yet. This commit fixes the issue
by calling super method if the content is not loaded yet properly.
Task: #1932687Closes: #30833closesodoo/odoo#31581
Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
This commit makes the quiz widget a real odoo widget that triggers up some
events. The widget is now only responsible of
* fetching quiz data (if not given)
* decorating the anwsers according to the result
* displaying message (error or modal)
To do so, some code move/rewrite was needed
* extract and factorize some template
* add 'sudo' on technical model to avoid access rights error
* factorize some python method from controller to model
* remove some CSS classes to lighten the code
* fixing access model error
* make quiz widget handle the display of error message
* give browse record for template rendering, rather than slug
* cleaning some spaghetti code in Fullscreen widget
* ...
Commit linked to task ID 1941250 and PR #31584.
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
When creating a course via the frontend, the behaviour with forum and comment
should be the same than from backend. The website_publisher can decide to
create or not a forum linked to this course and decide independantely to allow
the review and comment on that course.
Commit linked to task ID 1941250 and PR #31584.
Purpose of this merge is to perform some code cleaning in eLearning
controllers and demo data. There are also some fixes coming from first
user testing of eLearning. See sub commits for more details.
Merge linked to task ID 1941250 ("fix all the eLearning").
closesodoo/odoo#31512
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Since design refactoring from af41382fa1, eLearning navbar style
was not displayed correctly. This commit fixes this by applying same design
rules as user profile page navbar.
Task ID : 1941250
PR #31512
If a new user try to access the elearning platform or his porfile, if he has
no karma, has it is the case for new users, he won't get any rank. So that
the next rank karma minus current rank karma equals zero.
To avoid this, next_rank will always be first one existing if the user has no
karma. Also, the current rank will not be displayed if the user has no karma.
finally, next rank will not be displayed if the user reached the last existing
rank.
Task ID : 1941250
PR #31512
Badges that should be displayed on user's profile page must be website
published. Badges that are website_published are typically forum badges or
others that will be configured for eLearning.
Task ID : 1941250
PR #31512
Simple fix to already have the standard gray background. Future commits will
improve display of not fullscreen lessons but this fix was necessary for
incoming work.
Commit linked to task ID 1941250 and PR #31512.
Currently a slide that can be previewed is never set as completed. Correct
condition to not update the hard slide-partner relationship is:
* either current user is public;
* either current slide is not published (happens when a publisher sees still
unpublished lessons);
* either current user is not member of slide channel (happens when seeing a
free preview slide without being channel member);
Commit linked to task ID 1941250 and PR #31512.
Correctly fetch courses the current user is a member of, not those he already
finished at least a lesson.
Commit linked to task ID 1941250 and PR #31512.
Currently there is a tool method on controller allowing to prepare some
slide related data. However controllers still add values in the slide
dictionary outside of this method, making it non consistent.
Let us prepare all side related data in this tool method to simplify code
understanding.
Commit linked to task ID 1941250 and PR #31512.
Purpose is to order methods and routes according to the main related model.
Main routes are above, then tools (sub routes, json routes).
Commit linked to task ID 1941250 and PR #31512.
Purpose is to have a bit more demo data allowing to test quizzes and see
how they behave. Notably
* have more than one question in existing quizzes to check answer validation
more in-depth;
* have more than 2 answers to check answer highlighting more in-depth;
* clean a bit user related demo for channels and slides;
Commit linked to task ID 1941250 and PR #31512.
Media dialog was trying to reach the current media's parent node, which
was not possible as it was cloned on instantiation.
To fix this, the `showImageDialog` now passes the `onlyImages` option
upon instantiation, checking the parent's data. It also passes the
media's parent if said parent is a video. This way, neither of these two
things need to be done in media dialog.
closesodoo/odoo#31634
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
When renaming a binary field name (through Studio for example), an error occurs
since rev. odoo/odoo@66f0e26
As the binary (custom) field is now created with `attachment=True` by default,
it has no associated column in the database ; this latter shouldn't be renamed
then.
Task 1942181
closesodoo/odoo#31504
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Issue detected with tests in the branch that replace deferred by native
Promise. Need to add isMedia to detect if the target is already a media
when focus the editor.
closesodoo/odoo#31632
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
As both `survey_url` and `public_url` are `Char` fields, the correct widget
to use is `CopyClipboardChar` (`CopyClipboardText` is for `Text` fields).
This was causing a display issue (the style of mentioned widgets is different).
Task 1935577
closesodoo/odoo#31624
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Why reverting ?
The fact that the control panel changes width on first edit is confusing to the
user. The whole form shifts down. We want to avoid having elements appearing
and disappearing. The issue that the user does not know if he has to save is
still up to date, and will be addressed in the next saas. We will most likely
use what has been done in this task to only display 'There are unsaved
changes'. Thank you all for your work here!
Original task and revert discussion can be found on task ID 1917637 .
This reverts commit 514d6fb90d.
closesodoo/odoo#31622
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Default the responsible to the current user if the mo is created
manually.
Default the responsible to empty if the mo is created by a procurement
rule.
task 1938495
closesodoo/odoo#31395
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
We added the form view to remove no needed fields.
It's now use the same fields used by the editable list.
We also added the Kanban view to improve the layout "Optionnal Product"
tabs on mobile device.
Task: 1945006
closesodoo/odoo#31596
Signed-off-by: =?utf-8?q?Adrien_Dieudonn=C3=A9_=28adr=29?= <adr@odoo.com>
Commit 4960453d added the field signature in field_registry.js and
in signature.js.
closesodoo/odoo#31434
Signed-off-by: =?utf-8?b?R8OpcnkgRGVib25nbmllIChnZWQp?= <ged@openerp.com>
Steps to reproduce:
1. install `hr_contract_salary`
2. create a contract
3. set or update `hr_responsible_id` on the contract
(it creates a `mail.tracking.value`)
4. uninstall `hr_contract_salary`
5. go to the contract form view
=> traceback `hr_responsible_id` does not exist
Before displaying a `mail.tracking.value`, `groups` of the
fields are checked to fitler tracking values according to access
rights of the user.
However if the module that added the field has been uninstalled,
the field does not exists anymore.
Fix:
check if field exists before getting fields groups.
If the field does not exists: set groups to `base.group_system`
closesodoo/odoo#31398
Signed-off-by: "Yannick Tivisse (yti)" <yti@odoo.com>
super.message_post in _message_log is wrong.
Also use `*args` and `**kwargs` in method parameters
closesodoo/odoo#31354
Signed-off-by: "Yannick Tivisse (yti)" <yti@odoo.com>
For iframes, we need to inject summernote because there are references
to "document" in it. When loading the iframe, if it is canceled, there
is a risk that the library is erased and that it breaks the field html.
We must also slightly modify the library to prevent it from making
changes to the library of the main "window".
Currently it is not possible to create or write on a mail
activity without having the rights to write on mail activity type.
This is caused by the some related fields on mail activity are
not readonly hence trying to write on mail activity type
This issue was previously shadowed by a sudo call both in
the create and write methods, those disappeared
with the following commit odoo/odoo@b9c8ba83e6
As those fields should never have been defined as readonly=False,
this commit sets them to readonly=True
closesodoo/odoo#31468
Signed-off-by: "Romain Libert (rli)" <rli@odoo.com>
This merge contains various improvements and fixes related to the new
eLearning application. Sub commits will give you more details on this
merge content as everything is not completely related.
Containing mainly
* improve demo data to have more links and quizzes;
* redesign the profile page, make it responsive and use bs4 when possible;
* fix lesson list in training channels not displaying all slides;
* improve lesson list design;
Merge linked to task ID 1941250 and PR #31453 about post-merge
cleaning and review.
Signed-off-by: "Thibault Delavallee (tde)" <tde@openerp.com>
Currently slides are displayed in a reorderable list, using current user
access rights. This means external customers see only published and free
lessons.
However purpose of course page is to display all lessons, and display
only available ones as clickable. Other one should be displayed as muted
to tease people.
Note that a specific lesson page does check for access rights. Here we
just display all lessons names. A label for free preview is also added.
Fetch of data when displaying a channel is therefore a bit modified as
there are less differences between training and documentation channels.
User progress is also updated to be easier to use in templates.
Commit linked to task ID 1941250 and PR #31453
Purpose of this commit is to make a new design linting pass on homepage.
Containing
* various bs4 and responsive improvements;
* footer banner improvements;
Commit linked to task ID 1941250 and PR #31453
Purpose is to perform a cleaning pass on website_profile templates. It
cleans the DOM, templates and CSS and proposes various improvements on
general design and layouting. This includes notably
* lessen custom CSS and use bootstrap 4 classes;
* simplify layout when possible;
* make is responsive and mobile friendly;
No functional changes should occur with this commit.
Sub modules are impacted as profile is extended in various other
applications: eLearning, forum and certification.
Commit linked to task ID 1941250 and PR #31453
A specific template to display an icon depending on slide type has been
added recently. However presentation icon was missing. This commit fixes
that.
We also added an option to tune the classes added on the icon. It gives more
flexibility when using it.
Commit linked to task ID 1941250 and PR #31453
Purpose of this commit is to fix and improve some model related bits of
code:
* add an ondelete cascade on some required fields;
* make a public method private because it should be accessed only through
controllers;
* do not add odoobot as channel member; notably for demo data it can create
unnecessary of noise in members and notifications;
Commit linked to task ID 1941250 and PR #31453
Purpose of this commit is to improve eLearning demo data. Notably links
(links to external resources on a given slide) and quizzes (allowing to
gain karma) are added. Some slides are added. Demo user interaction with
eLearning is also added, such as membership and votes. Finally a channel
is specifically kept specific to 1 single slide of type certification as
its flow has to bypass some screens when selling pure certifications.
Commit linked to task ID 1941250 and PR #31453
The reconsiliation code was looking for the aquirer_reference instead of
the reference to find out the corresponding transaction. Which leads to
not finding the corresponding transaction.
This behavior comes from the creation of the moule setting its own tests
in error in PR: https://github.com/odoo/odoo/pull/24802closesodoo/odoo#31365
Installing the 'lunch' module add css rules to the generic list view
styling, modifying the styling of all the list views by the simple fact
of being installed.
The goal of those rules is that in list view a table cell with the
o_text_overflow class should still be displayed as a table-cell (and not
a block/inline-block).
Without the lunch module a list view's cell with the o_text_overflow
class is narrower and break the alignment between this column and the
headers.
This commit moves the necessary rule (display property) to the web
module and apply them globally.
Remark: module's css rules shouldn't override globally the one from
'web'.
Original commit: https://github.com/odoo/odoo/commit/855c6dac25fccaf9312543022001ed0b360d6e13closesodoo/odoo#31506