Commit Graph
459 Commits
Author SHA1 Message Date
Samuel Degueldre 81be42d8f9 [FIX] *: ensure tour tips are correctly translated
*: account, crm, crm_iap_mine, event, hr_expense, hr_holidays,
hr_recruitment, lunch, mail, mass_mailing, point_of_sale, project,
purchase, purchase_stock, sale, survey, web, website, website_blog,
website_event, website_forum, website_sale, website_slides,
test_main_flows

In odoo/odoo#111103 the tour system was rewritten. The previous tour
system used to depend on the `root.widget` js module, and this module
was an async module that indirectly depended on `session_bind` which
would load the translations, meaning that the js module definition code
of the tours would only run after the translations were loaded. This is
no longer the case with the new tour system, this means that the module
definition code is executed as soon as the dependencies of that module
are fulfilled, which is generally befoe the translations are loaded,
causing most tour tips to not be translated.

This commit adds a hacky workaround for this problem: it creates a new
module that has a default export which is a promise, and has a legacy
alias, this creates an async module that waits for the translations to
be loaded. This module is then imported for its side-effect in all
onboarding tours, causing them to be translated correctly once again.

This commit also needs to convert the steps key in the tours internal
registry to a getter. In previous versions, the steps were directly
added as is to the internal state of the tour service, but since
odoo/odoo#122834 the steps are now mapped, and without a getter, any
edits to the steps occurring after registration will not be taken into
account. This causes issues in some modules that change original
behaviour of other modules (eg accounting makes invoices into a menu in
the accounting app instead of a top-level app in the home menu) as they
need to edit the steps of existing tours to make them work.

In a separate PR, we will implement a more proper fix by changing the
API of the tour manager so that we no longer need this workaround.

closes odoo/odoo#125284

X-original-commit: d130699ba82dc9919c9116f4b64a5e461ebb6319
Related: odoo/enterprise#42655
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-06-19 13:35:28 +02:00
divy-odoo 21f5d1c678 [FIX] website_blog: fix size options values when blog regular cover
Before this commit, the widget value was updated (based on the current
state) prior to updating the snippet UI. As a result, the widget value
reflected used the non-updated UI labels.

task-3112890

closes odoo/odoo#122810

X-original-commit: edc88a2ab99673427cbeac05246b8e586b121b72
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Divyesh Vyas (divy) <divy@odoo.com>
2023-05-31 11:44:58 +02:00
Brieuc-brd fa60bac197 [IMP] *: app icons : add viewBox attribute
Prior to this commit, the SVG's viewBox attribute was missing, which
prevented svgs from being scaled.

This commit fixes this issue.

task-3326633
Part of task-3326263

X-original-commit: 30300c373ad1c63a6cf8b035cae0785a09c6933f
Part-of: odoo/odoo#121886
2023-05-22 13:54:08 +02:00
Pulinckx Pierre (PIPU) f4f0f78318 [REF] *: Replace underscore.js function by native JS
Before this commit : The library underscore.js and
underscore.string.js were used in the ODOO solution.
After this commit : Every usages of a function from
underscore.js lib has been replaced with native javascript.
The goal is to remove all usages of underscore.js and to
not use anymore this library in ODOO.
---
TaskId : 3246238

closes odoo/odoo#120437

Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-05-15 09:37:48 +02:00
Brieuc-brdandElisabeth Dickinson 21d87a3da5 [REF] *: milk graphical assets
- apps icons
- base: replace demo avatars Mitchell, Marc and Joel
- mail: replace odoobot avatar

Part-of: odoo/odoo#116641
Co-authored-by: Elisabeth Dickinson <edi@odoo.com>
2023-05-12 22:59:14 +02:00
Guillaume (gdi) 18ea3b389d [FIX] website_blog: prevent the use of blog sidebar select
Before this commit, the user could use the blog publication date
selector situated in the blog sidebar even when he was in edit mode.
This date selector should behave like a link, it should not work in edit
mode. This commit prevents the user from using this selector while he is
in edit mode.

Steps to reproduce the bug:
- Go to /blog
- Edit the page
- Enable the sidebar option
- Click on the select in the sidebar
- Click on a date

=> An error is displayed.

task-3213851

closes odoo/odoo#121142

X-original-commit: 7e8e12c40b03d923b17831d95a5fe94410c2a56e
Signed-off-by: Outagant Mehdi (mou) <mou@odoo.com>
Signed-off-by: Dieleman Guillaume <gdi@odoo.com>
2023-05-11 19:20:55 +02:00
Guillaume (gdi) 89af36516f [FIX] website, *: add a robust utility to enter in edit mode
*: test_website, website_blog, website_crm, website_hr_recruitment,
website_mass_mailing, website_sale, website_sale_wishlist,
website_slides

This commit creates a new util which clicks on edit and waits for the
edit mode to be started. This way, we make sure that the edit mode is
enabled before testing the next step of the test. This avoids race
conditions during tests.

This commit replaces all the uses of the old util with the new one, it
also removes the steps that are waiting for the edit mode to start.
Finally, from [this other commit], we can start a tour in edit mode. For
these tests (which have `edition: true`), it is useless to check if the
edit mode has started at the beginning of the test because this check is
already done by default. This commit removes unnecessary / duplicated
steps.

