Commit Graph
151006 Commits
Author SHA1 Message Date
qsm-odoo 44a19384fc [FIX] tools, base: restore branding on siblings of a replaced root node
Since [1] which tried to fix the data-oe-xpath branding on nodes in some
cases, the branding actually became potentially incorrect on siblings of
a node which is replaced multiple times. E.g.

Parent view:

```xml
<hello>
    <world class="a"></world>
    <world class="b"></world>
    <world class="c"></world>
</hello>
```

Child view 1:

```xml
<xpath position="//world[hasclass('a')]" position="replace">
    <world class="new_a"></world>
</xpath>
```

Child view 2:

```xml
<xpath position="//world[hasclass('b')]" position="replace">
    <world class="new_b"></world>
</xpath>
```

No problem, two distincts elements are replaced, the system understands
that the `data-oe-xpath` of the third world of the parent view should be
`/hello[1]/world[3]`.

But in this other case:

Parent view:

```xml
<hello>
    <world class="a"></world>
    <world class="b"></world>
    <world class="c"></world>
</hello>
```

Child view:

```xml
<xpath position="//world[hasclass('a')]" position="replace">
    <world class="new_a"></world>
</xpath>
```

Child view of the child view:

```xml
<xpath position="//world[hasclass('new_a')]" position="replace">
    <world class="another_new_a"></world>
</xpath>
```

The `data-oe-xpath` of the third world of the parent view (in the
resulting view) was wrong: `/hello[1]/world[4]` -> because the system
saw two replacements + the unreplaced second `<world>`, so the index "4"
was computed.

Now the system will understand that the double replacement in fact acts
as a single replacement.

Note: this was also the same with "cross inheriting" (if the "new_a"
`<world>` of the child view was replaced by another child view of the
parent view).

At last, another 4th case was found and worth mentioning because it is
in fact the root cause of the problem. The problem is not actually the
double replacement as mentioned above but simply the replacement of a
root level element of a child view (which is what is basically done in
the last two mentioned cases). In that case, the root level nodes added
by the first child view have already their `data-oe-xpath` branding
computed before they are potentially replaced. Indicating the location
of the replacement in that case was thus only leading to bugs. E.g.

Parent view:

```xml
<hello>
    <world class="a"></world>
    <world class="b"></world>
</hello>
```

Child view:

```xml
<xpath expr="//world[hasclass('a')]" position="after">
    <world class="x"></world>
    <world class="y"></world>
</xpath>
```

Child view of the child view:

```xml
<xpath expr="//world[hasclass('x')]" position="replace"/>
```

Before this commit, before the branding is distributed, the result is:
```xml
<hello data-oe-model="ir.ui.view" data-oe-id="1439" data-oe-field="arch">
    <world class="a"/>
    <?apply-inheritance-specs-node-removal world?>
    <world class="y" data-oe-id="1440" data-oe-xpath="/data/xpath/world[2]" data-oe-model="ir.ui.view" data-oe-field="arch"/>
    <world class="b"/>
</hello>
```

=> Hence the `data-oe-xpath` of the last `<world>` was computed to
   `/hello[1]/world[3]` instead of `/hello[1]/world[2]` after branding
   distribution because the ProcessingInstruction marking the node
   removal location should not have been added: it could only be useful
   to following siblings which are not branded, which is not possible as
   the branding added on the second `<world>` of the child view
   (`/data/xpath/world[2]`) was computed before any removal.

Tests are added in this commit for the 3 last mentioned cases. As
explained, the last case is actually the same of the 2nd and 3rd ones
but it was decided to keep the 3 tests as it helps to understand the
problems better and, if the code evolves, it could become different
cases (= this is 3 cases which are currently technically equivalent but
these are different functionnal use cases). A test was written for the
first case then removed as it is basically a pure copy of other existing
tests written in [2] (trying to be improved by [1]).

[1]: https://github.com/odoo/odoo/commit/f67832a3ae0d9a3b5b53129132762e6bc1aed874
[2]: https://github.com/odoo/odoo/commit/c077ef05575d9677bce284195683f96c68386788

closes odoo/odoo#92589

X-original-commit: d6e0b3d570a4b27f72852eb261660ad09de12eeb
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-06-01 12:14:05 +02:00
tsm-odoo bfe78501ce [IMP] mail: adjust legacyPatchUiSize docstring
The legacyPatchUiSize function was supposed to be removed when introducing the
new environment in discuss. However, it appears it is still necessary for
form_renderer tests since it still relies on config.device.size_class. The
docstring has been updated accordingly.

