Commit Graph
533 Commits
Author SHA1 Message Date
Maruan Aguerdouh (magm) c357496609 [FIX] website_slides: load animations after slide loaded
Issue: When using the Fullscreen mode of slides for articles we do run
first the website animations before loading the slide, which will make
the content to stay invisible since we will never actually perform the
animation.

Steps to reproduce:

1. Create a new course with an article content.
2. Add any block (text, image).
3. Add an animation to this piece of block.
4. Go to Fullscreen mode.

Solution:

We manually instantiate and attach the WebsiteAnimate widget to
the wpContainer element to ensure animations are properly initialized
and applied after the slide has loaded, after that we get rid of this
instance after every new slide that load so we avoid having multiple
instances.

opw-3757919

closes odoo/odoo#159445

X-original-commit: 593ca1f36a4a9da753d8361840b07e2445f2d99b
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
Signed-off-by: Maruan Aguerdouh Mohtar (magm) <magm@odoo.com>
2024-03-28 10:19:41 +00:00
Pierre-Yves Dufays c46c60d398 [FIX] website_profile: fix karma wheel layout
How to reproduce:
- Install "French" for the website
- log out and log in as demo
- Go to the front-end and click on "Courses"

The design of the karma wheel is broken because the translation for
"Get 7.5k< xp to level up!" displayed in the wheel is too large ("Obtenez 7.5k
xp pour passer au niveau supérieur"). While in French the text go outside the
wheel and it appears clearly broken, it is also the case in English as the rank
name is hidden due to the length of the text (for example when gaining one
karma: 7.49k is displayed instead of 7.5k which takes more place).

To avoid modifying the template "profile_next_rank_card" that could break
community overrides, we solve this problem in css by increasing the karma
wheel size and the precentage of width occupied by the text inside the wheel.
We also reduce the vertical margin between the rank name and the descriptive
text and reduce the line height to avoid the text to overlap with the wheel.
And if the text is still too large for some language it will be truncated and
an ellipsis will be used.

Technical note: we do the change in website_profile.scss (and not in
website_slides.scss) because it applies to both karma wheel: the one on course
home page and the one in the profile page.

Task-3617054

X-original-commit: f32eabf55db4db4d46b45032c76bfa17dfce475f
Part-of: odoo/odoo#157655
2024-03-14 15:43:45 +00:00
Florian Charlier c1b86a946d [FIX] website_slides: add missing no-demo test data
The `course_publisher_standard` tour was missing slide (channel) tags.

We are replacing values used in the tour so that the tour
runs on the same data whether demo data is installed or not.

See runbot build errors 55762 and 55768.

Task-3744848

closes odoo/odoo#156797

X-original-commit: 7d614147bde737c69bed928c7c19d1ac3e7077c8
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Florian Charlier (flch) <flch@odoo.com>
2024-03-07 13:23:22 +00:00
Mayurrajsinh Rathod 141354ca05 [FIX] website_slides: display preview button correctly
Bug
=====
Click the `preview` button on the course page. It does not apply the proper styles
to the button used for enabled or disabled content previews.

Technical
===========
With commit https://github.com/odoo/odoo/commit/2d386bc437194b78ea5d446d7b0fa4f5444406e2, the `badge-hide` class used for the `preview` button was
replaced and some styles were altered.

After this commit
==================
The `preview` button is functioning properly.

Task-3751285

closes odoo/odoo#156409

X-original-commit: 0dd6eba169b17d02f0b8a2b6fbcd8963db75d292
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2024-03-05 10:03:21 +00:00
std-odoo 2009dfd3c6 [FIX] website_slides: fix embedded PDF navigation buttons
Bug
===
When we show a PDF in e-learning, we have some navigation buttons
(next, previous, last, first) with some conditions for them to be
enabled or not (e.g. a documentation can have suggested slides, and
so the next button is visible even if we are on the last page).

Those conditions are broken (sometimes a button is disabled when it
shouldn't and vice versa), this commit aims to fix that issue.

Task-3751253

closes odoo/odoo#156363

X-original-commit: f22ef44fc509e4dc1c75fbde54027bf8104c54e6
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
2024-03-05 10:03:20 +00:00
amdi-odoo fb3779eaf9 [IMP] website_slides: increase sections font weight
Purpose
=======
Increase the bold of the sections in back end to better
differentiate them from the content.

Specifications
==============
Adding !important next to the css bold style (value = 700)
applied on the sections to make sure it takes the priority
over the default list view sections "fw-bold" class (value = 500).

Task-3759152

closes odoo/odoo#154990

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2024-03-04 08:11:54 +00:00
Louis (loco) fb2296adec [IMP] *: improve accessibility of website pages
*: base_import, gamification, hr_skills, mass_mailing, portal,
portal_rating, survey, web, web_editor, website, website_sale,
website_slides

The goal of this commit is to improve the accessibility of the website
pages. This has been made by implementing and correcting ARIA
(Accessible Rich Internet Applications) roles and attributes. More
precisely:
- An `aria-label` attribute has been added on progressbar elements to
avoid a warning of type `ARIA progressbar elements do not have
accessible names`. It has also been added on iframes to avoid a warning
of type `<frame> or <iframe> elements do not have a title`. Furthermore,
`aria-label` has been incorporated on some anchors to avoid a warning of
type `Links do not have a discernible name`. Finally, it has been added
on elements that have the `dialog` role to avoid a warning of type
`Elements with role="dialog" or role="alertdialog" do not have
accessible names` and on elements that have the `listbox` role to avoid
a warning of type `ARIA input fields do not have accessible names`.
- To avoid a warning of type `Some ARIA parent roles must contain
specific child roles to perform their intended accessibility functions`,
`role="menuitem"` has been added on children of menu elements. As
explained in [the menuitem role documentation], "The `menuitem` role
indicates the element is an option in a set of choices contained by a
`menu` or `menubar`". To avoid this warning, `role="presentation"` has
also been added on elements located between `tablist` and `tab` and
between `menu` and `menuitem`. Indeed, as explained in
[the presentation role documentation]; "The `presentation` role removes
an element's implicit ARIA semantics from being exposed to the
accessibility tree". The goal is to inform the assistive technologies
that the default semantics of the element should be ignored. Finally, to
avoid this same warning, the `option` role has been added on elements to
identify selections a user can make in a `listbox`.
- The `aria-label` of some elements has been adapted in order to avoid a
warning of type `Elements with visible text labels do not have matching
accessible names`.
- The value of `aria-disabled` has been corrected to `true` (instead of
`disabled`) (see [the aria-disabled documentation]).

Still to improve the accessibility of the website pages, an alternative
text (`alt`) attribute has been provided for images.

[the menuitem role documentation]: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/menuitem_role
[the presentation role documentation]: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/presentation_role
[the aria-disabled documentation]: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-disabled#values

closes odoo/odoo#140453

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2024-02-29 12:13:35 +00:00
Shubham Thanki 91f070078c [FIX] websites_slides: add padding to the article in fullscreen view
Before this commit:
- In the fullscreen player, the content of an article from any course stuck to
  the contents sidebar, leading to a lack of visual separation.

After this commit:
- Added padding to the article content in fullscreen view. Creating a clear
  distinction between the content and the sidebar.

Task-3748836

closes odoo/odoo#155207

X-original-commit: ebb86b65acc2cf59fd3272f56054c00b161fe9aa
Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
Signed-off-by: Shubham Thanki (shut) <shut@odoo.com>
2024-02-26 17:09:53 +00:00
Pierre-Yves Dufays 10bb041a45 [FIX] website_slides: fix duplicate quiz
How to reproduce:
1. Open eLearning app
2. Go to any course having document with quiz.
3. Solve the quiz
4. Click multiple time quickly on 'Done' (green tick) button.
5. Multiple quiz are displayed if your connection is slow or you click fast
enough.

The fix ensures that only one quiz is displayed. We do the same change for
video to prevent such problem with them.

Technical note: when clicking on the "green tick" of the quiz, the method
_toggleSlideCompleted is called which cause a _renderSlide. That method clears
the content div (o_wslides_fs_content) and appends a new Quiz widget to that
div. The problem is that the "append" is asynchronous (it call the "willStart"
of Quiz widget that fetch the quiz) so if you click multiple time, the content
div is cleared multiple times and then after each quiz created is ready (after
having fetched the data), they are appended to the content div, resulting in
multiple quiz displayed.

We solve the problem by avoiding concurrent execution of the _renderSlide
method: the body of the method is skipped when the rendering is ongoing (for
example while waiting the quiz from the server). As the method is inserting the
slide at the same place, its behavior was anyway unpredictable because
depending on the response time of each request. By skipping the method body
while already running we make it a bit more predictable, avoid the content
duplication on the page, and we avoid unnecessary call to the server.

Task-3412847

closes odoo/odoo#154069

X-original-commit: 72e035274de3bbf7fcc858008bc00d095163e7f3
Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
Signed-off-by: Pierre-Yves Dufays (pydu) <pydu@odoo.com>
2024-02-19 17:53:12 +00:00
Jay Savaliya dcd97b3868 [FIX] website_slides: resolve slides completion status issue
Before this commit, users were unable to successfully revert the 'done' status
of slides.

Technical Reason:
In this commit https://github.com/odoo/odoo/commit/f956e83c744bd9c970d3f16ce1cb3cff8bba2f6b, the transition from qweb.render to the
Owl render engine (renderToElement) was done. This caused a problem when trying
to undo the 'done' status of slides. The issue was that using 'true' as a
boolean in Owl turned it into an empty string. This fix solves the problem by
making sure we use '0' or '1' as boolean values in Owl.

After this commit, user can revert slides 'done' status.

Task-3667904

closes odoo/odoo#151006

Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
2024-02-06 18:48:56 +00:00
Patrick Hoste 8c993deca6 [REV] website_slides : Adjust container to contain the full course name
This reverts commit 27a1ccc8 which fixed the container height
when course name was too long. It added a 'visibility: hidden'
style which caused an issue on the course left bar where the
progress bar and completed tag are located next to each other.

Task-3607404

X-original-commit: cac68b35777210c3f96a5bd187b479589716145d
Part-of: odoo/odoo#151736
2024-01-31 06:59:13 +00:00
Shaan Thakkar (THSH) deea06a2e3 [FIX] website_slides: button padding issue
How to reproduce
=================
1. Go to website slides.
2. Open any course which has quiz content.
3. Solve the quiz or open an already solved quiz.
-> Here we can see that the reset and continue buttons are overlapped.

After this commit
=================
Now there will be a space between the reset and continue buttons.

Task-3635485

closes odoo/odoo#146646

Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2024-01-17 15:36:26 +00:00
Pierre-Yves Dufays 6d5be6def6 [FIX] website_slide: correct spacing in quiz answer info
How to reproduce it:
- Install website_slides
- Go in the course "Basics of Gardening"
- Do the test "Test you knowledge" in fullscreen mode
- The information displayed about your answer is glued to the information icon

This fix the problem by adding space between the icon and the text.

Technical note: Although the html has not changed, the problem was not present
in previous version because the rendering process was not removing all spaces
which is now the case.

Task-3607117

closes odoo/odoo#144985

Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2024-01-17 15:36:25 +00:00
adsh-odoo a93956bb6b [FIX] website_slides: traceback while retaking quiz
Steps to reproduce
====================
1 Open the course and try to retake the quiz.
2 Traceback while submitting the quiz.

Technical
===========
Due to missing closing square bracket in the attribute selector of jquery.

After this commit
==================
There will be no traceback while submitting the quiz.

Task-3633410

closes odoo/odoo#147611

X-original-commit: eea7da64de4e6b70ea4d6b1fc277b36b278ad329
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-12-28 09:40:11 +00:00
Lopes Marc (loma) 657d5493f8 [FIX] website_slides: fix datetimeObj.getTime is not a function
HOW TO REPRODUCE
================

- Don't need to login
- From Odoo front-end, go to Courses > Trees, Wood and Gardens >
    Main Trees Categories
- You get the following client error:
    Uncaught Promise > datetimeObj.getTime is not a function

HOW TO SOLVE:
============

Unlike standard JS equivalent, luxon datetime objects don't have a
getTime() function. Replace it by valueOf() function.
Also, remove calls to `DateTime.fromJSDate().formatting_fn()` by
luxon equivalent functions.

see bb09cf76e3

task-3632077

closes odoo/odoo#145573

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-12-21 16:07:45 +00:00
Pierre-Yves Dufays 910386bee9 [FIX] website_slides: fix a tour that fails randomly
In v17.0, the test TestUiPublisher.test_course_publisher_elearning_manager of
website_slides fails randomly at the step: "eLearning: check uploaded pdf
presence and perform comparison" with the error: "Cannot read properties of
null (reading 'getAttribute')"

How to reproduce it ?
Locally, TestUiPublisher.test_course_publisher_elearning_manager of
website_slides runs without errors but when executing it in the browser we
get the same error as the runbot systematically:
–	Install website_slides
–	Go to shell mode and execute the setup of the test
–	(Backup DB if you want to run the test multiple time)
–	Launch in normal mode and connect with demo user
–	Go to URL: /web?debug=assets%2Ctests
–	Type “odoo.startTour('course_publisher_standard');” in the console
–	An error happens at step “eLearning: check uploaded pdf presence and
perform comparison”: Cannot read properties of null (reading 'getAttribute')
(to avoid to wait too long, you can shorten the test by keeping mostly
“addPdfToSection”)

The problem occurs because the rendering of the iframe o_wslides_iframe_viewer
is not always completed when the check is triggered.
We solve this problem by waiting for the rendering to finish before performing
the test (using "await contains"). For safety, we do the same for another check
as this might cause a similar problem in the future.

Although the test has been introduced in 16.2 (see odoo/odoo#117293) but the
error happens only in 17.0 (tested only in 16.4 the way described above), we
publish only the correction in 17.0 and further to avoid different correction
in various version.

Task-3623736

closes odoo/odoo#144719

Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-12-05 19:53:32 +00:00
Maruan Aguerdouh (magm) 84813e7a70 [FIX] website_slides: article content plain text visible in fullscreen
Steps to reproduce:

- Get the eLearning App.
- Go to an existing course or create a new one.
- Add a new content of type article.
- Go to website preview and to edit this slide.
- Write plain text inside the box of content.
- Go to Fullscreen.

The issue is that we are using `.append()` and this expects that we pass
it an html or a jquery object which is not the case when we just type
plain text inside it, so using `.html()` will allow us to render any
content as HTML.

opw-3265113

closes odoo/odoo#144818

X-original-commit: 34b78a6619888ebbc6e67b5c474260453a7ed84b
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-12-04 17:47:32 +00:00
Vivek Pathak 6603358361 [FIX] website_slides: fix template for 'Join This Course' button
Before this commit:
Clicking on the 'Join This Course' button without login triggers an error.

Reason:
The 'slide.course.join.popupContent' template contains multiple root nodes.
For correct template rendering text and anchor tags are placed inside div tags.

After this commit:
Correct popup content renders when clicking on the 'Join This Course' button,
without login.

Task-3559181

closes odoo/odoo#143280

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-12-04 11:58:13 +00:00
Patrick Hoste 4a97700a38 [FIX] website_slides: fix share copy link
With this commit 963842381e
ClipboardJS was removed to use the native clipboard api.
But here the innerText was checked instead of the value
so there was nothing to copy in the clipboard.
This commit fix this.

Task-3607299

closes odoo/odoo#143206

Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
2023-11-30 10:13:18 +00:00
Adrien Dieudonné e6c747b43b [REF] *: keyboard: replace deprecated charCode, keyCode and which properties
These properties are deprecated.

We should consider to use `KeyboardEvent.key` or `KeyboardEvent.code` for new code.
Note that we prefer to use the `key` property as multiple physical keys
can send the same value (e.g. Enter can also be sent by the numeric pad).
We should only use `code` when we explicitly want to target a single physical
key on the keyboard.

By doing this, we can now remove the dependency of `jQuery.ui.keyCode`
that was used as mapping of key code descriptions to their numeric values.

References:
https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/charCode (deprecated)
https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode (deprecated)
https://developer.mozilla.org/en-US/docs/Web/API/UIEvent/which (deprecated)

https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code
https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key

https://api.jqueryui.com/1.12/jQuery.ui.keyCode/

Some links that helps:
https://w3c.github.io/uievents/tools/key-event-viewer.html
https://www.toptal.com/developers/keycode/table

closes odoo/odoo#139809

Related: odoo/enterprise#49591
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-10-26 08:46:00 +00:00
Pierre Paridans 963842381e [IMP] web,*: replace ClipboardJS with Web API and homebrew polyfill
*: auth_totp_portal, mrp_subcontracting, project, survey, web_editor,
   website, website_links, website_sale_loyalty, website_slides, test_lint,
   spreadsheet

Implements missing `clipboard.write()` and `ClipboardItem` ; targets
only Firefox (which partially implements Clipboard API, features hidden
behind a preference flag).

Supported browsers: Chromium 76+, Safari 13.1+, Firefox 63+, Safari iOS
13.4+.

This allows to replace ClipboardJS by the native Clipboard Web API.

Reference:
https://caniuse.com/?search=clipboard
https://developer.mozilla.org/en-US/docs/Web/API/Clipboard_API
https://w3c.github.io/clipboard-apis/

task-3439226

closes odoo/odoo#134881

Related: odoo/enterprise#47154
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2023-10-26 07:22:54 +00:00
Chrysanthe (chgo) df8535fbd4 [REF] portal, *: portal redesign
*: base, account, account_payment, auth_top_portal, hr_timesheet, loyalty,
   mrp_subcontracting, payment, project, purchase, sale, sale_stock,
   sale_timesheet, website_crm_partner_assign, website_sale,
   website_slides

Portal general redesign. Increase visual consistencies with the backend
[1] and adapt to the new default website design [2].

[1] https://github.com/odoo/odoo/pull/116641
[2] https://github.com/odoo/odoo/pull/120302

task-3046004

Part-of: odoo/odoo#138077
2023-10-25 15:50:36 +00:00
Shaan Thakkar (THSH) 4e7d383692 [FIX] website_slides: unwanted html text
How to reproduce:
=================
1. Open any course having quiz.
2. Select quiz content.
-> In the quiz template we can see that the html content is not sanitize.

Technical:
==========
I think the issue arises after this commit https://github.com/odoo/odoo/commit/0d7acf60b4cca84a8c700edd97af8c4de6b78010

After this commit:
==================
Now t-esc is deprecated and the HTML text is not sanitize in the template
so instead of t-esc we are using t-out.

Task-3555159

closes odoo/odoo#138873

Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-10-25 11:37:30 +00:00
FrancoisGe bb09cf76e3 [REF] *: remove legacy time.js
The purpose of this commit is to delete the legacy/js/core/time.js file.
We have therefore replaced all calls to time.js with the l10N/date.js utilities.

Part of task 3439226

closes odoo/odoo#138609

Related: odoo/enterprise#48918
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-10-18 08:56:06 +00:00
Brieuc-brd 538fdab99b [IMP] *: fine-tune app icons
The aim of this commit is to improve the impact and rendering of app
icons in bright and dark mode. It also reduces the size of svg files.

To achieve that, this commit updates the colors to flat colors. This
change will make the icons stand out and improve their readability.

task-3072562

X-original-commit: 667a19162b74fb6554a2389ba9c6e69de4ff5113
Part-of: odoo/odoo#138279
2023-10-16 09:21:17 +00:00
Michael (mcm) 94824d8767 [IMP] *: remove legacy notification service mapper
This commit removes the mapper to the notification service and adapts
widgets that display notifications.

task 3439226

Part-of: odoo/odoo#138348
2023-10-13 09:17:45 +00:00
Nasreddin Boulif (bon) e22010ad89 [FIX] website_slides: hide suggested slides page slide when click prev
Step to reproduce:

  - Install `Elearning` module
  - Go to any course and a content as document
  - Upload a pdf with more than 1 page
  - Go to the website and click on the course then on the content with
    the document
  - Go to last page and click on next button (should display suggested
    slides page)
  - Click on previous button

Issue:

  Page displayed is not the last one, but the one before.

Cause:

  When clicking on the previous button, the current page is still the
  last page (just with the suggested slides page on top of it as
  overlay), and therefore will decrease it to the page number before
  last page (nb last page - 1).

Solution:

  When clicking on previous button, if we are on the suggested slides
  page (by checking if overlay is not hidden since no attribute is set
  on `EmbeddedViewer` to know if we are on that page), hide it.

opw-3482712

closes odoo/odoo#137644

X-original-commit: 422625615b2f6708667fa44d2a9e83ad3e66e5af
Signed-off-by: Nasreddin Boulif (bon) <bon@odoo.com>
2023-10-10 08:19:29 +00:00
Romeo Fragomeli 5f454f0ccb [IMP] web,web_editor,website_slide: sortable service for frontend usage
This commit removes the module sortable from jQueryUI and adds instead a
sortable service to use the sortable code already used by the backend.

The service can be called using `this.call("sortable", ...)` and the
sortable listeners are added when the `enable` function is called.
This function (`enable()`) returns an object that contains the `cleanup`
function (`cleanup()`).

```javascript
// start / setup
const sortable = this.call(
    "sortable",
    "create",
    {
        ref: { el: document.querySelector(".list") },
        elements: ".items",
        handle: ".drag-icon",
    },
);

// on attach callback / on mounted
const sortableInstance = sortable.enable();

// on destroy / on willUnmount
sortableInstance.cleanup();
```

Also, it adds some new property to the useSortable:
* clone: the placeholder is a clone of the drag element
* placeholderClasses: classes added to the placeholder element
* applyChangeOnDrop: on drop the change is applied to the DOM
* followingElementClasses: classes added to the element following mouse

task-3439226

closes odoo/odoo#137527

Related: odoo/enterprise#48371
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2023-10-10 01:59:35 +00:00
Guillaume (gdi) b3a1d0f9d0 [IMP] website, *: use BS mixin to have responsive font sizes
*: auth_totp_portal, event, portal_rating, web, web_tour, website_blog,
   website_event, website_event_booth, website_event_sale,
   website_event_track, website_event_track_quiz, website_payment,
   website_sale, website_sale_comparison, website_slides,
   website_twitter

This commit allows to have responsive font sizes on all the Odoo
frontend. It is based on the Bootstrap mixin `font-size` which
calculates the font size based on the viewport width.

task-1958098

closes odoo/odoo#129469

Related: odoo/design-themes#673
Related: odoo/enterprise#44578
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-10-08 22:12:13 +00:00
Jorge Pinna Puissant ef424a9dc2 [REF] *: remove owl from linter's accepted global variables
Before this commit, owl was in the linter's accepted global variables.
This allowed  direct access to owl global object.

For instance, to use xml from owl, you could do :
`const { xml } = owl;`
or you could use it directly:
`owl.xml`

Now, owl is not accepted on linter's global variables anymore, so to
import xml, now you need to use a proper import:

`import { xml } from "@odoo/owl";`

task-id 3498859

closes odoo/odoo#137517

Related: odoo/enterprise#48364
Related: odoo/design-themes#709
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-10-05 10:21:53 +00:00
Alexandre Kühn b526078ae9 [REF] mail: set data immediately on discuss model relational field
With this commit, instead of `Record.insert()` before setting
relation with records, we can immediately pass record data.
For example:
```js
message.author = { id: 3, type: "partner", name: "Admin" };
thread.messages.add({ id: 10, body: "some-text-content" })
```

This is supported on all relational fields that define a target
model.

To make this work while drastically avoiding cyclic dependencies
in code, whenever data have to be inserted in relation, they are
pre-inserted with essential data, and then they are fully inserted
after being registered in the relation.

closes odoo/odoo#136539

Related: odoo/enterprise#47854
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-10-02 11:42:55 +00:00
Mahamadasif Ansari 3389bbafad [REM] *: remove owl="1" from the templates
As all the templates are now imported in the owl app, there is not need
anymore to specify the owl="1" attribute in the templates.

Ref-https://github.com/odoo/odoo/pull/130467

task-3508331

closes odoo/odoo#136920

Related: odoo/enterprise#48065
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-09-28 16:57:55 +00:00
Michael (mcm) 7422eb643c [IMP] *: remove legacy rpc
This commit removes the files ajax.js and rpc.js then adapts all the
places where their exports were used. For most of the changes, it's a
replace of `this._rpc({...})` by a new `useService("rpc|orm")` like
pattern in the widgets.

closes odoo/odoo#136271

Task: 3439226
Related: odoo/enterprise#47775
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-09-27 11:33:01 +00:00
Shubham Thanki 6ca91cea77 [FIX] website_slides: update Vimeo description
Before this commit:
- Select a course from the website, and click 'Add Content'.
  From the 'Add Content' window, click 'Video'.
- The description with the title 'On Vimeo' is not up to date with
  Vimeo privacy management.

After this commit:
The description is now up to date.

task-3458724

closes odoo/odoo#136083

X-original-commit: 4a1d2a2726ce83edbf28dd478c60a3e6f67d4470
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-09-21 07:40:06 +00:00
Samuel Degueldre 4aaee61a5f [REF] website_slides: remove usage of legacy dialog to enroll
The Dialog widget is deprecated and will soon be removed, this commit
converts the usage of this dialog for the enroll buttons to use the new
dialog service.

To avoid duplicating the opening logic in the Quiz code, the selector of
the widget that opens the dialog now targets the #wrapwrap and uses
event delegation for the button, avoiding the need to manually spawn the
dialog for buttons added to the DOM after the first load.

closes odoo/odoo#135476

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-09-18 10:14:07 +00:00
Sébastien Theys 7ea370fce7 [REF] mail, *: tests: refactor contains to further remove jQuery
* = account, base_iban, bus, calendar, crm_livechat, hr, hr_holidays,
    im_livechat, mrp, project, sms, snailmail, test_mail,
    test_mail_full, web, website_livechat, website_slides

Add support in `contains` for most operations that we use in tests.
Remove return value from `contains`.
Move into `web` module.
Remove import/export chains, directly import from correct module.

closes odoo/odoo#134652

Related: odoo/enterprise#47064
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-09-14 11:22:47 +00:00
Aaron Bohy 0d7acf60b4 [REF] *: remove legacy Markup
Use owl.markup instead.

Part of task~3439226

closes odoo/odoo#134793

Related: odoo/enterprise#47124
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-09-11 19:13:59 +00:00
Géry Debongnie e0fdb6a0b4 [IMP] *: rewrite module loader
This commit rewrite the module loader to simplify it and to improve error handling.
before this commit, you could have silent errors or "lucky" imports (import a module based on the fact that his asset will surely be load and if not, the error would be silent anyway).
e.g.: The tours cannot import modules extern to tours' bundle anymore. Or load module before your libs in assets.

TASK ID: 3266021

closes odoo/odoo#128502

Related: odoo/enterprise#44100
Signed-off-by: Bastien Pierre (ipb) <ipb@odoo.com>
2023-09-08 16:47:56 +00:00
Aaron Bohy dc680a4429 [REF] web,*: stop using and remove legacy utils
*account,web_editor,website,website_sale,website_slides

This commit removes all legacy utils except Markup, which will be
removed in another PR. A lot of those utils were no longer used and
thus have just been removed. Those that were still used either
already existed in the wowl codebase, so usecases have been adapted
to use the new version instead. A few have been re-implemented (or
moved basically) to the wowl codebase (e.g. isEmail and humanSize).

Part of task~3439226

closes odoo/odoo#134620

Related: odoo/enterprise#47044
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-09-08 08:29:58 +00:00
divy-odoo cea1cab535 [FIX] *: resolve the last tour step warnings
When we haven't provided a custom action, the tour step runs the default
action. In the final step of the tour, when there is no `run` or
`isCheck` provided, It shows warnings of 'ignoring action (auto) of last
step' as it can lead to a race condition.

This commit resolves the warnings: `ignoring action (auto) of last step`

task-3429500

closes odoo/odoo#129239

Related: odoo/enterprise#46683
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-09-04 15:02:47 +00:00
Romain Estievenart 507c368836 [IMP] *: remove jquery.ba-bbq 🍖
Task Id: 3439226

closes odoo/odoo#133763

Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-09-01 15:09:51 +00:00
Sébastien Theys 78897c1890 [REF] mail, *: tests: use native code for most contains/text
* = calendar, im_livechat, project_todo, sms, snailmail, test_mail,
    website_slides

The choice was made to have "trimmed text" check rather than "contains"
to have more robust tests, at the cost of slightly more effort to write
complete and unique asserts.

There is no direct speed improvement from this one, but it is one step
closer to removing jQuery.

Moreover, it will fix infinite loops in some situations, because jQuery
selectors would write attributes on the body, which would trigger the
mutation observer, which itself will call the selector again.

Part-of: odoo/odoo#133717
2023-09-01 13:21:01 +00:00
Michael (mcm) 1f5e8f0fd4 [IMP] web,*: remove web.session
This commit removes the legacy session and adapts the modules where it
was used.

task 3439226

closes odoo/odoo#133153

Related: odoo/enterprise#46290
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2023-08-29 11:10:47 +00:00
Michael (mcm) 629a046e03 [IMP] web,*: empty services/core.js
This commit removes almost all exports of the module services/core.js
(only the bus is left) and adapts the module that imported it.

task 3439226

Part-of: odoo/odoo#133153
2023-08-29 11:10:47 +00:00
Michael (mcm) 55f1822911 [IMP] web,*: remove services/config.js
This commit removes the module services/config.js and adapts the module
that imported it.

task 3439226

Part-of: odoo/odoo#133153
2023-08-29 11:10:47 +00:00
Gorash 0d99f4b9d9 [REF] base,all: Update modifier syntax: adapt JavaScript
closes odoo/odoo#104741

Related: odoo/enterprise#35255
Related: odoo/documentation#3523
Related: odoo/upgrade#4884
Signed-off-by: Rémy Voet (ryv) <ryv@odoo.com>
2023-08-18 09:49:16 +02:00
FrancoisGe e3da5f1b7d [REF] *: convert legacy dialogs
The goal of this commit is to convert a bunch of legacy dialogs into owl dialogs.

closes odoo/odoo#131278

Task-id: 3453920
Related: odoo/enterprise#45484
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-08-16 16:05:12 +02:00
Jorge Pinna Puissant e338487028 [REF] *: remove owl="1" from the templates
As all the templates are now imported in the owl app, there is not need
anymore to specify the owl="1" attribute in the templates.

Part of task~3443861

Part-of: odoo/odoo#130467
2023-08-11 14:32:30 +02:00
Jorge Pinna Puissant 065a2f451a [REF] *: csrf_token is not available in the rendering context
As the templates are now rendered with owl, csrf_token is not available
in the rendering context.

Part of task~3443861

Part-of: odoo/odoo#130467
2023-08-11 14:32:30 +02:00
Jorge Pinna Puissant f956e83c74 [REF] *: remove qweb.render
This commit removes the qweb.render method, instead it will use the owl
render engine (renderToString or renderToElement).

Part of task~3443861

Part-of: odoo/odoo#130467
2023-08-11 14:32:28 +02:00