[this other commit]: https://github.com/odoo/odoo/commit/99b50d18e220aedf14de806f4bf1b2d35c32de35#diff-c7720501ec33f5f92c907d8bb41de50edd832a4564317073e801a6915796a6bdR278

task-3203820

closes odoo/odoo#120481

X-original-commit: https://github.com/odoo/odoo/commit/9fd5d25f59578abc9c608578a7d2e2953880b582
Related: odoo/design-themes#656
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Guillaume-gdi <gdi@odoo.com>
2023-05-04 20:33:55 +02:00
Michael (mcm) b45974773a [REF] *: remove dom_ready module
This commit removes the module "web.dom_ready" and
adapts the modules that imported it.
This module was used to wait for the content to be
loaded to manipulate the dom after that.
The goal is to remove async modules and simplify the
module loader in the future.

task id: 3265979

closes odoo/odoo#119158

Related: odoo/enterprise#40051
Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-04-25 20:06:43 +02:00
Benoit Socias 02ed9f5e66 [FIX] website, *: avoid using unescaped query parameters
*: google_recaptcha, web_editor, website_blog, website_event_booth,
   website_event_exhibitor, website_event_track, website_forum,
   website_jitsi, website_sale_comparison, website_slides,
   website_livechat, website_twitter

This commit fixes improperly escaped query parameters across javascripts
of website-related modules.

See https://github.com/odoo/enterprise/pull/31711

closes odoo/odoo#118599

X-original-commit: 89be076aa51b097ada48d0046006be4d9692ac1e
Related: odoo/enterprise#39783
Signed-off-by: Bojabza Soukéina (sobo) <sobo@odoo.com>
2023-04-18 11:33:46 +02:00
Pulinckx Pierre (PIPU) 614de86989 [REF] *: Replace underscore function by native JS
Replace _.isNumber(), _.filter(), _.reject(), _.unique(), _.indexOf(), _.lastIndexOf(), _.findIndex(), _.range()
_.keys(), _.values(), _.str.sprintf() and some _.each()

closes odoo/odoo#118003

Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-04-13 16:40:11 +02:00
Michael (mcm) ff0d6dd580 [REF] *: replace odoo module by native one
This commit converts almost all odoo module by native module.
The goal is to deprecate odoo.define in favor of native module and then
simplify boot.js by removing the regexp that finds module dependencies.

task id: 3162300

closes odoo/odoo#117305

Related: odoo/enterprise#39118
Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-04-03 17:07:24 +02:00
Benjamin Vray 1b6354fc06 [FIX] web_editor, *: hide 'column' options in dynamic snippets
*: website_blog, website

Before this commit, when clicking on a column in the "Blog Posts"
snippet (only with the "Big picture layout" template), the options for
that column were displayed in the editor panel, even if options should
never be displayed for the columns of dynamic snippets.

We had already prevented the appearance of options for elements in a
dynamic snippet in this commit [1] and also in this one [2], using a
'pointer-events: none' to prevent clicking on the elements. However, as
this also removed the mouse hover effect, the 'pointer-events: none' was
changed to 'pointer-events: auto', in this other commit [3], for the
"Big picture layout" template of the "Blog Posts" snippet, so that the
user could see the hover effects in edit mode. And by doing so, we
inadvertently allowed the options to appear again.

In the end, this 'pointer-events: none' was not the right solution, as
for example, for the dynamic "Products" snippet, it may be useful in
edit mode to be able to switch between slides by clicking on arrow
buttons, or to see the mouse hover effects on images (slight zoom).

In this commit, we proceeded differently by hiding the options for
elements that are inside an 'o_not_editable' element (unless they have
the attribute and value 'contenteditable="true"'), excluding them when
generating options so that they don't have associated options.

Steps to reproduce the bug:

- In edit mode, drop a "Blog Posts" snippet in the page.
- Click on the first blog image ("Sierra Tarahumara").
- Bug => Resize options are visible when they shouldn't. The options in
the "column" part of the right panel should also not be visible.

[1]: https://github.com/odoo/odoo/commit/64b663fb42ddca67a06cb067c897abb5a3c4dd70
[2]: https://github.com/odoo/odoo/commit/1345e879d809f811641ea3ad388b5d2c0b16f005
[3]: https://github.com/odoo/odoo/commit/3c0d98bcd8adf9325ee3497eb8d25ec7f904d6a5

task-3054763

closes odoo/odoo#117407

X-original-commit: 80f841e5e33f4694361730d3e015a6a813261685
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-04-02 20:55:50 +02:00
Arthur Detroux (ard) 1ebcdb0023 [FIX] website, *: check access rights to display elements in New+ modal
*: website_blog,website_event,website_forum,website_hr_recruitment,
website_livechat,website_sale,website_slides

Prior to this commit, elements inside the New+ modal had a `isDisplayed`
property that was meant to be changed by the patches done by each
module. Unfortunately, this was forgotten in the refactor done in [1]
and more precisely when the component was introduced in [2].

This commit fixes that by checking the access rights of the user on each
individual model used on the create form.

[1]: https://github.com/odoo/odoo/commit/31cc10b91dc7762e23b4bde9b945be0c4ce3fe3b
[2]: https://github.com/odoo/odoo/commit/ca2e143d54622d598201826a2cd669bad64b205d