closes odoo/odoo#92551

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-06-01 12:14:02 +02:00
Géry Debongnie 362f6b6d5b [IMP] web: update owl from 2.0.0-beta-7 to 2.0.0-beta-8
Release notes:
https://github.com/odoo/owl/releases/tag/v2.0.0-beta-8

Fixes
-----

- portal: allow use of expression to describe portal target
- compiler: fix issue with identifiers with same name
- reactivity: fix memory leak
- app: validate props for root component in dev mode

Improvements
------------

- component: display nice error for wrong child component
- props_validation: have clearer error messages
- component: only useState on props that are already reactive
- compiler: add better support for "in" and "new" operators in templates
- misc: export the validate function
- app: add setting to warn if no static props object
- add static App.registerTemplate and update Portal to use it
- add basic infrastructure to buid owl-runtime without compiler

closes odoo/odoo#92599

X-original-commit: 7fc0cc7c3f1c770dd80e8c3f3316c249d0708fe4
Related: odoo/enterprise#27916
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Géry Debongnie <ged@odoo.com>
2022-06-01 11:02:40 +02:00
Rémi Rahir f6c84d709a [FIX] project: prevent menu_service from loading
Continuity of b859d78c. The assets generated for project sharing feature
suffer from the same issue than `point_of_sale`. In master, we have to
properly declare every file we need instead of realying on the whole
`web.assets_backend`.

Part of task 2860257

closes odoo/odoo#92577

X-original-commit: 45db27c3230a7c341206e9f990e8e5a133342c9f
Related: odoo/enterprise#27914
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2022-06-01 11:02:30 +02:00
Rahul Prajapati 222ae02cea [IMP] mail: add hover download button on image attachments
PURPOSE

Improve how image attachments are downloaded from the chatter by adding the
`download` button when hovering image files

SPECIFICATIONS

add a `Download` button (icon) on the bottom right corner of image attachments
on hover

Task-2802810

closes odoo/odoo#92013

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-06-01 11:02:26 +02:00
Zelong Lin 947770ce7e [IMP] mail, *: display rating in systray
* = im_livechat, test_mail_full

Display the rating changes that generate a notification under the systray.
Using the rating faces to represent the result.

task-2794182

closes odoo/odoo#89537

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-06-01 11:02:22 +02:00
Yolann Sabaux 759df7a654 [FIX] website_crm: allow creation of opportunity
Steps to reproduce:
- In CRM seetings, activate Leads
- Create a sales team with "Pipeline" selected in Sales Teams Settings
- Set a form. The action is "create opportunity" and the Sales Team is the one you created
- Send a form

Issue:
A lead will be created. Not opportunity.

Solution:
Fetch the info related to the team

opw-2856520

closes odoo/odoo#92563

X-original-commit: 1e35d5a2f832901e1269c0f133eb846350f4ba0a
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: yosa-odoo <yosa@odoo.com>
2022-06-01 09:57:59 +02:00
mafo-odoo afd858eb3f [FIX] point_of_sale: misleading actions names for home action
Some user use home action to have internal users directly login on
the pos menu but trying to do so is difficult because of the current
misleading names:
"Open POS Menu" is a client action used in the code to reload the page
so a better fit would be "Reload POS Menu"

opw-2830883

closes odoo/odoo#90417

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2022-06-01 09:57:52 +02:00
Pierre-Yves Dufays aa32818c30 [IMP] [test_]mail[_full]: improves message recipients visibility
All the recipients of message were not always displayed in discuss and some
users were wondering if the message has been sent to everybody concerned.
This solves the problem by allowing to specify whether to display all
recipients based on the message sub type and defining for which sub type it
must.

Technical note:
- The added query count in some tests is due to the fact that the inbox
notification can now be displayed on the client. Before they were discarded
right away. Now additional check must be done. The added query is due to the
test self.res_partner_id.partner_share which is now also done on inbox
notifications (This has been determined by testing locally for all tests except
one: TestMailHeavyPerformancePost.test_complete_message_post, but it is likely
for the same reason).
- A speed optimization could be to add mail_notification.display as stored
computed field in order to avoid that extra read but it would add a little more
needed storage.

