Commit Graph
1964 Commits
Author SHA1 Message Date
Brieuc-brd 418413e499 [IMP] web, *: directional icons
This commit adapts the directional icons to improve the usability and
maintain consistency with the ui icons library.

task-2818586

Part-of: odoo/odoo#116641
2023-05-12 22:59:22 +02:00
Elisabeth Dickinson b2ef35a431 [IMP] *: replace .bg-color by .text-bg-color on ribbons
Also remove unnecessary CSS on ribbons.

Part-of: odoo/odoo#116641
2023-05-12 22:59:16 +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
stefanorigano (SRI) 051ac37232 [IMP] web, * :introduce o_avatar
*: account, gamification, mail, mrp, note, project, website_blog,
   website_event_track.

Uniform design defining a common element shared across different
modules.

task-2818586

Part-of: odoo/odoo#116641
2023-05-12 22:59:12 +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) f10e85b475 [IMP] social_media, *: add TikTok to the social networks stored in DB
*: website, website_blog, website_event

This commit adds the TikTok social network to the other social networks
stored in DB. Thus, users of the Website application will be able to
reference their TikTok page on their websites. This commit also updates
the different templates and the social media block to integrate this new
social network.

task-3235451

Part-of: odoo/odoo#116837
2023-05-11 09:36:21 +02:00
niyasraphy 4a71b51f59 [FIX] website_blog: post_date inverse function in blog post
before this commit, on clearing the value from
post_date field in the blog.post model is
not recalculating the post_date value
from the inverse function.

* open a blog post
* clear the post date value
* click go to website smart button
* traceback will be shown due to missing date

_write is not needed because it was done for
method _compute_ranking, which doesn't exist
in v16 https://github.com/odoo/odoo/commit/74e1d6940da7b5f0cc8fe4b2ba60d0bb81990ba5

post_date is computed method with inverse
 function which is handled in write, not in _write

after this commit, on clearing post_date value
the inverse function will set the post_date
value from create date as it was in the
previous versions.

closes odoo/odoo#120858

X-original-commit: f2f45cddede53d201e4efbe27a86e208ebf51ab1
Signed-off-by: Ivan Elizaryev (iel) <iel@odoo.com>
2023-05-09 11:57:31 +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
Benjamin Vray 69a11fdab4 [FIX] website_blog: fix read next article block
Before this commit, on a blog page with the "regular cover" and "read
next article" options enabled, the image in the "read next article"
block would shrink when the text was too long.

Steps to reproduce the bug:

- Go to a blog page (e.g. "Sierra Tarahumara").
- Enable the "regular cover" and "read next article" options.
- Enter edit mode.
- Scroll down the page.
- Enter a lot of text as the title of the "read next article" block.
- Bug: As the text increases, the width of the image decreases.

opw-3267842

closes odoo/odoo#120025

X-original-commit: 06a6e78b0f41188dd4c7c45c26f6038ecbd5b311
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-05-03 12:39:38 +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
Rémy Voet (ryv) 234db70d86 [IMP] *: Use the new API of _read_group for backend use
Part-of: odoo/odoo#110737
2023-04-19 21:58:27 +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
Denis Ledoux 1480f2fad5 [FIX] *: session.modified has been renamed is_dirty
Since odoo/odoo@04e972660b
The session `modified` flag has been renamed `is_dirty`.

However, it has not been renamed correctly in these
three different places.

The goal to set `modified` at this three places
is to force the session to be saved,
for instance because a mutable (a list or a dict)
contained in the session was modified,
but not the dict of the session itself,
therefore `modified` is not flagged automatically.

As the flag `modified` has not been renamed to `is_dirty`,
a key/value `modified: True` was actually assigned to the
session dict, and saved in file. The behavior
to save the session in these three places was kept,
as one key/value of the session has been changed,
but by the way to assign a new value in the session file,
which is not ideal.

It's better to assign the correct flag to avoid
setting a new key/value in the session for no reason.

closes odoo/odoo#118719

X-original-commit: b6f4a27f2d95d5bc5510f4da50132ab66d8c86aa
Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
2023-04-17 11:47:15 +02:00
Benoit Socias 95bb8dc0f8 [FIX] web_editor, website, *: make snippets name translatable
*: mass_mailing, website_blog, website_event, website_mail_group,
   website_mass_mailing, website_payment, website_sale, website_twitter