opw-3198700

closes odoo/odoo#117206

X-original-commit: 58704cb7615addd7d40291431e05a894776320d8
Related: odoo/enterprise#39066
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-03-30 18:58:59 +02:00
Joseph CaburnayandJulien Mougenot 3a798039d6 [REF] web_tour,*: convert web_tour to owl
* The tours are now run by the `MacroEngine` defined in `macro.js`.
  * This is accomplished by converting (at runtime) the user-defined tours to
    `Macro`s. See `tour_compilers.js` for the step (and tour-to-macro) compilation.
* API is kept the same as much as possible. Basically, declaring tours stayed
  the same with some exceptions:
  * `allowInvisible` can be provided in a step to allow consuming the trigger
    element even if it is invisible.
  * `isCheck` can now be used to replace the no operation `run` that is
    traditionally signals the runner to only perform a check.
  * Before, multiple `run`s can be called simultaneously. Now, each `run` method
    is awaited before proceeding to the next step.
* If the trigger element is `disabled`, the tour runner will *not* proceed on
  calling the `run` method and the runner will stay on current step until the
  trigger element becomes `enabled`.
  * However, the tour runner is okay with `disabled` trigger element if the step
    has `isCheck = true`. As long as the trigger element is found for `isCheck`
    step, the tour runner will happily move to the next step.
* Some tours are adjusted to properly run with this new tour runner.
* When the tour failed:
  * The dom string is not logged anymore.
  * However, a warning message containing the relative location of the step will
    be logged. This is better in helping the author in locating the failed step.

**Some guidelines learned during the development:**

* Each step may trigger a dom mutation. It's a good practice to insert an
  intermediate step that *checks* the existence of an element that result from
  the action of the previous step.
* Refrain from using the `run` method for assertions. `run`, in principle, is
  provided to perform actions that are not offered by the helper. Use the
  `trigger` for assertions.
* During dev, find `SHOW_POINTER_DURATION` and set it to `250`. This will show
  the pointer (pointing to the trigger element) for 250ms when watching the
  tour.

closes odoo/odoo#107618

Task-id: 3082036
Related: odoo/enterprise#37560
Signed-off-by: Géry Debongnie <ged@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
2023-03-15 13:19:45 +01:00
Guillaume (gdi) b4ce395099 [FIX] website, website_blog, website_sale: stay on the backend view
Since [the merge of the frontend into the backend] and more precisely
since [this commit], clicks on some elements makes the user switch from
the backend view to the frontend view.

Steps to reproduce (just an example):
- Go to /blog from the backend (/@/blog)
- Click on a tag (eg: adventure)

=> users are redirected to the frontend view, we do not want that. This
commit makes the user stay in the backend. For some scenarios (like the
one above), we create a fake form and submit it. The forms have a target
attribute that specifies where the form response should be displayed.
This commit set back the default value for the target attribute when a
user clicks on a blog tag, a course tag, the pager, ... so that the
response is displayed in the current context (the iframe when the user
is in the backend).

Note that [this commit] introduced the target attribute change to fix
two issues:
1. The opening of the payment gateways in the iframe.
2. The create page from a 404 page in the backend.

After [this other commit] has been merged, to prevent the first issue so
here we just remove the target attribute change except for the case of
the second issue.

[the merge of the frontend into the backend]: https://github.com/odoo/odoo/commit/31cc10b91dc7762e23b4bde9b945be0c4ce3fe3b
[this commit]: https://github.com/odoo/odoo/commit/2d44f2792dec0b2f205475a22dbedc97e9c54a64
[this other commit]: https://github.com/odoo/odoo/commit/3a32b9e1efa6277b345dc9239334680651690df7

task-3054970

closes odoo/odoo#114056

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-03-13 16:36:50 +01:00
Benoit Socias 80b85bf818 [FIX] website, *: unescape URL parameters when used in autocomplete
*: web_tour, website_blog

Since [1] when the search box autocomplete was introduced, the URL
parameters are implicitly included into the RPC that fetches the
autocompletion results.
Those parameters were not correctly unescaped before being sent to the
RPC call.
Because of this, a timestamp such as "2023-01-01 23:00:00" was sent as
"2023-01-01+23%3A00%3A00" to the server. If that string reached the SQL
layer, the "+" was interpreted as defining a timezone.

This commit unescapes the URL parameters before using them in the RPC.
Note that javascript's `decodeURIComponent` does not handle the '+'
encoding of spaces inside URL parameters.

For testing purpose, the following updates were needed to make it
possible to select the `<option>` within the Archive month `<select>`:
- because the `option`s are in a tree, the tool was adapted to take all
`option`s into consideration instead of only the direct children of the
`select`.
- because the `option` text is dynamically created from the date of the
test execution, the tool was adapted to allow targeting an `option`
based on its index by specifying the tour step's `run` as
`'text index N'`, `N` being the index of the `option`.

Steps to reproduce:
- Enable the sidebar of the `/blog` page.
- Select a month in the sidebar.
- Type something in the search box.

=> Did show an error popup while obtaining the autocompletion records.

[1]: https://github.com/odoo/odoo/commit/7559626c54e34b41e1549e28276a650accec6986

