Commit Graph
124531 Commits
Author SHA1 Message Date
Thibault Delavallée bccfe8a418 [IMP] website_slides: display a flag for unpublished lessons in course list view
It helps course maintainers understanding the state of their lessons.

Commit linked to task ID 1941250 and PR #31708.
2019-03-08 14:51:25 +00:00
Thibault Delavallée 6b7eeac56d [FIX] website_slides: fix domain computation of a channel slide list
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.
2019-03-08 14:51:05 +00:00
Thibault Delavallée edf68bde6c [REF] website_slides: extract code to have slides per category
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 .
2019-03-08 14:46:32 +00:00
Antoine Guenet c9b1401a23 [FIX] web_editor: update the handle on click input node in website edit
When clicking on a snippet containing an input node on Firfeox, the
handle wouldn't appear as expected. This is due to trying JQuery (but
not only) trying to modify properties that are restricted on Firefox but
not on Chrome. The error message still appears from time to time due to
Summernote using `document.getSelection`, which is problematic with
Firefox. This will be fixed with the next version of the editor. In the
meantime the direct effect of that error (the handle issue) is fixed
with this commit.

The standard target (`Event.target`) is now looked for in first position
instead of non-standard 'Event.srcElement` (IE alias for `Event.target`)
then `Event.originalTarget` (Mozilla-specific) and finally
`Event.target` (standard). `Event.originalTarget` is restricted on
Firefox so it was giving the same cryptic error as mentioned above
("Error: Permission denied to access property", which generally points
to same-origin policy violations).

Ref:
- https://developer.mozilla.org/en-US/docs/Web/API/Event/srcElement
- https://developer.mozilla.org/en-US/docs/Web/API/Event/originalTarget
- https://developer.mozilla.org/en-US/docs/Web/API/Event/target
- https://developer.mozilla.org/en-US/docs/Web/API/Window/getSelection#Related_objects
- https://developer.mozilla.org/en-US/docs/web/javascript/reference/errors/property_access_denied

closes odoo/odoo#31710

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2019-03-08 14:41:49 +00:00
Thibault Delavallée 7afd23e56c [FIX] website_slides: various fixes
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>
2019-03-08 11:15:07 +00:00
David Beguin 523c1276a1 [IMP] gamification : move rank demo data into data
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
2019-03-08 11:15:07 +00:00
David Beguin f38a81f981 [IMP] website_slide_survey : set slide completed when quizz_passed
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
2019-03-08 11:15:07 +00:00
David Beguin 6091062e66 [IMP] website_(profile, slides): add custom pager to show on all users / courses pages
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
2019-03-08 11:14:45 +00:00
Thibault Delavallée 20e68b3297 [REF] website_slides: rework standard lesson page view
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>
2019-03-07 19:51:33 +00:00
Romain Estievenart ab90dfd6c3 [FIX] portal: Remove non compliant ES5 syntax
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.

closes odoo/odoo#31522

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-03-01 13:56:05 +00:00
Romain Estievenart 9950c38ec3 [FIX] hr_skills: Remove non compliant ES5 syntax
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.
2019-03-01 13:56:05 +00:00
Thibault Delavallée 62d0eee644 [FIX] website_slides_forum: put demo in demo
Otherwise zizisse error traceback prone.

closes odoo/odoo#31672

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-03-07 15:33:37 +00:00
mgh-odoo f217aa528f [FIX]web_editor: Fixed traceback due to 'field_html' widget while saving record
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: #1932687
Closes: #30833

closes odoo/odoo#31581

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-03-05 09:09:33 +00:00
jem-odoo 3393dd0030 [REF] website_slides: redesign quiz widget
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>
2019-03-07 09:41:43 +00:00
David Beguin f029bf71d0 [IMP] website_slides_forum : allow to create a forum and to comment on course frontend creation
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.
2019-03-07 09:42:03 +00:00
Thibault Delavallée 47b308d8ae [FIX] website_slides: correctly return deferred when calling slide routes in fullscreen
I promise to fix all deferred. Huk huk huk.

Commit linked to task ID 1941250 and PR #31584.
2019-03-07 09:41:43 +00:00
Robot Odoo 10469b81f6 [MERGE] website_slides: clean controllers and apply various fixes
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").

closes odoo/odoo#31512

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-03-06 16:58:30 +01:00
David Beguin 6aedd56c40 [FIX] website_slides_forum : fix elearning navbar style in forum
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
2019-03-06 14:09:16 +00:00
David Beguin 1949c796b5 [FIX] gamification, website_profile : re-fix division by zero if user has no karma
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
2019-03-06 14:08:24 +00:00
David Beguin c7cceaef79 [FIX] website_profile : hide badge if not website_published on user's profile page
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
2019-03-06 14:06:27 +00:00
Thibault Delavallée 31d9bbd904 [FIX] website_slides: add gray background to lesson not fullscreen display
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.
2019-03-06 14:03:17 +00:00
Thibault Delavallée 9e7c5537d2 [FIX] website_slides: fix set viewed slide
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.
2019-03-06 14:03:17 +00:00
Thibault Delavallée 3bdccc0867 [FIX] website_slides: latest courses should display all my courses
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.
2019-03-06 14:03:17 +00:00
Thibault Delavallée 711a48aaa8 [REF] website_slides: clean slide fetch details method and controller
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.
2019-03-06 14:03:17 +00:00
Thibault Delavallée 181e6487ef [IMP] website_slides: reorder controller code to ease understanding
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.
2019-03-06 14:03:17 +00:00
Thibault Delavallée 813943c8bc [IMP] website_slides: improve demo related to quizzes
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.
2019-03-06 14:03:16 +00:00
Antoine Guenet 0374ecaeb8 [FIX] web_editor: properly set media dialog onlyImages and find video
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.

