Commit Graph
151076 Commits
Author SHA1 Message Date
tsm-odoo 3c10fcadee [IMP] mail, web: allow ui size patching during tests
Until now, when we add to patch the ui size, we would have patched one of the following:
	- config.device.{isMobile,size_class}
	- (wowl) env.isSmall / env.services.ui.{isSmall/size}
	- (legacy) env.device.isMobile
	- (legacy/wowl) browser.innerWidth

The issue is that patching one does not affect the others resulting in an incoherent state.
In order to ease ui size patching, the `patchUiSize` method has been introduced. This method
take either a size or a width as parameter (eg. SIZES.SM, 1920) and affect all the properties above.

task-2582313

closes odoo/odoo#91540

Related: odoo/enterprise#27428
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-05-19 16:40:12 +02:00
Pierre-Yves Dufays fe2f4fee18 [IMP] base, mail, survey: improves slightly the UX
Improves UX by adding placeholders to clarify the purpose of some inputs and
changing some field layout to ease the edition (with the use of multi-lined
editor).

Details:
Some placeholders have been added:
- description field of survey.question
- default_note field of mail.activity.type
- summary of mail_activity_type_view_form

Some field layout have been turned into multi-lined editor:
- default_note field of mail.activity.type
- write a message in mass mail mode (email_compose_message_wizard_form)

added border for field help of edit action (class oe-bordered-editor)

Task-2766291

closes odoo/odoo#85046

Related: odoo/enterprise#24599
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2022-05-19 15:23:55 +02:00
William Braeckman 40b10d0295 [FIX] website_sale: Avoid traceback when adding deleted products to cart
Prior to this commit an user could try to add a product to cart that does not
exist anymore because it was deleted while the user /shop page wasn't refreshed.

This commit avoids this (rare) use case to happen.

TaskId-2835736

closes odoo/odoo#91752

X-original-commit: 7aeec2921d7159f0c7fa4c8caf2d00f802c69264
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-05-19 13:45:12 +02:00
Yolann Sabaux dc8cf87fc8 [FIX] web: fetch right company_id
Steps to reproduce:
- Have two companies set up
- In settings, check for company 2 the Files Centralization
- For a Product, upload a document

Issue:
The document will not appear in Documents.
It will only appear if the option is checked for company 1

Cause:
The company_id is not fetched correctly throughout the process.
There is a similar solution for the specific `documents` upload route:
https://github.com/odoo/enterprise/blob/bdf712d66c3e5cee70a6b424b69a618fe655a39f/documents/controllers/main.py#L147-L149

Solution:
Get the id directly from the cookies

opw-2774365

closes odoo/odoo#91751

X-original-commit: 46db92d5211c215d07448676e619154390b7147f
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: yosa-odoo <yosa@odoo.com>
2022-05-19 13:45:05 +02:00
Jérémy Hennecart (jeh) bca719293d [FIX] base,crm: revert possibility to install language
Revert the possibility to install languages from the form views
of opportunity/lead and partner.
We consider that the quick installation of languages is too
advanced and admin people can go through the dedicated menu if
need be.

task-2839020

closes odoo/odoo#91750

X-original-commit: 5a616997659b2359ec946883b620e2fae6d6c39d
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-05-19 13:45:01 +02:00
abderraouf 0f23671275 [IMP] sale_timesheet: Add test to check analytic_account_balance on project
This commit adds a unit test to check if the value of
`analytic_account_balance` field in a project is the one expected when a
timesheet is added into this project.
The analytic account balance value expected should be equal to
`timesheet_cost * timesheet_unit_amount * -1`, where:
- `timesheet_cost`: the employee cost or the cost set on an employee mapping
                    defined in the project.
- `timesheet_unit_amount`: the number of hours/days set on the timesheet.

task-2783686

closes odoo/odoo#87405

Related: odoo/enterprise#25006
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-05-19 13:44:57 +02:00
Yannick Tivisse abbf207e2e [FIX] privacy_lookup: Fix indeterminist crashing test
closes odoo/odoo#91731

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-05-19 12:28:37 +02:00
Yannick Tivisse 728415a1fb [MOV] privacy: Rename module into privacy_lookup
Purpose
=======