task-3213916

closes odoo/odoo#114913

X-original-commit: 115fc399461c37b57127684cf5c28f05443fbb54
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
2023-03-13 09:45:56 +01:00
Fabien Pinckaers adb66027b1 [IMP] website blog: cleaning up ugly CSS classes, to keep standard
closes odoo/odoo#113594

Signed-off-by: Fabien Pinckaers <fp@odoo.com>
2023-02-24 10:06:30 +01:00
Benoit Socias f588703c28 [FIX] website_blog: make removed custom tags reusable
Since [1] when the blog tags field option was refactored to use the m2m
widget, the list of existing tags is not cleaned up anymore.
This causes custom tags to remain in that list when they are removed.

This commit adapts the existing condition to exclude custom tags that
have been removed.

Steps to reproduce:
- edit blog
- create custom tag 'test'
- remove custom tag 'test'
- create custom tag 'test'
=> was detecting the tag as already existing

[1]: https://github.com/odoo/odoo/commit/4a603cd59c8a3f33d9515f28d99a0f68c381c5d2

task-2811746

X-original-commit: 7f58519b922264efb6b6180608fd5a461d30b9e8
Part-of: odoo/odoo#109479
2023-01-09 21:15:45 +01:00
Benoit Socias 7df1cf332e [FIX] website_blog: refresh options UI after adding a new tag
Since [1] adding a new tag on a blog does not refresh the tag list in
the options tab. That commit sorts the `methodsNames` alphabetically.
Previously, the unspecified order of the methods just happened to make
the add operation work.

After this commit the tag list is reset that happens during `setTags`
is prevented when a new tag is created.
If at a later stage a mechanism is created to allow specifying the
order of the `methodsNames`, it should be used instead of this dirty
ad-hoc way.

[1]: https://github.com/odoo/odoo/commit/a48a30f954afcb6ff3a59c4f32b05fd0c2cfcd2b

task-2811746

X-original-commit: e35e1128f5a569f386429b5e532d4b96e9348191
Part-of: odoo/odoo#109479
2023-01-09 21:15:44 +01:00
Benoit Socias 4ffdf8a45b [FIX] website_blog: apply cover properties behavior only on post page
Before this commit the whole options javascript of blogs was skipped if
the accessed page was not the blog post page. This actually did not work
anymore since the website preview was moved into an iframe.

After this commit, the global condition is removed, and a new condition
is added in the cover properties override so that it only applies to
blog covers displayed inside the single blog post page.

task-2811746

X-original-commit: a6b7a2731ca05314a0bd28a54d84efd61b3e1ad8
Part-of: odoo/odoo#108763
2022-12-28 17:29:10 +01:00
luvi 782a1dd3b9 [REF] website, *: adapt code to save on NewContentModal close
*: website_blog, website_event, website_forum, website_livechat,
website_sale, website_slides

This commit adapts the code of website, and modules depending on it, which
overrided the save method of the FormView controller to execute a doAction.

It was no longer possible to wait for the default save action to proceed,
because the default behavior is now to close the dialog, and here we need
to pass another parameter allowing to redirect the website to a newly
created record.

Now, a method is available directly from the NewContentModal, which reduces
the need for the service in form views. The save call pass the right method
to compute the path needed for the redirection once the record has been
created.

closes odoo/odoo#102522

X-original-commit: 916a5bebb3e74047a66503ddc59299540c252831
Related: odoo/enterprise#32448
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-10-06 23:14:25 +02:00
Arthur Detroux (ard) d3307aaa08 [IMP] website, *: give flexibility to dynamic snippet templates
*: website_blog, website_event

Commit [1] introduced new templates. This commit's goal is to build on
that template system to provide more flexibility for designers.
It adds new data-attributes to set on the first node of a template.

- data-row-per-slide: Allows for the template to tell a dynamic snippet
carousel how many rows of cards it should display.

- data-arrow-position: Allows for the template to tell a dynamic snippet
carousel where the arrows should be positioned.
(for now just bottom, or side)

- data-extra-classes: give the template the possibility to add extra
classes to the dynamic snippet instead of just the card.

This commit also removes options to select the amount of elements
displayed on each row. This is now only changeable through templates, or
by directly editing the snippet's DOM through debug tools. This was done
to reduce the amount of options visible, so that the user just chooses
a template and it is ready to go.

[1]: https://github.com/odoo/odoo/commit/49bd79b0bdca76415780bdfa199195371c2692e5

task-2677203

Part-of: odoo/odoo#80128
2022-10-04 14:56:50 +02:00
Benjamin Vray 3036c7dc47 [IMP] website, *: review mobile view layout
*: web_editor, website_blog

This commit improves the mobile preview of websites. A mobile phone
image has been added around the iframe during the mobile preview. This
image was already used for the themes mobile preview, this is why the
css code has been unified to be used in these 2 mobile previews.
Parallel to this commit, we have modified the websites displayed in the
iframe of the preview of the themes so that the scrollbar of these is
visible (before it was hidden behind the image of the phone) but with a
smaller width in mobile mode.

This commit also improves the button to switch to mobile preview by
coloring it green when mobile preview is active.

task-2890050