Task-2429708

closes odoo/odoo#90203

Related: odoo/upgrade#3487
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-06-01 09:57:47 +02:00
mafo-odoo 257132839a [FIX] l10n_fi: set the right tags for the finnish accounts
Some of the accounts in the finnish localization module add the wrong tag.
This commit modifies/delete/create the tags to have the right configuration.

opw-2702912

closes odoo/odoo#92542

X-original-commit: 643576233417eca9deaddcdbdfddc58932b6be9d
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Fockedey Martin (mafo) <mafo@odoo.com>
2022-06-01 08:51:54 +02:00
Aaron Bohy 4f884b1c37 [REF] web: merge mock server tests into one file
Also lint the mock_server file.

closes odoo/odoo#92539

Signed-off-by: Géry Debongnie <ged@odoo.com>
2022-06-01 08:51:50 +02:00
mafo-odoo 28b41a3246 [FIX] crm: no date_closed update between 2 won stages
Steps to reproduce:
	install crm and change a lead between two won
	stages

Expected behavior:
The date_closed does not change

Current behavior:
The date_closed changes

opw-2839298

closes odoo/odoo#92534

X-original-commit: 0c55c0d31021abe966c453c4827d5873a7af485c
Signed-off-by: Fockedey Martin (mafo) <mafo@odoo.com>
2022-06-01 08:51:46 +02:00
Nicolas Bayet a53b468201 [FIX] web_editor: remove style of a link
Before this commit
When removing the style of a link in an html_field, the style was
not removed.

After this commit
When removing the style of a link in an html_field, the style is
removed.

task-2857072

closes odoo/odoo#92573

X-original-commit: f98c6b1ffe3a788f2da6536a109efe68cb6c2da7
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-06-01 07:50:04 +02:00
Julien Castiaux da8def8e41 [IMP] core, web: Delegate delivery of static files
Rationnals
----------

Web servers can serve some resources (e.g. static files) right away
without any interaction with the web application. The network model of
most web servers makes them capable of handling thousands of
simultaneous requests when it comes to intensive IO operations such as
streaming data from a file. The network model of Odoo is different: it
is capable of a lot of processing power but can only serve a handful of
requests at a time, i.e. Odoo (with some help from postgres) is
optimized for CPU operations, not IO.

Some users don't configure their web server, they use a basic
configuration that relay all requests to Odoo. The result is that many
Odoo HTTP Workers can be busy streaming static files instead of
processing other requests. This can lead to a worker starvation, i.e.
all workers are busy streaming files and cannot process new requests.

X-Sendfile
----------

In this work, we add the support for the [X-Sendfile] header family,
they are multiples http headers that can be used by the web application
to communicate with the web server in order to delegate the delivery of
files stored on the file system. Odoo still receives the request but it
does no more stream the file content from within its HTTP worker,
instead it skips the response body altogether and sets the `X-Sendfile`
special header with the path of the file on the filesystem. The web
server intercepts that special header, open the file and stream it.

Using those headers, we can use the best of both the web application and
the web server. The web application is still responsible to locate the
resource and verify the access rights, the web server is still
responsible of streaming the content.

Using X-Sendfile is opt-in via the `--x-sendfile` CLI flag. We set both
`X-Sendfile` (apache) and `X-Accel-Redirect` (nginx). If you are using
apache, make sure `mod_xsendfile` is enabled. If you are using NGINX
you have to add the following location block:

    location /web/filestore {  # custom path, hardcoded within Odoo
        # Prevent access from the outside world, i.e. makes this
        # route only accessible via X-Accel. MANDATORY!!!
        internal;

        # Give access to the filestore using this server's
        # permissions. Odoo is in charge of verifying the access
        # rights.
        alias /path/to/odoo/data-dir/filestore;
    }

The Odoo [deployment documentation] has been updated accordingly.

[X-Sendfile]: https://www.nginx.com/resources/wiki/start/topics/examples/xsendfile/
[deployment documentation]: https://www.odoo.com/documentation/master/administration/install/deploy.html#serving-static-files-and-attachments

Changes to the API
------------------

To benefit most from X-Sendfile, all APIs related to streaming content
over HTTP has to be adapted. They are: (1) `request._serve_static`,
(2) `ir.http._serve_fallback`, (3) `/web/content` and (4) `/web/image`.

