Commit Graph
151539 Commits
Author SHA1 Message Date
Victor Feyens d9a9e496b7 [IMP] core: translation improvements
* use the latest translation API (with fallback on english text if
translation doesn't include expected placeholders)
* indent/split translations to avoid excessive line lengths

closes odoo/odoo#91743

Signed-off-by: Julien Castiaux <juc@odoo.com>
2022-05-19 23:16:46 +02:00
Victor Feyens 2296e1e216 [IMP] core: only translate what's needed
There is no need to translate 4 error messages if only one is used.

To do so, use the tooling dedicated to lazy translations.

Part-of: odoo/odoo#91743
2022-05-19 23:16:46 +02:00
dbkosky 9222d6c6ad [FIX] l10n_it_edi: fix codicedestinatario foreign pa index
The pa index should only be XXXXXXX when the foreign partner is not
identified. In this commit we change the condition on the template such
that if the pa index is defined, we always utilise it. If the pa index
is not defined but the partner is italian, we use '0000000', and when it
is not defined and the partner is not italian, we use 'XXXXXXX'.

closes odoo/odoo#91871

Task-id: 2858092
X-original-commit: bf468affa2d86967b3b63a0be62063061b7b263c
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Daniel Kosky (dako) <dako@odoo.com>
2022-05-19 22:20:30 +02:00
Joakim Weckman 844eee4119 [CLA] Update sprintit CLA members
closes odoo/odoo#91863

X-original-commit: 1ba522a5d79e6a40158f76473c681543e4bb6cff
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-05-19 22:20:26 +02:00
jbw c648f0727a [FIX] account: fix zero division when unreconciling caba exch diff
Add move_reverse_cancel=cancel back to context when reconciling moves with reverse moves.

Bug introduced in commit https://github.com/odoo/odoo/commit/e9262bfc8c775953ebe150f36ce0ab8dcb04d4bd

Database : Reproducible in v14, v15
On a Mexican company (with l10n_mx) with multi currencies enabled.
- Set rates for USD to be different at invoice and at payment date
- Create an invoice at date 1 in USD
- Create a payment at date 2 in USD for invoice generating a difference exchange move
- Try to reset the payment to draft
-The traceback (ZeroDivisionError: float division by zero) will appear.

Tickets : 2857549, 2856162, 2855038, 2852663, 2852859, 2857381

closes odoo/odoo#91841

X-original-commit: 7be0fc1d611d54f27ebd7e7b1fef9b1842cc9ae2
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: de Wouters de Bouchout Jean-Benoît (jbw) <jbw@odoo.com>
2022-05-19 21:16:48 +02:00
Pierre Paridans 90e65f9762 [FIX] web: <details> visiblity check regression in Chromium 97+
Since Chromium 97, folded `<details>` content has non-zero computed
width and height which returns false-positive QUnit
`assert.isNotVisible()` calls.

In a nutshell, this was introduced in https://bugs.chromium.org/p/chromium/issues/detail?id=1185950
when Chromium implemented the ability for "Find in page" to search in folded
`<details>`. To do so, the `content-visibility` rule was used instead of
`display: none` which, even if functionally similar, has an impact on the
values returned by `getBoundingClientRect()` (i.e. used in
`assert.isNotVisible()`.

A regression report was filled in https://bugs.chromium.org/p/chromium/issues/detail?id=1276028
to highlight this change of behavior. What emerged from this report's
discussion is that Chromium has no intent to revert this change and
instead put the emphasis on avoiding to use `getBoundingClientRect()`
and similar methods for visibility check (even pushing a proposal for a
`Element.isVisible()` API; cf. https://github.com/w3c/csswg-drafts/issues/6850).

This commit works around this issue by forcing the content to `display:
none`, like in the previous Chromium versions.

closes odoo/odoo#91833

X-original-commit: b718e7eb5ceb827f59ac395577408b7bc54aa3f9
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2022-05-19 19:04:59 +02:00
Ivan Yelizariev 08605c506e [FIX] website: make search by "Visited Pages" work again
Field `website.visitor::page_ids` was storable initially [1], but then it was
refactored [2] and hence the search by "Visited Pages" [3] became broken.

Fix it by adding `search=` attribute

[1]: https://github.com/odoo/odoo/commit/6bec0e4d29e6b33b74962b2893a7a405667ef58c
[2]: https://github.com/odoo/odoo/commit/e33172e83210a5e0044a6fb92e315b84deefc440
[3]: https://github.com/odoo/odoo/blob/c6c7605cdae803aca4f441ef4e622a1b79f17019/addons/website/views/website_visitor_views.xml#L248-L257

opw-2622141

closes odoo/odoo#91829

X-original-commit: 792e07b8ff43ecb0499f4add27f5465c28e716cf
Signed-off-by: Ivan Elizaryev (iel) <iel@odoo.com>
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-05-19 19:04:55 +02:00
Fabrice Henrion f2650a724b [FIX] account: improve terminology
closes odoo/odoo#91729

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-05-19 18:06:13 +02:00
Rohitkumar (roku) 4a8f31e25f [IMP] project,sale_timesheet: generic UX improvement for project
Purpose of this commit to improve generic usage of project
app.

So, in this commit done following changes:
  - change the placeholder of the name to 'e.g. Monthly review' in
    project_update_view_form
  - set the 'analytic account' of the project on the tasks by default
  - change the placeholder to 'e.g. Product Launch' in project_milestone_view_form
  - the 'cabinets' milestone should be linked to a milestone service,
    not a manual one so change data to milestone in demo data
  - rename the 'rating' stat button into 'last rating' in view_task_form2
  - set another employee than Mitchell for the 'customer care (prepaid hours)'
    SOL field in sale_service_demo_data
  - display a separator on the right of the stat button so remove unwanted
    properties in project_rightpanel.scss
  - add the 'name' field to the 'fields to export' when 'i want to update data'
    is set to true
  - remove the 'Getting Things Done (GTD)' example from kanban examples wizard
  - add a 'tasks due today' filter that should return tasks whose deadline falls on
    today's date in view_task_search_form

task-2809188

closes odoo/odoo#88271

Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-05-19 18:06:09 +02:00
Victor Feyens 0f2bea1e88 [IMP] core: minor improvement in populate cli
closes odoo/odoo#85537

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-05-19 18:06:05 +02:00
Victor Feyens 695ab84f63 [IMP] core: allow profiling & rollback of models population
Profiling: creation of ir.profile records for each models population
Rollback: allow triggering multiple times the same population,
without any risk of records conflicts (& having to recreated a clean database)

Note: those two options are mostly recommended for small models population.
Indeed, profiling slows down the population, and large/medium population is
already quite slow for some models (and it seems that the rollback breaks as well
for some advanced models).

Part-of: odoo/odoo#85537
2022-05-19 18:06:05 +02:00
Adrien Widart c7072eaba6 [FIX] stock: compute forecasted inventory with inter-wh
When moving some products between two warehouses thanks to an internal
transfer, the forecasted inventory becomes incorrect

To reproduce the issue:
1. In Settings, enable "Multi-Warehouses"
2. Let WH01 be the existing warehouse. Create a second one WH02
3. Create a storable product P
4. Update the quantity of P:
    - 3 in WH01/Stock
5. Create a planned and internal transfer T:
    - Source: WH01/Stock
    - Destination: WH02/Stock
        - Ignore the warning
    - Operations:
        - 1 x P
6. Mark T as todo
7. Open the Forecasted Inventory:
    - Filters:
        - Forecasted Stock
        - Product: P
    - Group By: Warehouse

Error: The report is incorrect, it says there are 3 P in WH01 and 0 in
WH02 (should be 2 and 1). It becomes worst if T is done (the quantities
in the past become incorrect)

We should be able to move a product between two warehouses thanks to an
internal transfer (so the warning of the step 5 should be removed).
Moreover, the `report.stock.quantity` should consider that use case.

When processing a stock move, the SQL view translates it as an in-move
or out-move for a specific warehouse. For instance, if the SM comes from
a warehouse and goes to a location without any warehouse (e.g., customer
location), the SM is considered as an out-move. But here is the issue:
in case of an inter-warehouse SM, both source and destination have a
defined warehouse.

Therefore, we need to:
- Duplicate the inter-warehouses SM (so we have one in and one out)
- Fake the values (no destination warehouse for the out move, no source
warehouse for the in move)

Also, before duplicating all SM, we filter out some useless SM:
- Draft and cancelled ones
- SM done more than 3 months ago (because the report only works for [-3
months; +3 months])

Considering some tests:
(SM are confirmed. Each test has been repeated 5 times to get an
average)
|                                       |          |
|:-------------------------------------:|:--------:|
| 5000 SM, 0% inter-wh, without the fix |  ~715 ms |
| 5000 SM, 0% inter-wh, with the fix    |  ~710 ms |
|                 Impact                |   0.99x  |
|                                       |          |
| 6666 SM, 0% inter-wh, without the fix |  ~911 ms |
| 5000 SM, 33% inter-wh, with the fix   |  ~999 ms |
|                 Impact                |   1.10x  |
|                                       |          |
| 7500 SM, 0% inter-wh, without the fix | ~1004 ms |
| 5000 SM, 50% inter-wh, with the fix   | ~1097 ms |
|                 Impact                |   1.09x  |

The impact is not that significant

OPW-2752017
task-2822157

closes odoo/odoo#91772

X-original-commit: b1efc0243bbf886bbef42a32587f4a818fa34e64
Signed-off-by: Arnold Moyaux <arm@odoo.com>
Signed-off-by: Adrien Widart <awt@odoo.com>
2022-05-19 16:40:23 +02:00
Jérémy Hennecart (jeh) 98bb94beef [FIX] website_slides: fix void answer tags at creation
When creating a quiz, the answers were not displayed in the
many2many_tags and void tags were displayed.
This commit ensures that the answers is always displayed even
if the record is not yet created.

task-2849896

closes odoo/odoo#91770

X-original-commit: d9223a280ad386e671359a9633efddf424b371d6
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2022-05-19 16:40:19 +02:00
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