closes odoo/odoo#98061

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-09-12 21:07:16 +02:00
qsm-odoo accb4b3245 [IMP] website, *: review website tour utils
*: test_website, website_blog, website_crm, website_event,
   website_forum, website_hr_recruitment, website_mass_mailing,
   website_sale, website_sale_wishlist, website_slides

- Make sure that all website tours reaching the website preview before
  their first step use the related website util to register their tour.

- Rename the website util to register a tour starting on the website
  preview from `registerEditionTour` to `registerWebsitePreviewTour`.
  Having a method using "Edition" in its name and having a boolean
  parameter named `edition` was a bit... strange.

- For both non edit mode and edit mode as a first step, ensure the util
  sets a high timeout for the first step. Indeed loading both the
  backend and the frontend (in the iframe) and potentially starting the
  edit mode can take a long time in automatic tests. We'll try and
  decrease the need for this high timeout of course.

- Review the implementation of those utils to be more consistent and
  also fix one or two mistakes in them.

closes odoo/odoo#100024

Related: odoo/design-themes#588
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-09-12 17:33:39 +02:00
Nicolas Bayet 10af6e83bf [IMP] web_editor,mass_mailing: adapt fields to use owl
- adapt the html field and mass_mailing_widget to be owl components
- adapt the mass mailing view to be an owl view

task-2898432

closes odoo/odoo#94875

Related: odoo/enterprise#30915
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-09-12 11:38:00 +02:00
Guillaume (gdi)andqsm-odoo c2f394253e [IMP] website, *: improve the "edit in backend" button
*: base, mrp_account, product, mail, website_blog, website_event,
   website_forum

This commit improves the button that allows to go to the backend view of
an object when you are on its corresponding page on the website. The
button is more visible and the user can see which object he is going to
edit. Note that this commit also:

- Changes the access key to translate a website page to ALT + T.

- Adds a new access key to edit an object in backend with ALT + E.

- Removes the possibility to duplicate a blog post (but this feature
will be reintroduced later for all models, generically) **.

**: Note that the duplication of blog posts actually had a mistake:

The controller to create a new blog post has been added with [1] where
it has been decided to not be a follower of the blog posts at their
creation. A new controller has been added by [2] to be able to duplicate
a blog post, to be consistent with [1], here also the user does not
become a follower of the new blog post (the copy). So far, so good.
Finally, [3] has changed the blog post creation controller so that the
user who creates the blog post is a follower of the new blog post.
Unfortunately the same change was not made for the duplicate controller,
which is a mistake. There is no reason to be a follower of the newly
created blog posts when you go through the add blog post controller but
not when you go through the duplication controller. The behaviors should
be consistent and there is no reason for there to be a difference.

[1]: https://github.com/odoo/odoo/commit/4c3b516a7b988d758a67ff19242e8ed0837d756c
[2]: https://github.com/odoo/odoo/commit/fe40538aff2b65f7719840c8e2d6e51e858f560f
[3]: https://github.com/odoo/odoo/commit/4bf9dc4078a5ca413539a6fd16400fd5aad46907

task-2889929

closes odoo/odoo#97353

Related: odoo/enterprise#30075
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
2022-09-04 18:29:37 +02:00
xO-Tx d7a5a06c68 [REF] website, *: use OWL views for new content
*: website_blog, website_event, website_forum, website_livechat,
website_sale, website_sale_slides, website_slides, website_slides_forum

The goal of this commit is to adapt the website "new content" form
views to OWL.

Follows the merge of the "website in backend" task at [1].

[1]: 31cc10b91d

task-2687506

Part-of: odoo/odoo#96346
2022-09-04 14:39:44 +02:00
Romeo Fragomeli 1fcd098af5 [REF] *: BS5: migration
Automated change made by a lot of RegEx to change all think that is
possible to automate.

https://getbootstrap.com/docs/5.1/migration

Task ID: 2766483

Part-of: odoo/odoo#95450
2022-07-07 13:30:24 +02:00
Romeo Fragomeli 9b5c9484fe [REF] *: BS5: adapt changes in media query mixin
> Media query mixins parameters have changed for a more logical approach

> media-breakpoint-down() uses the breakpoint itself instead of the next
> breakpoint (e.g., media-breakpoint-down(lg) instead of
> media-breakpoint-down(md) targets viewports smaller than lg).
> Similarly, the second parameter in media-breakpoint-between() also
> uses the breakpoint itself instead of the next breakpoint (e.g.,
> media-between(sm, lg) instead of media-breakpoint-between(sm, md)
> targets viewports between sm and lg).

https://getbootstrap.com/docs/5.1/migration/#sass

Task ID: 2766483

Part-of: odoo/odoo#95450
2022-07-07 13:30:24 +02:00
99b50d18e2 [REF] test_website, *: adapt tours to new client action
*: website, website_blog, website_crm, website_event, website_forum,
   website_hr_recruitment, website_mass_mailing, website_sale,
   website_sale_loyalty, website_slides

This commit adds the current website displayed view xmlid outside of the
iframe, on its container, so that the tours registered with
registerThemeHomepageTour can continue to prepend their triggers with
the view xml id.

Introduce registerEditionTour: this function will allow tour maker to
more easily register a tour that needs to start in the iframe's backend
and go in edit mode.

See merge commit for more information.