The names of snippet blocks are not translatable because their name is
obtained from a their template name which is not a translatable item.
For markets that use a non-latin alphabet this is a no go.

This commit makes it possible to specify a `string` attribute in the
`t-snippet` blocks that makes their name inventoried by the translation
process.

closes odoo/odoo#118530

X-original-commit: a501d226d8674ed0c9b183c69a9e754c79682237
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
2023-04-17 08:24:47 +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
Louis (loco) abda2bb60a [FIX] website_blog: adjust the width of the border when inside column
Steps to reproduce the bug:
- Go on the blog of the website.
- Edit.
- In the "Customize" section, apply the "List" "Layout" and activate
the "Sidebar".

-> The sidebar appears at the bottom of the page instead of on the
side.

The situation looks like this:
```html
<div class="container">
    <div class="row">
        <div class="col"></div>
        <div class="border-end"></div>
        <div class="col-12"></div>
    </div>
</div>
```
The bug comes from the fact that the `div` with the `border-end` class
is inside a `row` class. Due to that, a bootstrap 5 css rule applies
and puts the `width` of the `div.border-end` element to `100%`. Because
the element tries to fill the entire width of the `div.row`, it is put
at the bottom of the page as well as its following elements (in this
case, the sidebar). This bug is fixed by removing the `div.border-end`
element.

opw-3217775

closes odoo/odoo#117849

X-original-commit: 9d8b895b934e5b0986c932837fd043cf847a8992
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-04-07 19:43:16 +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
Martin Trigaux 1be5eae8ef [I18N] *: remove nl_BE files
They dates from < 2027 and are quite outdated. Favour the nl
translation instead.
n_BE is not on Transifex so it was not possible to correct bad
translations.

closes odoo/odoo#115845

X-original-commit: d04c8b7e484db8306d858c891a7a2b11885fdcd9
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-03-20 16:51:30 +01: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
Louis Wicket (wil) 9afe7c74c9 [IMP] *: remove "French spacing" 👺
According to Wiktionary, French spacing is "the archaic practice (though
still current in French) of inserting a space around colons, semicolons,
question marks, and exclamation marks". This is not standard practice in
English and most languages of the world.

The purpose of this commit is to start purging the code from this typo,
as it may reflect poorly on the software for some people.

closes odoo/odoo#114533

Related: odoo/enterprise#37853
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-03-14 15:52:10 +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
Thibault Delavallée c088d5423e [IMP] mail: cleanup _notify_get_recipients code bits
This commit contains mainly code cleaning, docstrings and a small split
for notification tool methods. In this commit we

  * make some notification groups variable explicit;
  * move the filler of groups into its own submethod to ease being called
    from other code (to be used soon);
  * fix some strange overrides or code manipulation;
  * propagate some additional parameters to ease future commits that will
    improve rendering of groups-based notification emails;
  * cleanup, fixup and improve docstrings;

This does not change anything from functional point of view, just preparing
further work.

Task-3046371 (Mail: Better Language Support in Composer)

Part-of: odoo/odoo#106177
2023-03-09 15:54:12 +01:00
Guillaume (gdi) 13e4acd38f [FIX] website_blog: fix the view of the blogs filtered by tag
From [this commit], following these steps:
- Go to /blog
- Click on a tag of a blog post that has at least two tags (eg: hotels)
- Click on another tag (eg: adventure)

=> Instead of having hotels or adventure as a filter we just have
adventure. The problem is that some variables were cached since [this
commit].

[this commit]: https://github.com/odoo/odoo/commit/b0a2a41d78292cb8b9e53788d40c6dc5915a466d

task-3054970

closes odoo/odoo#114250

X-original-commit: 2e7cd8ae13195f9a7527ac6789d9d3aecc920a82
Signed-off-by: Arthur Detroux (ard) <ard@odoo.com>
Signed-off-by: Guillaume-gdi <gdi@odoo.com>
2023-03-06 13:13:14 +01:00
Guillaume (gdi) a67528b743 [FIX] website_blog: prevent losing search params
Before this commit, search criteria could be lost when a visitor added a
new search criteria on blogs. This commit solves this problem.