Each used it own way to deliver content: (1) `_serve_static` was using
`send_file` (flask's send_file that as been vendored with odoo 10
years ago and not maintenained since then), (2) _serve_fallback was
handcrafting a `werkzeug.wrappers.Response`, (3) /web/content-image were
using the "binary server" `ir.http.binary_content` API.

I has been decided to remove all 3 APIs and to merge the code inside of
the new `http.Stream` object and the `ir.binary` helper model.

A Stream wraps what is going to be sent to the browser, it can be a path
to a file on the locale filesystem, a blob of raw data or an URL to an
external resource. The Stream also holds various metadata that are
mainly used for caching. The preferred way to create a Stream is via one
of its three factories so that all the metadata are set. The factories
are: `from_path`, `from_attachment` and `from_binary_field`. A stream
instance exposes a single method `get_response()` used to create the
corresponding HTTP response object out of the stream.

Inside of `ir.http` were a few methods that were not related to the http
routing and formed what was called the "binary server". All those
methods have been removed and the feature have been refactored inside of
the new `ir.binary` model. The removed methods are:

- `_xmlid_to_obj`
- `_get_record_and_check`
- `_binary_ir_attachment_redirect_content`
- `_binary_record_content`
- `_binary_set_headers`
- `binary_content`
- `_response_by_status`
- `_get_content_common`
- `_content_image`
- `_content_image_get_response`
- `_placeholder_image_get_response`

The new `ir.binary` abstract model exposes the following utilities:

**`_find_record`**

Find an attachment or a record with a binary-field out of an xmlid or
out of a pair record-model/record-id. Check the access rights and the
access token.

**`_get_stream_from`**

Create a Stream from an attachment or a record with a binary-field.

**`_get_image_stream_from`**

Same as `_get_stream_from` but adapted for images. It sets a sensible
ETag on the stream and has image resizing support.

**`_placeholder`**

Get the image placeholder blob.

Testing
-------

It is possible to test the web server configuration using the
`test_http` module. Install the module then run the unittest using the
`webserver` test-tag. By default it attempts to connect to a web-server
running on `http://localhost:80`, you can change this URL by setting the
`WEB_SERVER_URL` environment variable.

    odoo-bin -i test_http --stop-after-init
    WEB_SERVER_URL='http://localhost:80' odoo-bin --test-tags webserver --stop-after-init

closes odoo/odoo#88134

Task: 2801675
Related: odoo/documentation#2083
Related: odoo/enterprise#26191
Signed-off-by: Julien Castiaux <juc@odoo.com>
2022-06-01 02:53:59 +02:00
Julien Castiaux 49efab6958 [IMP] core: utility to reraise errors as others
We introduce a new decorator/context-manager to catch some exceptions
and re-raise them as another error. This utility main's purpose is to
hide a route that a user has no access to behind a fake HTTP 404 Page
not Found error.

The utility is at `odoo.tools.misc.replace_exceptions(*exceptions, by)`.

Its usage is as follow:

    @route('/some/route', auth='public')
    @replace_exceptions(AccessError, AccessDenied, by=NotFound())
    def some_route(self):
        if not request.session.uid:
            raise AccessError("Must be connected to see this route")
        ...

Or as a context-manager if you don't want to except an entire function:

    @route('/some/route', auth='public')
    def some_route(self):
        with replace_exceptions(AccessError, AccessDenied, by=NotFound()):
            if not request.session.uid:
                raise AccessError("Must be connected to see this route")
        ...

Task: 2800772
Close: #90433
Part-of: odoo/odoo#88134
2022-06-01 02:53:59 +02:00
Alexandre Kühn 18e9076a8f [MOV] mail: rename RTC models (step 2)
- rename 'RtcCallViewer' to 'CallView' (files)
- rename 'RtcActivityNotice' to 'CallSystrayMenu' (files)
- rename 'RtcCallParticipantCard' to 'CallParticipantCard' (files)
- rename 'RtcLayoutMenu' to 'CallLayoutMenu' (files)
- rename 'RtcConfigurationMenu' to 'CallSettingsMenu' (files)

Task-2868876