closes odoo/odoo#31634

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2019-03-06 12:51:41 +00:00
Martin Geubelle f1c0530515 [FIX] base: do not rename binary fields column
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

closes odoo/odoo#31504

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-02-28 13:36:08 +00:00
RomainLibert 8c8b1c853e [FIX] hr_payroll: rewrite action_validate in api.multi
Also apply some linting

closes odoo/odoo#31499

Signed-off-by: Romain Libert (rli) <rli@odoo.com>
2019-02-28 13:13:17 +00:00
Gorash e797d7a3c3 [FIX] web_editor: wrong focus detection in the editor
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.

closes odoo/odoo#31632

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-03-06 12:33:36 +00:00
Martin Geubelle 03a217e47e [FIX] survey: use correct widget for CopyClipboard
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

closes odoo/odoo#31624

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-03-06 10:09:38 +00:00
Thibault Delavallée 7836b99690 [REV] base: revert "Hide Save/Discard on Settings until there are modifications"
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.

closes odoo/odoo#31622

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-03-06 09:53:55 +00:00
Simon Lejeune c84d183524 [REF] mrp: manufacturing order responsibles
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

closes odoo/odoo#31395

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-03-06 09:09:47 +00:00
Romain Estievenart 69b503f975 [FIX] sale_management: add missing view on sale_order_option_ids field
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

closes odoo/odoo#31596

Signed-off-by: =?utf-8?q?Adrien_Dieudonn=C3=A9_=28adr=29?= <adr@odoo.com>
2019-03-05 13:29:48 +00:00
Aaron Bohy df7fcfb3fd [FIX] web: remove duplicated entry in field_registry
Commit 4960453d added the field signature in field_registry.js and
in signature.js.

closes odoo/odoo#31434

Signed-off-by: =?utf-8?b?R8OpcnkgRGVib25nbmllIChnZWQp?= <ged@openerp.com>
2019-03-05 09:11:37 +00:00
Lucas Lefèvre 120b8768bb [FIX] mail: Check field exists when computing groups
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`

closes odoo/odoo#31398

Signed-off-by: "Yannick Tivisse (yti)" <yti@odoo.com>
2019-03-05 08:55:02 +00:00
Lucas Lefèvre d31f3ebade [FIX] hr: Fix wrong super call
super.message_post in _message_log is wrong.

Also use `*args` and `**kwargs` in method parameters

closes odoo/odoo#31354

Signed-off-by: "Yannick Tivisse (yti)" <yti@odoo.com>
2019-03-05 08:54:11 +00:00
Gorash a8e95217c9 [FIX] web_editor: Expose focus method for activate method of html field
closes odoo/odoo#31577

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-03-04 08:41:09 +00:00
Gorash 972a1c9920 [FIX] web_editor: Evoid the risk of deleting the summernote library
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".
2019-03-04 08:33:53 +00:00
RomainLibert 30bbfff8b4 [FIX] mail: set mail.activity.type related fields readonly
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

closes odoo/odoo#31468

Signed-off-by: "Romain Libert (rli)" <rli@odoo.com>
2019-03-01 15:42:32 +00:00
Robot Odoo 6fc1f7d3d3 [MERGE] website_slides(_*): improve profile, lesson list display and demo data
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>
2019-03-04 18:14:38 +01:00
Thibault Delavallée dc76c99a1e [FIX] website_slides: fix display of lessons in training course
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
2019-03-04 16:28:27 +00:00
Stefano Rigano a488cf67ed [IMP] website_slides: slightly improve homepage
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
2019-03-04 16:13:57 +00:00
sri-odoo af41382fa1 [REF] website_profile and dependencies: improve global layout and design
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
2019-03-04 16:13:52 +00:00
sri-odoo 4363598582 [REF] website_profile: improve rank progress template
Purpose is to make it better looking and responsive.

Commit linked to task ID 1941250 and PR #31453
2019-03-04 16:13:45 +00:00
Thibault Delavallée 2ab2de24f2 [FIX] website_slides: add missing presentation icon used in some templates
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
2019-03-04 16:13:21 +00:00
Thibault Delavallée adcdb4e0f0 [FIX] website_slides: various models improvements
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
2019-03-04 16:13:04 +00:00
Thibault Delavallée 2f8ea621a8 [IMP] website_slides(_*): improve demo data
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
2019-03-04 16:12:57 +00:00
Pierre Masereel e21f185d3c [FIX] payment_payulatam: fix transaction reconsiliation
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/24802

closes odoo/odoo#31365
2019-02-22 13:37:10 +00:00
Pierre Paridans c0f8690d1b [FIX] lunch,web: display correctly list's cell with text overflow
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/855c6dac25fccaf9312543022001ed0b360d6e13

closes odoo/odoo#31506
2019-02-28 15:08:15 +00:00