Steps to reproduce the issues (with activate the sidebar):
- Go to the /blog
- Click on the adventure tag
- Select a month in the date filter

=> The adventure tag is lost.

- Go to the /blog
- Select a month in the date filter
- Click on the adventure tag
- Remove the date filter

=> The adventure tag is lost.

- Go to the /blog
- Select a month in the date filter
- Search for the blogs containing the word "heli"

=> The date filter is lost.

task-3058239

X-original-commit: 53ac1736b323257b2545946a8f96d06294c7b8c8
Part-of: odoo/odoo#114253
2023-03-03 15:56:49 +01:00
Guillaume (gdi) a48346d30a [FIX] website_blog: fix the blogs search
Before this commit, following these steps:
- Go to /blog
- Enable the customize option 'Top banner - Name / Latest Post'
- Disable the customize option 'Full-Width Cover'
- Search for the word 'helicopter' in the blog post search bar

Two problems are then visible:
1) The top banner is always visible with a blog post that does not match
the search. This top banner should not be visible (like for tag and date
searches).
2) There is an alert message 'No results for "helicopter".' while the
blog post 'Maui helicopter tours' matches the search.

This commit corrects both errors.

task-3058239

X-original-commit: c28cf4b44c4fd9a1800d5fb1ad6e8c734feb9057
Part-of: odoo/odoo#114253
2023-03-03 15:56:48 +01:00
Romain Derie e7b0ee3012 [FIX] website_blog: prevent params to be lost when only one blog
With DB having only one blog (most common case, but we are used to test
it with demo data where we have two), the query params are lost when
accessing the blog controller without passing a blog.

Eg, `/blog?search=hubble` will redirect to `/blog/travel-1`

This is because the business code is doing an early redirect if we
access the `/blog` URL without a blog post passed to it to redirect to
that blog post URL directly (since there is only one), but that redirect
is not passing the query parameters.

The main impacted params are `state`, `order` and `search` but it's the
same for all others.

Step to reproduce (in later version):
- Be sure to only have one blog
- Drag & drop the search snippet in the homepage or anywhere
- Make it search on blog only (through the snippet option)

Type anything, it will not work and won't do the search. It will just
redirect to the blog page.

closes odoo/odoo#114107

X-original-commit: 41c27fd4912fb9f50ce5f31fff7c17c77b8530f7
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-03-02 16:01:17 +01:00
Romain Derie 1d309793d4 [FIX] website_blog: show search bar even if more than one blog
Commit [1] hid the blog navigation bar if there is only one blog.
It made sense as that navigation bar purpose is simply to select a
specific blog and not "all".

But commit [2] introduced a search bar in that blog navigation template
which was hidden if only one blog existed.
It does not make sense as the search targets blog posts which you still
want to be able to search even if you have a single blog.

This commit fixes that by moving the visibility condition from the whole
container (which includes both the search bar and the navigation bar) to
the navigation bar only.

[1]: https://github.com/odoo/odoo/commit/0a540e0ef25a439e29a762de5b35a2c6a63ad7f7#diff-6ed720c420b3e0591aeaf1c45061775765e1901d1592c46eb36b804c4c7c39f5R8
[2]: https://github.com/odoo/odoo/commit/ea009585e1d14041fe19f1e6e190b286e96c0681#diff-6ed720c420b3e0591aeaf1c45061775765e1901d1592c46eb36b804c4c7c39f5R24

closes odoo/odoo#113928

X-original-commit: 1e0bd3143623d89f504e67fb74e0f56b540530cc
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-03-01 20:54:59 +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
Thibault Delavallée 8fb59b55d9 [IMP] mail: improve 'real author' detection when posting a message
When posting a message, author is added in followers in order to receive
answers. They also do not receive its own messages, to avoid being notified
of something they just posted.

However the real author is not always the message author. In this commit
we better define this author
  * when current user is active, real author is the current user. It means
    posting on behalf of someone will send answers to you, not to the
    spoofed partner;
  * when current user is inactive, real author is the message author. An
    inactive current user means the post was probably done as sudo, aka
    in the mailgateway or frontend. In that case we don't want to add
    odoobot in followers, but the actual message author;

Task-3093257 (Mail: The Composer Update)