closes odoo/odoo#92552

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-05-31 22:56:43 +02:00
Alexandre Kühn 4d14ba8a00 [IMP] mail: rename RTC models (step 2)
- rename 'RtcCallViewer' to 'CallView'
- rename 'RtcActivityNotice' to 'CallSystrayMenu'
- rename 'RtcCallParticipantCard' to 'CallParticipantCard'
- rename 'RtcLayoutMenu' to 'CallLayoutMenu'
- rename 'RtcConfigurationMenu' to 'CallSettingsMenu'

Task-2868876

Part-of: odoo/odoo#92552
2022-05-31 22:56:42 +02:00
mafo-odoo 5e0700417c [FIX] website_sale: remove animation when out-of-stock product is added
Steps to reproduce:
	1) Create a product with 0 on hand qty and under Sales tab,
	"Continue Selling" if Out of Stock unchecked.
	2) Navigate to the website's shop.
	Customize -> Add Feature -> enable Add to Cart.

Current behavior:
From the Shop's screen, the button to add to cart for this product
 is clickable and the animation plays, but no item is added (because
out of stock).

Expected behavior:
There is no animation when an out-of-stock product is added to the cart

This fix completes the fix at commit 8d3a4e1f7094ded889b652e5ec393f6eb2f2b6f6
that didn't take into account the possibility of an empty cart (0) that led to
an undefined value of card_quantity in the data returned from the rpc.

opw-2856711
opw-2745305

closes odoo/odoo#92578

X-original-commit: fdf97d84d1a331f3062bcda6707dfd8c3bc90532
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-05-31 22:01:54 +02:00
MerlinGuillaume 760d6ca2fa [FIX] website_forum: post image in forum with 30 karma
Users with 30 karma cannot use images in their forum post

Steps to reproduce:
1. Install the Forum app
2. Change the portal user's karma to 30 (you can use this command in
psql: `UPDATE public.res_users SET karma=30 WHERE id=7;`)
3. Connect as portal
4. Go to the forum and create a new post
5. Add a title and an image to the post and validate it
6. An error message is displayed preventing the user from posting the
image even though he should be able to

Solution:
Adapt the condition on the user's karma

opw-2648770

closes odoo/odoo#92556

X-original-commit: 43c2cbab6947628f58b5edc33d618e50d927f624
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Guillaume Merlin (megu) <megu@odoo.com>
2022-05-31 19:18:02 +02:00
Laurent Desausoi (lade) 27ff79bf37 [FIX] http_routing, web: fix translation on additional modules
Translations from non-standard modules on the website are not properly loaded,
thus no translation is done even though translated terms are valid (e.g.
signing a document shared).

Step to reproduce the issue:
1) Install the sign module & Install French language (or any execpt English)
2) Disable the English language
3) Go to Sign and Share on document
4) Open the link
You will see that the "Click to start" is not translated. Some other strings
too.

Solution: The issue appeared since commit [1]. In there, we changed the argument key
for additional modules while it was not changed on the backend resulting in
the module translation not loaded. Furthermore, in the backend the additional
modules were appended as if they were a list while it is a string.

[1]: https://github.com/odoo/odoo/commit/8cc066173dfb61bd95b8e1f0716f71f4e251810a

opw-2842699

closes odoo/odoo#92546

X-original-commit: b4eaaaa567ea306e6e86d133c3a805145d9ea4d0
Related: odoo/enterprise#27906
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Desausoi Laurent (lade) <lade@odoo.com>
2022-05-31 19:17:55 +02:00
tsm-odoo 889eed4a7a [IMP] mail: stop registering chatter container as messaging component
No container should be registered as messaging component. ChatterContainer is the
last one registering itself as such. This PR solves this issue.

closes odoo/odoo#92541

Related: odoo/enterprise#27905
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-05-31 19:17:49 +02:00
tsm-odoo 89c8abce53 [FIX] mail: correct mistakes introduced with new environment
Some mistakes slipped into the PR introducing the new environment in the discuss
app. This PR fixes those mistakes :

- triggers on this.env.bus that were listen on core.bus
- inconsistent service names between discuss_public_boot/main
- call to Component.env.services.messaging while messaging was available in this.env
- remaining useSubEnv in container that were not needed anymore

closes odoo/odoo#92533

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-05-31 19:17:45 +02:00
Alexandre Kühn 6da3e22926 [IMP] mail: consistent default visual of thread topbar icon buttons
- Consistent icon color by default (dark grey)
- Hover feedback visual for all buttons
- Rounded border on hover

Task-2860749