The newly introduced privacy module at https://github.com/odoo/odoo/pull/89312
is actually conflicting with an already existing OCA application.

See: https://github.com/OCA/data-protection/tree/14.0/privacy

As the application is only present in master and as I like the OCA (especially
Pedro), let's rename the application to avoid deployment issues on their side.

Taskid: 2857904
Part-of: odoo/odoo#91731
2022-05-19 12:28:37 +02:00
Pierre Masereel adddc30732 [REVERT] account: unbalanced entry with price_unit 0
This fix will try to write a new amount value on the tax when an
invoice is created from POS, that will raise a user error preventing the
creation of the order.

This reverts commit 2b9592cb0ecef235d708ed7810d0613ccd946124

OPW-2855694

closes odoo/odoo#91719

X-original-commit: d3cce0e3ae13859954d6907a3cb16fb0e1a95f86
Signed-off-by: Masereel Pierre <pim@odoo.com>
2022-05-19 12:28:27 +02:00
Younn Olivier 79867ca96f [FIX] web_tour, web_editor: observe iframe DOM mutations in tours
Before this commit, iframes DOM mutations were not taken into account to
update the tour manager. So in the context of mass_mailing, displaying
the web editor in an iframe, the tours were updated at the right moment
by chance (no mutations for 750ms in the global document and in the
iframe document).

This commit adds an o_iframe class, used to define an iframe that will
render a part of Odoo. An observer is added in the tour service to
monitor the addition of such iframe, and sets an observer on that iframe
to correctly update the tour manager, counting the iframe DOM mutations
for the 750ms delay.