Part-of: odoo/odoo#107356
2023-01-27 19:56:03 +01:00
Martin Trigaux 776689b0f4 [I18N] *: export saas-16.1 source terms
closes odoo/odoo#110752

X-original-commit: 56b2b52287a8f2192d80ea417c7efac80a87c0a9
Related: odoo/enterprise#36173
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-01-24 10:20:30 +01:00
Thibault Delavallée 4775bd93a2 [REF] mail: cleanup post with {view, template} wrappers
RATIONALE

Purpose of this commit is to cleanup main post helpers and have a more easy
and understandable way of calling them.

SUMMARY

We now have two main API methods, based on business flow: either posting
on documents, either sending a mass mailing. Indeed those two flows are
different

  * post: create message, then launch notification process by taking into
    account subtype, followers, ...
  * mail: create mails in batch with recipients being based on template or
    given partners. No notifications is involved, only maybe traces if a
    mass mailing is linked

Delegate QWeb rendering to the render mixin (i.e. _render_template_qweb_view)
in order to have a single point to forge evaluation context and re-use
existing rendering code.

SPECIFICATIONS

Main API helpers are now

  * ``message_post_with_source``: (batch) post on records, using an ir.ui.view
    (given a record or its xml id) or a mail.template record (given a record or
    its xml id). When using a template, a composer is called to post on each
    record (as batch post is not yet supported). When using a view, a direct
    call to message_post using the rendered bodies is done, one record at a
    time.
  * ``message_mail_with_source``: send a mass mailing on records, acting like
    invoking the mail composer in mass mode. Same arguments are valid, either
    a reference to a view, either a reference to a mail template.

Other helpers are

  * ``_message_log_with_view``: (batch) log on records, using an ir.ui.view
    to render the body using QWeb (no notification process);
  * ``_message_log(_batch)``: (batch) log on records (no notification process);
  * ``message_notify``: notify partners on records (creating notifications
    specifically for some people while message itself is not displayed in
    chatter);

Code migration

  * ``message_post_with_template`` in "mass mode": use ``message_mail_with_source``
    and set the template record as source;
  * ``message_post_with_template`` in "comment" mode: use ``message_post_with_source``
    and set the template record as source;
  * ``message_post_with_view``: its main usage was to post on a document, in which
    case it generally can be replaced by ``message_mail_with_source`` using
    the view reference as source;

Task-2710804 (Mail: Clean MailThread Posting API)

Part-of: odoo/odoo#99482
2023-01-17 20:58:34 +01:00
Thibault Delavallée 418761e344 [LINT] mail, various: use explicit subtype in message_post_{with_...}
RATIONALE

Purpose of this commit is to be explicit in subtype chosen when invoking the
message composer / calling message_post. As default value may not always be
clear, better be explicit in case the composer default value changes.

SPECIFICATIONS

Add explicit references to subtype when it is not obvious what will be the
final subtype, notably when using helpers (post_with_view or template which
uses the composer that is not crystal clear in its subtype management).

In this commit we also add support of XMLID-based subtype when invoking the
composer. A ``default_subtype_xmlid`` context key is transformed into a
``default_subtype_id``, to be used notably in JS where we cannot easily
use a ``ref``-like statement. Post API now also supports 'subytpe_xmlid'
argument allowing to give the xml id and ease calling the methods.

Use ``_xmlid_to_res_id`` to get directly the ID of subtypes in order to
avoid useless queries from ``ref`` that does an exists.

Also remove useless values given to post API, notably author_id that is by
default the current users' partner.

Task-2710804 (Mail: Clean MailThread Posting API)

Part-of: odoo/odoo#99482
2023-01-17 20:58:33 +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
4de1e6a375 [FIX] website_blog: show blog tag option
Since [1] the blog tag option was not shown in the website editor
option's panel anymore. Because the tag is not in an editable element
and the `data-no-check` was not specified.

After this commit the blog tag option is restored.

The `_patchForComputeSnippetTemplates()` method (added thanks to [2])
was backported here and used to set `dataset.noCheck` in stable. This
can be removed in master because setting `data-no-check="true"` in
the XML will be sufficient.

[1]: https://github.com/odoo/odoo/commit/86e3bb5e24c2d125ec4ec84ac788601c63182d0f
[2]: https://github.com/odoo/odoo/commit/faf19ef7f87fc043fb9a814516e01b8eeafd9b61