task-2687506

Co-authored-by: Benjamin Vray <bvr@odoo.com>
Co-authored-by: Younn Olivier <yol@odoo.com>
2022-06-24 10:28:07 +02:00
Younn Olivier b85c2a4cb1 [IMP] website, *: redirect to the client action when needed
*: website_blog, website_hr_recruitment, website_sale, website_slides

This commit changes the redirections from the controllers, that were
always redirecting to the frontend before.

Now, we want to open the website in its backend client action most of
the time (for example, when clicking on the "go to website" buttons on
the form views).

For that, a new get_client_action_url is introduced on the website
model.

See merge commit for more information.

task-2687506
2022-06-24 10:28:07 +02:00
Arthur Detroux (ard) 03c552690b [IMP] website, *: adapt code so that it may work with an external editor
*: mass_mailing, web, web_editor, website_blog, website_event,
   website_event_meet, website_livechat, website_sale, website_twitter,
   base

This commit does 3 things:

- Adapt existing code so that the editor can be run outside of its
  editing element. Prior to this commit, it was expected that the
  editor would be attached to the element it was currently editing.
  This needs to change however as the editable is now inside an
  iframe for the website edition. mass_mailing already had a similar
  approach but the editor was started within the iframe.
  With these changes, the editor is alongside the iframe, editing
  the content that's inside it. This allows multiple features
  such as reloading the iframe while keeping the editor visible and
  resizing the iframe for a mobile preview.

- Adds logic to the wysiwyg_adapter so that it can undertake
  the duty of the previous widget sytem. The wysiwyg existed not only
  in the legacy widget system, but most importantly in the frontend.
  One of the duties of this adapter is to send events inside the
  iframe when it is necessary to reach the frontend public widget
  (i.e. widgets_start_request)

- Removes existing SCSS that is no longer used.

See merge commit for more information.

task-2687506
2022-06-24 10:28:06 +02:00
xO-Tx 8925df7e75 [IMP] website, *: add new content dialogs
*: website_blog, website_event, website_forum, website_livechat,
   website_sale, website_sale_slides, website_slides,
   website_slides_forum

The goal of this commit is to add dialogs to create new website content
using a 'target:new' action on the form view and an overridable
"website" form controller.

See merge commit for more information.

task-2687506
2022-06-24 10:28:05 +02:00
Younn Olivier f260e3c144 [IMP] website, *: add edit in backend systray dropdown
*: website_blog, website_customer, website_event_exhibitor,
   website_event_track, website_hr_recruitment, website_sale,
   website_slides

See merge commit for more information.

task-2687506
2022-06-24 10:28:05 +02:00
Younn Olivier ca2e143d54 [IMP] website, *: add new content systray item
*: website_blog, website_event, website_forum, website_hr_recruitment,
   website_livechat, website_sale, website_slides

The NewContentModal component is added. It displays tiles, which will
install a module if not already installed, or perform an action defined
by the module otherwise. So that modules can patch that component to
define an action when installed (for example, website_sale will handle
the logic of creating a new product), the elements to displayed and
their state (NOT_INSTALLED, INSTALLING, INSTALLED) are listed in the
state of the component.

A key 'isDisplayed' is added on the new content elements that should not
be displayed to the user, depended on his security groups.
By default, the new content elements are displayed to the system user.

See merge commit for more information.

task-2687506
2022-06-24 10:28:05 +02:00
qsm-odoo 29f21a23f1 [MOV] website, *: move static files to prepare website UI in backend
*: web_editor, web_unsplash, website_event, website_blog,
   website_event_meet, website_forum, website_links, website_livechat,
   website_sale_slides, website_slides

With [1], many files will move as the website UI is moved in the
backend. This commit moves all the static files (JS/CSS/XML) to their
final destination without modifying them, in an attempt to preserve
some history and ease some forward-ports.
After this commit, everything works as before as the files are simply
renamed and the references to them adapted.

However, technically, many files will actually be split into multiple
files by the work made with [1]. While it is theoretically possible to
preserve history over multiples files, this would require inner merge
commits, which does not go well with robodoo. In those cases, the "main"
file of the split was chosen. Mainly, 4 worth-noticing splits were
detected (and so the history moved only to the first file):

move: addons/web_editor/static/src/js/wysiwyg/widgets/media.js
to: addons/web_editor/static/src/components/media_dialog/file_selector.js
  - addons/web_editor/static/src/components/media_dialog/search_media.js
  - addons/web_editor/static/src/components/media_dialog/image_selector.js
  - addons/web_editor/static/src/components/media_dialog/document_selector.js
  - addons/web_editor/static/src/components/media_dialog/icon_selector.js
  - addons/web_editor/static/src/components/media_dialog/video_selector.js

move: addons/web_editor/static/src/js/wysiwyg/widgets/upload_progress_toast.js
to: addons/web_editor/static/src/components/upload_progress_toast/upload_progress_toast.js
  - addons/web_editor/static/src/components/upload_progress_toast/upload_service.js

move: addons/website/static/src/js/menu/content.js
to: addons/website/static/src/components/dialog/edit_menu.js
  - addons/website/static/src/components/dialog/page_properties.js
  - addons/website/static/src/components/wysiwyg_adapter/page_options.js
  - addons/website/static/src/js/website_page_list.js