closes odoo/odoo#92209

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-05-31 19:17:41 +02:00
Odoo's Mergebot 6355ccd8f3 [MERGE][IMP] knowledge: fix and improve usability and design
Purpose
=======

Improve knowledge usability and design now that it is merged in master
and we get first testing feedbacks.

This includes notably
  - cleaning up fields names
  - adding placeholder when sections are empty.
  - fixing adding emoji behaviour
  - improve adding empty title
  - allowing frontend users to view public child articles
  - merge templates for displaying article name in sidebar
  - minor design changes and fixes

See sub commits for more details.

Task-2852908

closes odoo/odoo#91430

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-05-31 19:17:37 +02:00
Fabio Barbero 121c240dfd [IMP] knowledge: merge read only and edit article template
Purpose
=======
Clean up templates to avoid duplicate code for article sidebar.

Task-2852908

Part-of: odoo/odoo#91430
2022-05-31 19:17:36 +02:00
Fabio Barbero 0321446caf [FIX] knowledge: minor fixes
Purpose
=======
Prevent users from dragging articles from Workspace/Private to Shared
section, correctly send title when creating article from command
palette, make command palette text translatable, remove mysterious
'once' file.

Task-2852908

Part-of: odoo/odoo#91430
2022-05-31 19:17:36 +02:00
Fabio Barbero af5d672084 [IMP] knowledge: minor design changes
Purpose
=======
Improve look of "Add Icon/Cover" buttons, change wording of sentences,
add text for empty sections (which is then removed when an article is
dragged onto it), add hover effect to icon, improve result list for move
to modal and article selection.

Task-2852908

Part-of: odoo/odoo#91430
2022-05-31 19:17:36 +02:00
Fabio Barbero 9f8d44b616 [IMP] knowledge: improve frontend view
Purpose
=======
Allow users to correctly unfold parent articles, only show <a> tag in
frontend view when article is in read only mode.

Task-2852908

Part-of: odoo/odoo#91430
2022-05-31 19:17:35 +02:00
Fabio Barbero 19e39022fa [IMP] knowledge: add default empty title
Purpose
=======
When creating a new article from the view, add a new empty h1 tag where
the user can start typing on. When clicking on the "New Article" title
for the first time, it will be set to the first h1 in the body.

Task-2852908

Part-of: odoo/odoo#91430
2022-05-31 19:17:35 +02:00
Fabio Barbero 57f7fbaa0e [IMP] knowledge: show article icon for member based on
Purpose
=======
Currently, the icon of the "based on" article in the share panel is only
shown for the internal permission and not for the member. Ensure
consistency by adding it to the member section as well.

Task-2852908

Part-of: odoo/odoo#91430
2022-05-31 19:17:35 +02:00
Fabio Barbero c188181f24 [IMP] knowledge: clean up field names
Purpose
=======
Make field names easier to search by removing "Article" in front of
them.

Task-2852908

Part-of: odoo/odoo#91430
2022-05-31 19:17:34 +02:00
Victor Feyens 5e93a231c2 [FIX] payment_stripe: running tests with python 3.7
mock.call_args only provides the args/kwargs feature in 3.8+

closes odoo/odoo#90716

Related: odoo/enterprise#27253
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-05-31 19:17:20 +02:00
Victor Feyens 987b0d49f9 [IMP] payment: clean test utils
All utilitary test methods will be private, to clearly separate
test methods and utils.

Task - 2848326

Part-of: odoo/odoo#90716
2022-05-31 19:17:20 +02:00
Victor Feyens 5ac5b2ea96 [MOV] payment: rename test files
`test_payments` -> `test_account_payment`
`test_transactions` -> `test_payment_transaction`

Task - 2848326

Part-of: odoo/odoo#90716
2022-05-31 19:17:19 +02:00
Victor Feyens 677589d01f [IMP] payment: merge common into unique test class using it
The multi-company common of payment was only used in a single specific
test class of the same module.  Since we don't aim to test multi-company
flows in specific payment_ modules, we might as well remove the common
and move the setup content in the only class using this common.

Task - 2848326

Part-of: odoo/odoo#90716
2022-05-31 19:17:19 +02:00
Victor Feyens 26976477c4 [IMP] payment: simplify test commons
During the payment pocalypse, new tests common were introduced. Those
commons were split into different classes to be as modular as possible
but we noticed during the following months (/year) that they weren't so
easy to understand and use.