task-2811746

closes odoo/odoo#108763

X-original-commit: a6d16f1109634b596102869bcd12dd93e471f788
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
Co-authored-by: xO-Tx <mou@odoo.com>
2022-12-28 17:29:11 +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
qsm-odoo c7c0a6679e [FIX] website_blog, *: allow more than 6 blog posts in dynamic snippet
*: website

Commit [1] introduced the possibility to configure "website filters"
used in the website to display some records dynamically via the "dynamic
snippet" and its variants. One of their field is `limit` which is a max
number of records the filter allows to show (so that the client side
cannot ask for thousands of records). Users can configure the limit used
by a snippet via the editor: they are allowed to choose up to 16, still
safe-guarded by the internal limit configured on the website filter on
the python side.

The problem here was that [2] introduced website filters for the blog
posts but set up a max limit of 6. Thus breaking the editor option if
the user choose a limit between 7 and 16. This commit fixes the issue,
for newly configured snippets (as a stable fix) or for users who would
-u their blog application. EDIT: as the master version of this fix, all
blocks will now use their set limit. We consider that is an acceptable
change after migration that the user can change by himself if he wants
to.

Steps to reproduce:
- Install blog application
- Add a "Blog Posts" snippet
- Set "Fetched Elements" to 10 (there are 7 records in demo data)
=> Only 6 are still shown

[1]: https://github.com/odoo/odoo/commit/0e7640b5f22d2bea04bbe22d3189cff7e03af545
[2]: https://github.com/odoo/odoo/commit/3c0d98bcd8adf9325ee3497eb8d25ec7f904d6a5

opw-2885948

closes odoo/odoo#107179

X-original-commit: 3a3dc8729aa2beec49602fe4c141043f60effdf1
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-12-05 14:04:00 +01:00
niyasraphy ef7005f524 [IMP] *: remove useless keys from manifests
Remove most values uselessly specified because giving the same value as
the default one (see _DEFAULT_MANIFEST in odoo/modules/module.py)

auto_install is Falsy by default
author is Odoo SA by default
summary & description are empty strings by default
application is False by default
test, demo, depends and data are empty lists by default
This will reduce noise/inconsistencies between manifests specifications,
simplify analysis of manifests content.

closes odoo/odoo#106686

Related: odoo/enterprise#34462
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-11-29 13:20:31 +01:00
Jeremy Kersten 5172efc434 [FIX] *: remove flag Application on some apps
We decided to make this list as feature and not application.
It allows any user in mode OneAppFree to use them without become an
Extra App.

List of apps impacted:
    blog
    forum
    all payments acquirer

task-3062641

closes odoo/odoo#106487

X-original-commit: 8b1928b3ef0e098b193ac74084344eba5beac4db
Related: odoo/enterprise#34368
Signed-off-by: Thibault Francois <tfr@odoo.com>
2022-11-25 17:56:15 +01:00
Romain Derie e86f09c027 [FIX] website_blog: let the date format being handled by qweb field
We have internal utils that will use a wanted format in a localized way.
We should use those utils rather than hardcoding a format, otherwise
that format will be used for all languages which is weird.

So, passing a `short` / `medium` etc format directly to babel will avoid
that issue. On top of that, the `value_to_html` of our
`ir.qweb.field.datetime` also provided options like `date_only`,
`hide_seconds` etc.

This commit simply gets rid of those hardcoded format and achieve the
same thing using utils & tools, which will be localized on top of that.

The "error" was report by our translator: `MMM d, yyyy` in french leads
to `oct. 18, 2022` which is not ideal. It should be `18 oct. 2022`.

closes odoo/odoo#105197

X-original-commit: 4a443736523547fb516c70f45e7e70df32b13147
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-11-07 17:59:55 +01:00
Guillaume (gdi) 292102bac1 [FIX] website_blog: fix the date filter on the blog posts
Since [this commit], following these steps:
- Go to /blog
- Activate the sidebar option
- Select a date filter on the sidebar

=> An error occurs.
The bug comes from the fact that since [this commit], some arguments
were passed twice to a function which causes a python error. The fix is
just to not pass the same argument several times.