move: addons/website/static/src/js/menu/edit.js
to: addons/website/static/src/components/wysiwyg_adapter/wysiwyg_adapter.js
  - addons/website/static/src/systray_items/edit_website.js
  - addons/website/static/src/components/editor/editor.js

Notice that as those moves were made post-work and the rest of the work
(80+ commits) rebased on top of it, some commits may remove more than
they should in a moved file to then reimplement some of what was
removed in a later commit... ideally this should have been avoided of
course but keep in mind that the final files are just entirely rewritten
and split as converted to OWL. It seemed however worth it to keep most
of the inner history of the work made here to see step by step what was
done. [1] will obviously be merged with a merge commit, binding the
whole work together.

[1]: https://github.com/odoo/odoo/pull/89223

task-2687506
2022-06-24 10:28:04 +02:00
Benoit Socias 0c5c2a37a5 [FIX] website_blog: remove negative word spacing in blog snippet
Since [1] when the blog layout was refactored between 12.0 and 13.0, a
negative word spacing was introduced in the blog post snippet with the
big pictures layout.

This commit removes this negative word spacing.

[1]: https://github.com/odoo/odoo/commit/bb0cdec4594fab8c22265ed8af0c2d431a263b72

task-2822436

closes odoo/odoo#88729

X-original-commit: c0e86be9074a0d72e6119801c7992232e9e32068
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
2022-04-14 09:38:51 +02:00
Fabien Pinckaers 10a5796d4b [IMP] speed up load_menus() by using SVG icons instead of png
Reduces load_menus answer size by 32% (between 20kb and 200kb savings
for the initial loading of the backend, depending on the number of apps
installed). Support for SVG icons in the web client for menus/apps.