Therefore, this commit aims to simplify those commons by removing the
core PaymentTestUtils common, integrating it in the base PaymentCommon,
and making the HttpCommon depend on the core PaymentCommon, instead of
using only the utils.

This doesn't require much changes in the tests since they all used
either the PaymentCommon or both PaymentCommon and PaymentHttpCommon.

Task - 2848326

Part-of: odoo/odoo#90716
2022-05-31 19:17:19 +02:00
Rahul Prajapati ac00d19c8d [IMP] mail: remove alias mixin from channel
Before this commit:

mail.alias.mixin is being used in mail.channel

After this commit:

removed mail.alias.mixin with all of its uses in mail.channel

Task-2823691

closes odoo/odoo#89652

Related: odoo/upgrade#3469
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-05-31 19:17:06 +02:00
Benoit Socias 76eb6e6c74 [IMP] web, web_editor: exclude assets from documents
Currently only the `*.assets_*` CSS and JS files are considered as
assets. Because of this some assets from `web_studio`, `pos` and
`document_spreadsheet` become available for selection as documents.

This commit replaces the existing blacklist by a check on whether the
URL matches `/web/assets/*`.

Steps to reproduce:
- Install website, web_studio and pos.
- Drop a Text - Image block in the home page.
- Replace the Image.
- Go to the Documents tab.
=> Some JS/CSS/map assets were available for selection.

task-2799866

closes odoo/odoo#89151

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-05-31 19:16:59 +02:00
Nicolas Pierre 87d33596d1 [IMP] mrp, purchase_stock: visibility days and days to prepare MO
- Add the concept of 'Days to Prepare MO' in  mrp, similar to 'Days to
Purchase' but defined at the product level. Both concepts are merged into
Days to Order at the orderpoint level, taking the value of Days to Purchase
for orderpoints with a buy route and Days to Prepare MO for orderpoint with a
manufacturing route.
 - Add the concept of 'Visibility Days' on orderpoints. The idea is to
avoid to create through reordering rules multiple small orders for  the
same product on a small time frame but rather to order directly a bigger
quantity. When Visibility Days are defined, the quantity of the orders
created by a RR is not the quantity forecasted at Today + Lead times
(quantity that triggered the order according to the RR), but the
quantity forecasted at Today + Lead Times + Visibility days.
The Visibility Days are different for purchase and manufacturing.
Changing the route of the orderpoint will change its value. They
can be defined at the company level and further fine-tuned on the
orderpoint. In case of change of the parameters at the company level,
only orderpoints without a specific value of Visibility Days  will
be changed.
 - Alignement between Manufacturing and Purchase Security Lead Time
(previously the Manufacturing Security Lead time didn't impact the
procurement date, instead the manufacturing time was made longer).

closes odoo/odoo#86682

Task-id: 2738838
Pr: https://github.com/odoo/odoo/pull/86682
Related: odoo/upgrade#3415
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2022-05-31 19:16:55 +02:00
Florian Charlier ab9bc656da [IMP] mail: improve notification email previews
Prepare an informative and nice-looking preview from the main content of the
email body, avoiding buttons/images alt etc.
Links, images, tables are removed.

Whitespace is added after the preview to avoid including the full message in
the preview (with markup).

Tags and attributes are also added to increase compliance with HTML5 standard,
including accessibility.

One additional SQL request is required to fetch the preview sub-template.

Task-2413355

closes odoo/odoo#86266

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-05-31 19:16:49 +02:00
Achraf (abz) b655720558 [FIX] hr_expense: Markup no content helper
Steps:
 - Go to Expenses
 - Reporting/Expenses Analysis
 - List View
 - Remove every records
 - The no content help text is broken

To fix this we have to Markup the second part of the noContentHelp

opw-2862056

closes odoo/odoo#92532

X-original-commit: e2d20c97f2a9da0d2f357f1caa08c0e9632c1bcd
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Achraf <abz@odoo.com>
2022-05-31 18:20:06 +02:00
Guillaume (gdi) 490c032871 [FIX] website: place snippets correctly after install
Before this commit, after the user installed the website_payment module,
the donation blocks were not well placed in the editor (after the
uninstalled modules). This commit solves the problem and permits to
place the installed snippets correctly in the editor.
Steps to reproduce the fixed issue:
 - Install website
 - Enter edit mode
 - Click on "Install" for the "Donation Button" snippet