[this commit]: https://github.com/odoo/odoo/commit/f2e20e5377a6604084aaf509f57614d7fbf263e5

Related to opw-2882492

closes odoo/odoo#104639

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-11-07 13:49:58 +01:00
Guillaume (gdi) 6782ec3f95 [FIX] website_blog: display all the blog posts when filtered
Before this commit, following these steps:
- Go to /blog
- Activate the option Customize > Top banner - Name / Latest Post
- Disable the option Customize > Full Width Cover
- Click on the "guides" tag of the "Buying A Telescope" blog

No blog is displayed. This was because the top banner post is not shown
when the posts are filtered. Basically, once filtered, a blog post was
always missing.

Related to opw-2882492

X-original-commit: ee2f778abb8b7a6e221e05361bc7b964593d1123
Part-of: odoo/odoo#104639
2022-11-07 13:49:58 +01:00
qsm-odoo c771aa406c [FIX] website, website_blog: fix wrong href on the top banner of /blog
Before this commit, following these steps:
- Go to /blog
- Activate the option Customize > Top banner - Name / Latest Post
- Disable the option Customize > Full Width Cover

The URL to which we are redirected when we click on the category of the
post presented at the top of the page leads to an error. In order to fix
the wrong url we had to patch QueryURL so that the url prefix is added
only if the url does not already start with the prefix.

opw-2882492

X-original-commit: https://github.com/odoo/odoo/commit/2b326de107b9b7a2013ee9ff174d81b645d6a623
Part-of: odoo/odoo#104639
2022-11-07 13:49:58 +01:00
Benoit Socias fadd1c8a87 [REV] *: revert "[REF] website, *: make _search_get_details extensible"
*: test_website, website, website_blog, website_event, website_forum,
   website_sale, website_slides

Reverts this refactoring because it breaks multi-tenancy: if several
databases run on the same server and different modules are installed
in each database, the global variable becomes wrongly populated.

Steps to reproduce:

On runbot:

- Go to the `-base` URL or simply select the `base` DB
- Drag & Drop the search snippet (and let it set to "Search in
Everything")
- Try to use the snippet -> Crash on unknown model

On Odoo.com saas DB:

- Drag & Drop the search snippet (and let it set to "Search in
Everything")
- Try to use the snippet -> Crash on unknown model (unless you installed
each and every module related to the search snippet)

Locally:

- odoo-bin -d first -i website --stop-after-init
- odoo-bin -d second -i website_blog --stop-after-init
- odoo-bin -d first,second
- Try to use a search bar on "first" database (using "Search in
Everything") => it tries to access the blog models.

Revert of PR: #98423

opw-3045092

closes odoo/odoo#105077

X-original-commit: 5806f71af1b6f44aac063f7e504be736300f699d
Related: odoo/enterprise#33669
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
2022-11-07 11:26:58 +01:00
Benoit Socias f2e20e5377 [REF] website, *: make search options inheritable
*: website_blog, website_event, website_forum, website_slides

With [1] it has been made easier for partners to extend search options.

This task introduces similar inheritable functions for blog posts,
events, forum posts, slides, pages and hybrid results.

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

task-2897924

closes odoo/odoo#97908

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-10-28 18:50:49 +02:00
Romain Derie 84ef92fef7 [FIX] website_blog: fix misusage of t-attf
This commit fixes wrong usage of t-attf of [1].
It would output in the DOM `rel="len(active_tag_ids) and 'nofollow'"`

[1]: https://github.com/odoo/odoo/commit/0f2cada32319b3910d6ace6d412cfa94a646c9c7

closes odoo/odoo#104306

X-original-commit: 79ea8540c63c652f117237609ef7b477c7c17bb3
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-10-27 14:41:35 +02:00
Arthur Detroux (ard) 10f1c9b222 [FIX] website_blog: restore styles post BS5 migration
[1] migrated to Bootstrap 5 and in doing so, changed the way badges are
styled. Now to give correct styles to badges, utility classes must be
added.

This commit fixes that by adding .text-primary and .text-decoration-none
to the badge.

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

task-3001319

closes odoo/odoo#104180

X-original-commit: b606df22ecd07e4acf87feadd1e6f20ed730f058
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Arthur Detroux (ard) <ard@odoo.com>
2022-10-26 17:07:23 +02:00