Reduced PNG icons for apps list (8 bits PNG instead of 24 as our icons
don't need more colors as they are flat designs)

closes odoo/odoo#84280

Related: odoo/enterprise#24200
Signed-off-by: Fabien Pinckaers <fp@odoo.com>
2022-02-12 08:55:18 +00:00
qsm-odoo 34663eb920 [FIX] web_tour, website_blog: restore proper user blog tour
With [1] in 13.0, the blog post layouts were reviewed. At the same time,
new demo data was introduced. By default, with demo data, you have now
two different blogs. The JS tour was adapted so that when you create a
new blog post, a step explains you have to select the blog you want to
create the post in with the dialog that opens. The main problem that
this PR aims to solve is that all users start without demo data and thus
with only one blog... so with the current tour, the users are blocked
very early in the tour as they do not have the dialog to select the blog
in which to create their blog post. The simple solution that was chosen
is to set the step as "auto", meaning it will only be used in runned
tours (like via python tests), allowing to still test the blog selection
dialog in our python test. Users will not be guided via a tip for this
specific modal but this is not a problem as this is very straightforward
to understand in the case the user explicitely created multiple blogs
before creating blog posts.

This commit also review commit merged at [2] which made that python test
more robust by not relying on the demo data. That was here improved with
explanations.

However, allowing the tour to go further than the blog post creation for
the user... revealed that the rest of the tour was still blocking the
user. The very next step is to modify the blog post title. That step was
simply not possible to consume. Indeed the tour system asks for a click
event on the title... which is never detected because our old editor
removes all click handlers on that specific top-level editable area. The
cleanest way of fixing that is actually to not wait for a click but wait
that the user actually types text. For this purpose a feature was
introduced in 14.0 with [3] (even if unfortunately, that commit was not
well split). Unfortunately again... that 14.0 feature is currently buggy
during test tours as choosing the "input" consumeEvent alongside the
"text" run method... changes the behavior of that "text" run method when
the affected element is a contenteditable element. That should be fixed
but this will be done in a further update. Meanwhile, this commit
chooses to use the consumeEvent 'mouseup' which circles around both
issues.

[1]: https://github.com/odoo/odoo/commit/bb0cdec4594fab8c22265ed8af0c2d431a263b72
[2]: https://github.com/odoo/odoo/commit/f16f2e212a30352ead86c2f876be02b5c5e23b07
[3]: https://github.com/odoo/odoo/commit/a34cd7c662b3753d630d83793ffcb53b4a0a92d2

Bug revealed by testing task-2728994

closes odoo/odoo#83721

X-original-commit: ca82efe0c7b9a5e98d5c9623b3ae0f1b88fc8091
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-01-31 23:51:00 +00:00
Benoit Socias e6672307b2 [FIX] website_blog: put cover selection tip within display
Before this commit the tip of the cover selection step was drawn outside
the display.

After this commit the tip of the cover selection step is within the
display.

task-2728994 (was task-2675252)

X-original-commit: 04df7addb41600e458495caa512342e9840e1259
Part-of: odoo/odoo#83692
2022-01-31 15:33:52 +00:00
Benoit Socias 12e55c039e [FIX] web_tour, website{_*}: not consume non-displayed tour steps
website{_*}: website, website_blog, website_sale, website_slides

Before this commit if several steps were referencing the same trigger
(e.g. "+New" button in website) only one was displayed, but all were
consumed when it was clicked.
Because of this the tour steps on "+New" were active even when its menu
was opened.

After this commit only the displayed step gets consumed if the step is
marked as 'consumeVisibleOnly: true'.
It cannot be done implictly on all steps because of [1].
This new marker is set on all steps referencing "+New".
The tour steps on "+New" now also require their menu to not be opened.

[1]: https://github.com/odoo/odoo/commit/5e888f8a6ccf9996b3231db6bf314d045619109e

task-2728994 (was task-2675252)

X-original-commit: 0fa40e37e596798665a098ee999f49749b6012a2
Part-of: odoo/odoo#83692
2022-01-31 15:33:52 +00:00
Benoit Socias a18109455e [FIX] website_blog: proceed to next tour step upon any image selection
Before this commit the tour only proceeded if the first image was
selected.

After this commit the tour proceeds if any image is selected in the
media dialog.

task-2728994 (was task-2675252)

X-original-commit: 92d7ad6d1c0b773a4a400b84bfc8d93c6980850b
Part-of: odoo/odoo#83692
2022-01-31 15:33:52 +00:00
xO-Tx 7a74418b42 [IMP] website_blog: change blog cover title to h1
SEO issue: blog post doesn't have <h1> for post title.

The goal of this commit is to change the main cover title to <h1>.

task-2454130

closes odoo/odoo#66844

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-11-26 15:10:02 +00:00
Xavier Morel 0e552b96da [FIX] *: convert tip contents to t-out
Requires markup every markup-using tip content as Markup. Would be a
nice occasion to migrate everything to a markup-safe markdown I think,
especially if we could migrate the translations so we don't lose them.
2021-07-20 05:40:55 +00:00
+1 14bffd983e [REF] *: adapt code to new owl webclient
This commit adapts the community codebase to the rewriting of the
/web application in owl.

Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Bruno Boi <boi@odoo.com>
Co-authored-by: Géry Debongnie <ged@odoo.com>
Co-authored-by: Samuel Degueldre <sad@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Simon Genin (ges) <ges@odoo.com>
Co-authored-by: Francois (fge) <fge@odoo.com>
Co-authored-by: Michael Mattiello (mcm) <mcm@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Lucas Perais (lpe) <lpe@odoo.com>
Co-authored-by: Jorge Pinna Puissant <jpp@odoo.com>
2021-06-18 21:31:27 +02:00
Younn Olivier f9133d1300 [FIX] website_blog: fix covers background color
The background color displayed on the blog posts list page was static,
instead of being the background_color_class saved from the
CoverProperties. Also, on the blog post page itself, the two were
combined which made no sense.

Part of https://github.com/odoo/odoo/pull/71593
task-2497846

closes odoo/odoo#72186

X-original-commit: b3ebc427fd519c29788eadedfca2f956e3695a3e
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-06-15 16:36:31 +00:00
Younn Olivier a18b14d72f [FIX] website_blog: fix cover display on posts list page
This commit fixes a bug happening when changing the background with the
CoverProperties SnippetOption from the blog posts list page.
As it selects the default sizing class and applies it, the min-height
css property was applied and breaking the layout.

The covers min-height is now set as !important to not be overriden in
that context.

Part of https://github.com/odoo/odoo/pull/71593
task-2497846

X-original-commit: aa9591bf546729162f44d1f34cbee094131aba73
2021-06-15 16:36:30 +00:00
Younn Olivier e13924253e [FIX] website_blog: fix blog cover height on post page
As [1] added `!important` flag on .o_full_screen_height and
.o_half_screen_height global classes, the current override in
website_blog was not effective anymore.

Also, the value of the height override is also changed to offer more
differences. Also, simply restoring the old rule would "restore" 13.0
databases but "break" 14.0 databases which relied on it. So a compromise
between both was chosen.

[1]: https://github.com/odoo/odoo/commit/7cc6fdf36569be85e995c962321f2926822ac604

Part of https://github.com/odoo/odoo/pull/71593
task-2497846

X-original-commit: 3929eece7face5f6ed497a119787cd841b917c08
2021-06-15 16:36:30 +00:00
Leonardo Pavan Rocha c53724ebc3 [IMP] *: adds generic user avatar
Description of the issue/feature this PR addresses:
It is currently quite difficult to differentiate users. Most of the time, people
don't take the time to upload an actual avatar so everybody looks the same. This
PR generates a custom avatar with the users initials and random color to
differentiate them. For res.users, res.partner and hr.employee, image fields now
hold the binary image and avatar are used to show the image or svg.

Current behavior before PR:
Avatar had only random colors and was being saved in database, being inefficient

Desired behavior after PR is merged:
A new mixin defines image fields and in case no image is set, it generates an
SVG image with the user's initials and random color.

closes odoo/odoo#69819

Task: 2404630
Related: odoo/enterprise#18199
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-06-01 14:36:23 +00:00
740168ce8d [REF] web_editor, website_*, mass_mailing: adapt to Odoo Editor
Co-authored-by: David Monjoie <dmo@odoo.com>
Co-authored-by: Antoine Guenet <age@odoo.com>
Co-authored-by: Nicolas Bayet <nby@odoo.com>
Co-authored-by: Sébastien Geelen <sge@odoo.com>
Co-authored-by: Emilien Durieu <edu@odoo.com>
2021-04-01 16:01:06 +00:00