=>After install, the snippet still appears after uninstalled modules.

task-2767716

closes odoo/odoo#92413

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-05-31 18:20:02 +02:00
Odoo's Mergebot b65f05a6b3 [MERGE] mass_mailing: reorganize addon according to guidelines
PURPOSE

Reorganize addon according to guidelines, helping finding and updating code.

SPECIFICATIONS

Perform various code linting and cleanups, line breaks, linter issues...
No code or feature change should occur with this commit.

Correctly split data into separate files. A lot of content was put a bit
randomly in data files, leading to a hard discovery of code and features.

Move subscription model into its own file, to ease future improvements. Do
the same for its views.

Also move menu entries into a specific file for menus, allowing to easily
understand menu organization in mass mailing.

Reorganize templates in order to see a bit what's going on here. Notably split
subscription (opt-out, blacklist) from management (view, reporting) templates.

Reorganize controller code by main section in order to separate a bit various
code purpose.

Task-2864264 (Mass Mailing Module Reorganization)

closes odoo/odoo#92509

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-05-31 16:02:26 +02:00
Thibault Delavallée f446e54cbd [MOV] mass_mailing: reorganize controllers and templates
PURPOSE

Reorganize addon according to guidelines, helping finding and updating

SPECIFICATIONS

Reorganize templates in order to see a bit what's going on here. Notably split
subscription (opt-out, blacklist) from management (view, reporting) templates.

Reorganize controller code by main section in order to separate a bit various
code purpose.

This commit contains only file split / renaming and code move.

Task-2864264 (Mass Mailing Module Reorganization)

Part-of: odoo/odoo#92509
2022-05-31 16:02:25 +02:00
Thibault Delavallée 4f39a80e76 [MOV] mass_mailing(_sms): split models and views
PURPOSE

Reorganize addon according to guidelines, helping finding and updating code.

SPECIFICATIONS

Move subscription model into its own file, to ease future improvements. Do
the same for its views.

Also move menu entries into a specific file for menus, allowing to easily
understand menu organization in mass mailing.

A duplicated menu about link trackers in SMS is also removed.

Task-2864264 (Mass Mailing Module Reorganization)

Part-of: odoo/odoo#92509
2022-05-31 16:02:24 +02:00
Thibault Delavallée c617923664 [MOV][FIX] mass_mailing: reorganize data and models, remove duplicated data
PURPOSE

Reorganize addon according to guidelines, helping finding and updating code.

SPECIFICATIONS

Correctly split data into separate files. A lot of content was put a bit
randomly in data files, leading to a hard discovery of code and features.

We also fix duplicated attachments definition, both in mass_mailing_data and
ir_attachment files. It has been merged into the attachment data file.

Task-2864264 (Mass Mailing Module Reorganization)

Part-of: odoo/odoo#92509
2022-05-31 16:02:24 +02:00
Thibault Delavallée 19b02759ca [LNT] mass_mailing(_sms): perform various linting
PURPOSE

Reorganize addon according to guidelines, helping finding and updating code.

SPECIFICATIONS

Perform various code linting and cleanups, line breaks, linter issues...
No code or feature change should occur with this commit.

Task-2864264 (Mass Mailing Module Reorganization)

Part-of: odoo/odoo#92509
2022-05-31 16:02:24 +02:00
Moens Alexandre 58b3625bc4 [IMP] l10n_eg_edi_eta : neutralise production env
before this commit:
The `odoo-bin neutralize` command would not neutralise l10n_eg_edi_eta

closes odoo/odoo#92298

X-original-commit: 9a0a644444be4cceb4bdc43838dc6ce414608437
Signed-off-by: Josse Colpaert <jco@odoo.com>
2022-05-31 16:02:15 +02:00
Antoine Vandevenne (anv) cfbd8990a3 [FIX] payment_*: update module sequences to be placed after Flutterwave
task-2759117

closes odoo/odoo#85514

Related: odoo/documentation#1939
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-05-31 16:02:08 +02:00
Antoine Vandevenne (anv) 94bddadf4e [ADD] payment_flutterwave: integrate with "Flutterwave standard" gateway
See README for technical details.

task-2759117

Part-of: odoo/odoo#85514
2022-05-31 16:02:08 +02:00