In addition to this observer, the iframe's HTML content is added to the
final document HTML log when a tour crashes (directly between the
<iframe></iframe> for convenience, copy/pasting it in a browser just
ignores what's in between).

Also, when the tour_service is initialized in an o_iframe, it will not
run the tours.

This fix targets the saas-15.3 as it is needed to avoid a race condition
introduced with [1] (introducing a tour which relies on DOM updates
inside the mass mailing iframe). This could be backported if the need
ever rise (it should really have been the case since [2]).

[1]: https://github.com/odoo/odoo/commit/52d32e26c34bef10823582ef5c1f840492b73d7a
[2]: https://github.com/odoo/odoo/commit/971629b9fe40911c3a9765c9fb746ea1c55d3560

closes odoo/odoo#91718

X-original-commit: ea35bd06c84b7101224c3b3dd24d1780e13232a9
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-05-19 12:28:24 +02:00
Romain Derieandthcl-odoo 6a7c2840cd [FIX] website: fix cookiebar responsiveness
There is 2 issues regarding the responsiveness of the cookiebar:

==== Problem n°1: ====
======================

By default, `.modal-dialog` receive a O.5rem margin.
```css
    .modal-dialog {
        margin: 0.5rem;
    }
```

But it only takes effect in small resolution, as starting from SM (576px,
see _breakpoints.scss), the margin is set to 0. `.modal-dialog` receive:
```css
    @media (min-width: 576px)
    .modal-dialog {
        margin: 0 auto;
    }
```

On top of that, the `.modal-dialog` has a `min-height` of 100%, which is
getting too big in XS, as there is a 0.5rem margin, which adds up on top
of the 100%
```css
    .s_popup[data-vcss='001'] .modal-dialog {
        height: auto;
        min-height: 100%;
    }
```
It results in a modal height bigger than the screen size, ultimately
creating a scrollbar for just a few pixels (2 * 0.5rem margin), making
the cookies bar partly hidden by the screen.

==== Problem n°2: ====
======================

The buttons from the cookies bar "discrete" template are simple `<a/>`
elements inside a `div.col`.
Those links have no bottom margin like a paragraph would have.
In LG screen, it is fine as the col containing those links is next to
the other col containing the paragraph which adds the margin bottom,
making elements not stuck to the bottom edge of the screen:

------------------------------
|  COL-LG    |     COL-LG    |
|   <p/>     |   <a/> <a/>   |
|                            | <-- bottom margin set on <p/>
------- screen edge ----------

But in lower resolution, as both col would be on top of each other, the
`<a/>` would be stuck to the bottom screen border.
--------------
|  COL-LG    |
|   <p/>     |
|            | <-- bottom margin set on <p/>
--------------
-----------------
|     COL-LG    |
|    <a/> <a/>  | <-- Against the screen bottom edge
-- screen edge --

======================

Steps to reproduce:
- Install Website
- Enable cookie bar in the Settings
- Go on the Website with a mobile screen width

opw-2784233

closes odoo/odoo#91712

X-original-commit: 843e57694dd73ed4b7fca0460a4cf9b166820843
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Claude Thibault (thcl) <thcl@odoo.com>
Co-authored-by: thcl-odoo <thcl@odoo.com>
2022-05-19 12:28:20 +02:00
qdp-odoo 4420ad3935 [FIX] account: partner inconsistencies on invoices
How to reproduce:
Have 2 different tabs open on the same draft invoice
Tab 1: add a new invoice line
Tab 2: change the partner
Tab 1: save
Tab 2: save

Before the fix:
The new invoice line from tab 1 has the partner from before the change,
but the other lines have been updated to the new partner.

Expected:
All invoice lines have the same partner as the invoice itself

This use case can be reproduced like this manually, but it can happen
easily even on one tab because the OCR acts like the second tab if users
start to edit the invoice before it is scanned.

Note that in a perfect world, a warning would be raised to prevent any
loss/mischief due to concurrent editions of the same record but that's
beyond the scope of a bugfix made on a stable version.

opw-2777390
opw-2762347
opw-2741859

closes odoo/odoo#91705

X-original-commit: 2c5450af8d6f5934e6ab2095c3307b432fa3036a
Signed-off-by: William André (wan) <wan@odoo.com>
2022-05-19 12:28:16 +02:00
momegahed 85ab969f6a [FIX] web: url to ping the server is incorrect
If applied, this commit will fix the following bug by fixing
the url used to ping the server

Steps to reproduce:

1- open apps with debug mode
2- click on updates
3- the server is read as if it is offline

Bug:

in ecfe85db84 all links are changed
static/src/(img|fonts) => static/(img|fonts) however in this specific
 case the server is remote
(https://apps.odoo.com) and it still needs /src/

Fix:
add /src to the url

OPW-2791531

closes odoo/odoo#91112

X-original-commit: bf629cf3063119a5c819f74329a51a0e1a7c172f
Signed-off-by: Géry Debongnie <ged@odoo.com>
2022-05-19 12:28:12 +02:00
Bastien Dosimont 958fc1ed24 [IMP] website_sale : use smaller pictures if possible for the shop grid.
Prior to this commit the 1024px image was always used regardless of the
space used on the page.
We will now use the 512px image when it is worth it without reducing
overall quality.
This should improve the page loading experience as well as reduce the
overall bandwidth required to load the page.

task-id : 2823110
related : https://github.com/odoo/odoo/pull/86294

closes odoo/odoo#89992

Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-05-19 12:28:08 +02:00
std-odoo 56de864c8b [IMP] mass_mailing: improve the mailing list Kanban view
Purpose
=======
This commit rework the design of the Kanban view of the mailing list.

There are now 2 styles for this Kanban view
- Grouped, for this one we keep the same "card design" as before
- Ungrouped, we use a "list style" view, and the card take the all
  width of the screen

Add some actions to be able to import quickly contacts from this view
or to send a mailing to the mailing contact list.

Task-2737782

closes odoo/odoo#86587

Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2022-05-19 12:28:04 +02:00
Odoo's Mergebot 4c291fe304 [IMP] website_slides: allow to mark content as "(un)done"
Purpose
=======
Allow the users to themselves mark their course as "done" or "not done"

Specifications
==============
When the course is a "Training" in fullscreen or in non-fullscreen, or
when the course is a "Documentation" in fullscreen mode, allow the user
to click on the "done" button in the sidebar.

When the course is a "Documentation" in non-fullscreen mode, add a
button "Mark Not Done" when the slide is done.

The quiz and the certification cannot be marked as done manually, the
user has to complete the questions for that.

A certification cannot be marked as "Not Done" (but a quiz can).

Technical
=========
As the fullscreen view and the non-fullscreen view will share a lot of
code, make a common class to avoid redundancy.

Task-2604792

closes odoo/odoo#75561

Related: odoo/upgrade#3108
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2022-05-19 12:28:00 +02:00
std-odoo e1ac0ed0a2 [IMP] website_slides: allow to mark content as "(un)done"
Purpose
=======
Allow the users to themselves mark their course as "done" or "not done"

Specifications
==============
When the course is a "Training" in fullscreen or in non-fullscreen, or
when the course is a "Documentation" in fullscreen mode, allow the user
to click on the "done" button in the sidebar.

When the course is a "Documentation" in non-fullscreen mode, add a
button "Mark Not Done" when the slide is done.

The quiz and the certification cannot be marked as done manually, the
user has to complete the questions for that.

A certification cannot be marked as "Not Done" (but a quiz can).

In the non-fullscreen view, mark content as done automatically like we
do for the fullscreen view.

Technical
=========
As the fullscreen view and the non-fullscreen view will share a lot of
code, make a common class to avoid redundancy.

Task-2604792

Part-of: odoo/odoo#75561
2022-05-19 12:27:59 +02:00
std-odoo 7d69bd893e [MOV] website_slides: split the course sidebar template
Purpose
=======
In preparation to the next commit, we split the course sidebar template
to be able to re-use some part of it in other templates.

Task-2604792

Part-of: odoo/odoo#75561
2022-05-19 12:27:59 +02:00
Benoit Socias 254421b5d8 [FIX] website: increase stability of ace test tour again
This is an attempt at fixing a runbot "race" condition.
A first attempt was done in [1] but the selector introduced to make
sure the page was reloaded after the assets were changed was wrong.

This commit fixes that selector.

During the investigation of the problem, it was also discovered that the
SCSS change could take quite a long time on a busy server becasue it
triggers the SCSS compilation each time.

To reproduce that problem locally, run the `stress` command while
executing the `test_html_editor_scss` test.
E.g.:
```sh
$ stress --cpu 32 --timeout 120
```

The error that shows up in that case is misleading because it makes it
look like the confirmation popup was not clicked on.
What is actually happening is the following:
- the Reset button is clicked on
=> the confirmation popup is shown
- the confirmation is clicked
=> the popup is closed and the RPC call is made
- the RPC does not respond within the tour step's timeout
=> the last step is not shown as succesful and the screenshot shows the
non-reset state since the server response did not arrive yet

To be safe on busy servers this commit also increases the timeouts
related to steps that follow updates of SCSS files so that they can be
recompiled on time.

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

runbot-3744

closes odoo/odoo#91725

X-original-commit: e04c4f06086ff4287ef4acfc65d5b3d957396ae7
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
2022-05-19 11:13:55 +02:00
Hubert Van de Walle (huvw) a478a9e906 [FIX] web: boolean_toggle widget ignores readonly attribute
The boolean_toggle should only be disabled when there is a readonly
modifier, not when the view is in readonly mode.

Cause of the issue

  The input was disabled but the `_onClick` was registered on the
  widget root node.

Solution

  - Listen for clicks on the input element
  - Override the render method to set the disabled prop according to the
    readonly modifier.

opw-2739468

closes odoo/odoo#91601

X-original-commit: 29a2402153dc95414dad8c833487e7dd18c8a222
Signed-off-by: Michaël Mattiello <mcm@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2022-05-19 11:13:51 +02:00
Dharmraj Jhala 23eac53911 [FIX] base: hide technical tips in settings view
In the settings view, we need to display the technical tip below the
setting header (h2 tag). For example, we display such tip under the
'Developer Accounts' header in social media settings.

However, when we search something in the settings, this tip is not
hidden. It happens because the hiding and showing parts of the settings
page are managed with js using some special classes or tags (like h2
tag, `.o_setting_box` class etc).

This commit fixes the issue by introducing a new class `.o_setting_tip`
specific for such technical tips, and with help of that we now hide or
show the tips based on the user search.

Note: We could have used .o_setting_box without any side-effect, but
rules linked to this class can be changed in the future and can mess
with layout of the technical tips. As those are usually small blocks of text
that give a hint to the user and not directly associated with setting box
styling, making the overall code more robust / flexible.

enterprise PR - https://github.com/odoo/enterprise/pull/25907

task-2810617

closes odoo/odoo#88117

Related: odoo/enterprise#25907
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2022-05-19 10:09:46 +02:00
Alexandre Kühn 8e2625c8ee [IMP] mail: introduce view models (step 9)
This commit introduces models that define records being 1:1 map with components,
as a step to move further to having essentially all business code in models.

Having code in models is desirable to have very maintainable code, thanks to
robust and declarative code with an ORM-like architecture.

Task-2831082

closes odoo/odoo#91698

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-05-18 23:54:39 +02:00
Alexandre Kühn 4439532138 [CLA] signature for Jigar Patel
closes odoo/odoo#91714

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-05-18 22:56:45 +02:00
Jigar Patel e1e32870a3 [IMP] mail: Allow to easily override message post data
Part-of: odoo/odoo#91714
2022-05-18 22:56:45 +02:00
imanie383 003ff45f75 [FIX] mail: new messages extra domain
A default MAX(id) was added in the extraDomain when there are no messages
to create it. This validation already existed but was omitted in the
refactoring - https://github.com/odoo/odoo/pull/57061

Current behavior before PR:

If there are no messageIds, the method loadNewMessages returns id > null
and this domain returns 0 records

https://github.com/odoo/odoo/blob/7d992af9561c499ef1912453f3b697bad18e441f/addons/mail/static/src/models/thread_cache/thread_cache.js#L55

Desired behavior after PR is merged:

Create the extraDomain with a default MAX(id) when there are no messages
to create it and continue with the normal flow of loadMessages

closes odoo/odoo#91701

X-original-commit: dad6595ab08ccacefa1373a3fc97a729907d7d32
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-05-18 22:56:40 +02:00
Nemael 3303afec66 [IMP] mail: improve o_MessageActionList design
Task-2793394

closes odoo/odoo#90893

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-05-18 22:56:33 +02:00
Nemael 546e0b823d [IMP] im_livechat: use ES6 syntax in legacy livechat files
Task-2825104

closes odoo/odoo#90625

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-05-18 22:56:29 +02:00
Jeremy Kersten cccd6eb01d [IMP] website[_event,_sale]: add plausible as Analytics solution
This commit add the way to specify the Plausible shared key auth token and
the plausible domain on your website to have the Plausible Dashboard integrated
in your Website > Dashboard > Analytics menu.

Some custom event are already pre-configured as:

Push an event 'Shop' on confirmation on ecommerce (with amount bucket +/- 50)
Push an event 'Lead Generation' on:
    'Thank you' page of contactus
    Confirmation of subscription for an event

From this way, the end user can just add a goal 'Lead Generation'
or 'Shop' on Plausible to have the Goal values visible.

closes odoo/odoo#91058

Related: odoo/documentation#2007
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-05-18 20:33:34 +02:00
Leonardo Pavan Rocha 3bec61a95b [IMP] calendar: improve day/year/month/year view selection
Instead of having 4 buttons to select a view in calendar, we start using a
dropdown button with the framework data-hotkey approach.

task-2704432

closes odoo/odoo#81705

Related: odoo/enterprise#23131
Signed-off-by: Arnaud Joset <arj@odoo.com>
2022-05-18 19:31:20 +02:00
Antoine Guenet b389313682 [FIX] web_editor: prevent traceback on reduce empty array
The mailing html converter uses the `reduce` method of `Array` to
compute column size when converting Bootstrap grids to tables. However,
if that array is empty, given that no initial value was passed, the call
caused a traceback. This is fixed by providing an initial value of zero
as should be expected.

task-2853723

closes odoo/odoo#91683

X-original-commit: 4504d1a880032829fb46dbdeab996bd4e0f9ee97
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-05-18 17:09:51 +02:00
William Braeckman b15206ad5d [FIX] hr_holidays: exclude cancelled time off by default in report
Prior to this commit cancelled time off were included in the leave
report calendar model and were shown as regular time offs.
They will now be hidden.

closes odoo/odoo#91675

X-original-commit: c8d17c760e27736d0cb809b59e9945f808b1138e
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-05-18 17:09:48 +02:00
Florian Charlier 64ca512233 [FIX] website_slides: fix sign in/buy from quiz for non-members
When a non-logged in visitor tried to validate answers on a quiz page but had
not answered all questions, the button seemed unresponsive.
In fact, the place was not there to show the error message; likely introduced
by 4a329da6a0.

However, instead of restoring the error message for this corner-case, we
considered it was acceptable to change the behavior a little and not block the
visitor who'd like to sign-in/join at this point, as the validation of the quiz
will still be blocked if not all questions are answered with an error message.

Also, as the quiz does get validated when the button is used even though
the user is not yet logged in, it makes sense to also label it 'Join & Submit'
instead of only 'Sign-in'.

Task-2821644
Part of Task-2663320

closes odoo/odoo#91674

X-original-commit: 1e568dab391db809235615a3a2b0dbe3fabc97cc
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2022-05-18 17:09:44 +02:00
Aaron Bohy ab4322699d [FIX] mail: can save/discard suggested recipient dialog
Since the migration from owl1 to owl2, a crash occured when clicking
save or discard in the partner dialog opened from mail composer's
suggested recipient.

This commit fixes the issue by simplifying the way we open that
dialog. With owl2, we introduced a standaloneAdapter which allows
to directly instantiate legacy dialogs inside owl components.

Task 2817547

closes odoo/odoo#91671

X-original-commit: 0c397eacb8784e2a127b1371f3e787dbccbda068
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-05-18 17:09:40 +02:00
Manisha Tulsiyani 849c5e128b [FIX] project: fix tags filtering based project for mobile view
Before this commit, when we click on the tag field in mobile view
it will display all the tags because in mobile view it will open
the kanban view on click of m2m field so 'search_read' called
instead of '_name_search'.

So in this commit, fixes the issue by applying the same filter
domain in search_read.

task-2790019

closes odoo/odoo#91670

X-original-commit: f23089f1fc14852fdd67916d38881746b15ebd19
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-05-18 17:09:36 +02:00
Brieuc-brd 522548f4ad [FIX] mail: ChatWindow hidden in mobile
The commit 6bf4d3cdceeb972733c1f680f2ad8a11495e6e9c
introduces an issue where the ChatWindow was hidden by the MessagingMenu
in mobile.

This commit fixes this issue.

task-2857078

closes odoo/odoo#91665

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-05-18 17:09:32 +02:00
Adrien Widart eaeafa92b5 [FIX] mrp: freeze time for the BoM tests
In some cases, `test_replenishment` fails "for no reason".

Two notions are needed to understand the issue:
The class of the method `test_replenishment` is a `TransactionCase`. So,
once initialized, a SQL transaction is started and is the same for all
tests:
https://github.com/odoo/odoo/blob/3d9a835379d07142748a366285894a5d0f6ded71/odoo/tests/common.py#L693-L696
Also, in a SQL request, the method `now()` does not really return the
current date:
> Notice that NOW() and its related functions return the start time of
the current transaction. In other words, the return values of the
function calls are the same within a transaction.
(https://www.postgresqltutorial.com/postgresql-date-functions/postgresql-now/)

So, suppose it's the end of day D01 and we start all the tests of the
class `TestBoM`. A SQL transaction is created and the tests are executed
one by one so it takes time: it is now the next day D02 and
`test_replenishment` is executed. At some point, it leads to:
https://github.com/odoo/odoo/blob/9ca9bcc51fa289ddb0548f81a795755d196e31ca/addons/stock/models/stock_orderpoint.py#L328-L333
i.e., we are reading the report `'report.stock.quantity'` at date
"`today()` + 3 months", which means "D02 + 3 months". However, the
report is a SQL view and is defined on an interval of "today +- 3
months". Here is the issue: we use `now()` to get the value of today.
For instance:
https://github.com/odoo/odoo/blob/2f0ad2c150e65806c5f0f3ca66f702cc74619074/addons/stock/report/report_stock_quantity.py#L96-L104
As explained above, `now()` returns the start time of the current
transaction: D01. Therefore, the report is defined until D01 + 3 months.
As a result, D02 + 3 months is outside of the range, the `read_group`
does not return anything, there isn't any need and the orderpoint is not
created -> the test will fail.

closes odoo/odoo#91602

X-original-commit: f3e4eeb8412fba5ee36679eece4cba9f51df543d
Signed-off-by: Arnold Moyaux <arm@odoo.com>
2022-05-18 17:09:22 +02:00
Yannick Tivisse 73664cfcd9 [ADD] data_recycle: Add tool to recycle old records
Purpose
=======

This commit brings a new community application to allow recycling
automatically/manually the existing records. Here is some business
examples that could be achieved using this tool:

- Delete all livechat sessions without any messages for more than
  1 week.
- Archive all tasks on a given support project that are in Cancelled
  stage for more than 2 years.
- Delete all applications that we refused 6 months ago.

The tools allows to delete/unlink spotted records based on a widget
domain (stage.name='Cancelled') and temporal fields (last_stage_update
is passed since 2 years). Either the recycling is done automatically
by a cron, or a notification report is sent to specified users letting
them know how many untreated records have been found.

This application is regrouped with the enterprise features of
data cleaning and data merging under the same application set.

closes odoo/odoo#89312

Taskid: 2827911
Related: odoo/enterprise#26568
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-05-18 17:09:17 +02:00
Yannick Tivisse 3edefbbf5d [ADD] privacy: Add privacy lookup / management tool
Purpose
=======

This commit brings a new tool to retrieve all the related pieces
of information about a customer, based on his name and/or email
address.

This could be useful for users who want to apply the right to be
forgotten (for example under the GDPR regulation), or simply to
retrieve all the records linked to someone (leads, contracts,
sales orders, ...).

The tools is actually a wizard, available from the contact/user
form view. The 2 main steps are the following:

1/ Lookup: We search all the references of the contact by scrapping
   the existing models, either if his email address is written on a
   supposedly email field, or if his name is written into a record
   rec_name (aka name of a lead), or also if there is a M2O to a
   res.partner that matches the email address or the name (For
   readability purposes, we exclude the ondelete=cascade fields as
   the record will be dropped with the contact itself.

2/ Management: For each one of the occurences, we display a line on
   the wizard for which we allow 3 actions: Open the record, Archive
   (if possible), Delete. Each time an action is performed that
   altered the record itself, a anonymized log (jean.luc@example.com
   becoming j***.l**@e******.com) is created/adapted for history
   purposes.

Taskid: 2827911
Part-of: odoo/odoo#89312
2022-05-18 17:09:17 +02:00
Aurélien Warnon 5a4521b70b [FIX] website_livechat: fix chatbot tour nondeterministic issue
Followup of: 623fdb15ce9a6f3f586254dca549a72869336729

The previous attempt at fixing the tour issue was non-conclusive as it still
breaks occasionally during runbot nightly builds.

That issue is near-impossible to properly debug, because it *only* happens
during nightly builds (cannot be reproduced locally and cannot be reproduced
with a multi-build configuration on the runbot).

We decided instead to slightly modify the tour step to click on the
"restart button" from the end of the conversation instead of the restart button
from the chat window header.

This should hopefully do the trick.

closes odoo/odoo#91656

X-original-commit: 50044dc7f547e2fcd7416f725987236b6185e6d6
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2022-05-18 16:05:00 +02:00
Miquel Raïch 904d430aa5 [FIX] account: draft move lines shouldn't be marked as reconciled
closes odoo/odoo#91655

X-original-commit: fe8010d98dc6d589aca65571beb7f9eadfdd9a3b
Signed-off-by: William André (wan) <wan@odoo.com>
2022-05-18 16:04:56 +02:00
Laurent Smet d849155c14 [FIX] account: Fix the register payment wizard in multi-currencies
- Create an invoice of 1200 MXN = 300 USD
- Register a payment, select USD at a date at which 1200 MXN = 400 USD
=> The amount is incorrect, a difference is computed but it should be zero.

closes odoo/odoo#91634

X-original-commit: d88f630dcb7f98a45c9efe7f2439a8732832c77c
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
2022-05-18 16:04:49 +02:00
Manisha Tulsiyani 0b75ae6adb [FIX] hr_timesheet: removed future entry in demo data
Before this commit, when doing the same project entry five times
that does not set the default value of project in timer header
of the timesheet because the demo data contains the future timesheet
entry with different project_id and timesheet entry are order by date.

So this commit fixes the issue by removing the future entry
from the demo data so that selecting the same project entry
five times, set the value of project as default

task-2790019

closes odoo/odoo#88431

Related: odoo/enterprise#26090
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-05-18 14:53:53 +02:00
Barad Mahendra 8fa85a6871 [IMP] project: improve empty help content for activity type
Purpose of the commit is to improve the empty help content
on activity type menu.

task-2737428

closes odoo/odoo#83877

Related: odoo/enterprise#23953
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-05-18 14:53:46 +02:00
Nicolas (vin) e8f8b93bd1 [FIX] base: don't assume res_ids is a list
https://github.com/odoo/odoo/pull/85150 introduced the method
_render_qweb_pdf_prepare_streams called from _render_qweb_pdf
giving it its res_ids.
Two places in this method are assuming res_ids will be a list, but
it is not always the case. Plenty of call to _render_qweb_pdf is
giving it a single id as a parameter.

This will ensure that res_ids is a list by creating one for single ids
too before proceeding with the logic of the pdf rendering.

closes odoo/odoo#91631

Signed-off-by: Laurent Smet <las@odoo.com>
2022-05-18 13:08:26 +02:00
tsm-odoo 52d6089e1a [IMP] mail: replace env.browser by wowl browser
This PR prepares the ground for the one introducing the new environment in the discuss app.
Indeed, switching from `env.browser` to the wowl `browser` makes a lot of noise in the main
PR. In order to reduce this noise, this change is done now.

task-2582313

closes odoo/odoo#91622

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-05-18 13:08:22 +02:00
Brieuc-brd 2ad762a04f [REF] mail: RtcVideo, review and simplify scss
Part of the overall v16 SCSS optimization/restyle, task-2704984

task-2855977

closes odoo/odoo#91559

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-05-18 13:08:18 +02:00
abd-msyukyu-odoo 5b4904857b [FIX] knowledge: restore web_editor.backend style
- What is Broken ?

The file `web_editor.backend.scss` was incorrectly removed for every module by
the Knowledge `__manifest__`.
i.e.: The iframe in mass_mailing became too small, breaking the mailing preview.

- Fix

The file is restored.

Task-2853336

closes odoo/odoo#91385

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-05-18 13:08:14 +02:00
Leonardo Pavan Rocha 39260d2896 [IMP] hr_holidays: add hr_holidays tour
Adds a tour for showing the main process of requesting a time-off.

task-2760450

closes odoo/odoo#87108

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-05-18 13:08:05 +02:00
Sébastien Theys 2825af7623 [IMP] mail, test_discuss_full: only return ids of public partners
Other data are not actually used. This will improve performance a bit (less
queries, less data to return) until the need to return this list goes away (it
requires a bigger refactoring).

task-2847983

closes odoo/odoo#91576

X-original-commit: 61e472aa35ac825553144fd9a80fbf62e3e8b5e1
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2022-05-18 12:00:46 +02:00
Dossogne Bertrand 008d57da77 [IMP] hr_recruitment: Fix job kanban view
Fixes a display issue in the hr.job kanban view with the content not extending to the card size on narrower devices.

TaskID #2849413

closes odoo/odoo#91428

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-05-18 12:00:41 +02:00