Commit Graph
152334 Commits
Author SHA1 Message Date
hieu 19549afdfc [FIX] project: fix access error when internal user access to project
form

Before this commit, when the internal user without any access rights to
the Project app and has a link to access to the form view of a "public"
project, an access error is occurred when that user when to access to
the
project form view. The reason is the `project.collaborator` is only
accessible to the user with an access right to the Project App and since
the number of collaborators displayed in a stat button is computed with
the access rights of the current user, the compute cannot be done for
the
internal user.

This commit executes the compute is superuser to prevent the user having
access error and to correctly access to the project form view as before.

Steps to reproduce the bug:
--------------------------
1) Create a Project P and add *Marc Demo* in the followers of that
project
   if the Privacy Visibility is "Invited internal users".
2) Remove the access rights to the Project app for *Marc Demo* user.
3) Copy the link to the form view of project P.
4) Log in as *Marc Demo*.
5) Paste the link copied in step 3 to access to the form view of project
P.

Actual Behavior:
---------------
An access error is occurred because the user without any access to the
Project app cannot access to the `project.collaborator` model.

Expected Behavior:
-----------------
The internal user without any access rights to the Project App should
access
to the form view of the project P.

closes odoo/odoo#96497

X-original-commit: c725c3fbb29eff49eff3794aff9d407175599e63
Signed-off-by: Xavier <xbo@odoo.com>
2022-07-21 12:29:47 +02:00
Nshimiyimana Séna 901c9521e2 [FIX] crm: duplicate 'lost' button on a lead's form view
Currently,  two lost buttons will appear, if you go to the form view of a lead that has 100% probability. The difference between the two duplicated "Lost" buttons is that one ask for a "lost reason" before marking a lead/opportunity as lost, the other does not.

After discussing with the PO for CRM, it appears that the button that asks for a "lost reason" should not appear on a lead. This commit makes the necessary changes to reflect that behavior.

opw-2886623

closes odoo/odoo#96486

X-original-commit: 707bddefdc5604db3304afa3633a0b90027f78b4
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Nshimiyimana Serge Séna (sesn) <sesn@odoo.com>
2022-07-21 11:20:49 +02:00
Dieter Reinert 9946c252d6 [CLA] signature for DieterReinert
closes odoo/odoo#95074

X-original-commit: 4ec9769eb177593daea6dba417da813158f5ba64
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-07-21 11:20:46 +02:00
Géry Debongnie 23caf8b96f [IMP] web: update owl from 2.0.0-beta-12 to 2.0.0-beta-14
Release notes:

https://github.com/odoo/owl/releases/tag/v2.0.0-beta-14

Details:

- [FIX] compiler: better handle update of properties with same value

closes odoo/odoo#95804

Related: odoo/enterprise#29350
Signed-off-by: Samuel Degueldre <sad@odoo.com>
Signed-off-by: Géry Debongnie <ged@odoo.com>
2022-07-21 10:19:42 +02:00
Samuel Degueldre bebc565269 [FIX] web: m2oautocomplete in some weird cases
Part-of: odoo/odoo#95804
2022-07-21 10:19:42 +02:00
Joseph Caburnay 6107e07971 [IMP] point_of_sale: automatically validate the order if fully-paid
Only when the total payment is exactly the order's total price.

closes odoo/odoo#93694

Related: odoo/enterprise#28433
Signed-off-by: Masereel Pierre <pim@odoo.com>
2022-07-21 09:15:46 +02:00
Hubert Van de Walle (huvw) 96c2716674 [FIX] stock: history back on the forecast report
Steps to reproduce:

  - Go to stock > Replenishment
  - Click on a forecast report widget
  - Go back using the browser arrows
  -> The page is redirected to another forecast report and the
  breadcrumbs are cleared

Cause of the issue:

  The forecast report action uses the `window.history.pushState` to
  add the active model in the url.
  When going back, the new url is the same one but without the active
  model.
  We can get the correct behavior by doing `window.history.go(-2)` in
  the console.

Solution:

  Use `history.replaceState` instead

opw-2917725

closes odoo/odoo#96487

X-original-commit: b39dc5488bacb704aaa60f1a502bf005d57f3276
Signed-off-by: Steve Van Essche <svs@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2022-07-21 01:53:47 +02:00
Hubert Van de Walle (huvw) c21101c161 [FIX] account: mobile: unable to add lines to misc journal
Steps to reproduce:

  - Load odoo on a small screen / mobile phone
  - Go to accounting > Miscellaneous Operations
  - Click on create
  -> The button to add a line in Journal Items is missing

Cause of the issue:

  On mobile, the kanban view is used for Journal Items
  The kanban view used [0] has an attribute `create="false"`

Solution:

  Override the `create` attribute when the kanban view is a subview

[0]: https://github.com/odoo/odoo/blob/93520cc291ffb76dd1425e413f29653df37b4062/addons/account/views/account_move_views.xml#L94

opw-2870637

closes odoo/odoo#96484

X-original-commit: 31ac34816e61d66479dbd11ebb9c5348c3f12886
Signed-off-by: Christophe Simonis <chs@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2022-07-21 01:53:44 +02:00
William Braeckman 11938424c3 [FIX] website_sale: prevent adding archived products to cart
Prevents adding archived products to the cart.

TaskId-2925397

closes odoo/odoo#96483

X-original-commit: 623014802e643e19eb61966c5f639e2b04ff9e81
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-07-21 01:53:41 +02:00
William Braeckman 42f0dd02ae [FIX] website_sale: fix test_05_google_analytics
This commit increases the timeout for some steps in the
`google_analytics_view_item` tour.
The step would time out semi-regularly due to a timeout.

TaskId-2925407

closes odoo/odoo#96454

X-original-commit: 8e6eae7b2a3e6da195e4283a008a14d8296539b4
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-07-21 01:53:35 +02:00
Alexandre Kühn ac39fe6768 [MOV] im_livechat, *: Refactor JS Public Livechat (step 8)
*: website_livechat

This commit is a step towards refactoring the JS of public livechat,
so that it reuses the same architecture as the code of Discuss.
This implies code that uses JS models and OWL components.

Task-2925850

closes odoo/odoo#96447

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-07-21 01:53:32 +02:00
Alexandre Kühn 8840b37989 [IMP] im_livechat, *: Refactor JS Public Livechat (step 8)
*: website_livechat

This commit is a step towards refactoring the JS of public livechat,
so that it reuses the same architecture as the code of Discuss.
This implies code that uses JS models and OWL components.

Task-2925850

Part-of: odoo/odoo#96447
2022-07-21 01:53:32 +02:00
Nguyen Hong Quang 53ebbf92b4 [FIX] web: fix ratio in many2many_avatar widget
Currently in many2many_avatar widget, image shrink with that container,
make avatar user looking weird. Specially with vertical portrait image
and 1:1 ratio image.

This PR will fix this kind of bug UI.

closes odoo/odoo#96439

X-original-commit: 486b7f92318e64242613a07ea5ff365748dd713b
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-07-21 01:53:28 +02:00
Nicolas Bayet 3cc0fb8339 [FIX] web_editor: style qweb element in odoo editor
Before this commit, the styles for the qweb elements
(t, t-if, t-out, ...) were not applied.
This commit apply them except when converting html to inline
styling.

task-2892193

closes odoo/odoo#96433

X-original-commit: 4cc40661ed3287e15ea21cedf8e2a582e32be5c8
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-07-21 00:50:45 +02:00
Arnaud Joset 144377a016 [FIX] web: remove duplicated key in calendar view
https://github.com/odoo/odoo/commit/57dbfff2db9053276a293d9a20bd8636f10100cc introduced a duplicated key
in calendar view.

closes odoo/odoo#96426

X-original-commit: 4560beab43571454439a932c5f27082254104283
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Arnaud Joset <arj@odoo.com>
2022-07-21 00:50:42 +02:00
pedrambiria 8b6341c1ff [REV] google_calendar: not sending emails to existing event attendees"
There was an issue with this fix.

This reverts commit 8ebb44420c3e2dcc0d990d2646486654b4b2955d.

closes odoo/odoo#96421

X-original-commit: 29f0c7635c900324631fe3562399c3ced5bc15f7
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-07-21 00:50:39 +02:00
Simon Genin (ges) aba9f9d25b [FIX] base: restore partner's kanban badge hover effect
This commit fixes the background/text color inversion when hovering the
badge in the Partner's Kanban cards.

This was due to the missed conversion of `.badge-pill` class in BS5,
which removed it in favor of the more generic `.rounded-pill`. For
simplification, the selector is adapted to the more generic `.badge`
(independantly to its form).

closes odoo/odoo#96360

Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2022-07-21 00:50:23 +02:00
tsm-odoo fdce32d186 [IMP] mail: legacy activity menu to wowl registry
To prepare for the introduction of the ActivityMenuContainer Component,
let's  make the ActivityMenu widget use the systray registry.

closes odoo/odoo#96341

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-07-21 00:50:17 +02:00
FrancoisGe 8746ffdc13 [FIX] web: use OnboardingBanner as default banner
Before this commit, the List and Kanban views did not allow the use of
a Banner without adding it in the View definition.

Like this:
```
export const listView = {
    ...
    Banner: OnboardingBanner,
    ...
}
```

Now, we use by default OnboardingBanner as Banner if no other has been
defined in the View definition.

closes odoo/odoo#95945

Related: odoo/enterprise#29452
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-07-21 00:50:05 +02:00
FrancoisGe 5ee62cc927 [FIX] web: rename pluck to pick
Name error, the implementation of pluck is the pick function. So we will
rename the pluck function to pick.

Part-of: odoo/odoo#95945
2022-07-21 00:50:05 +02:00
Yannick Tivisse 8cf83ad9ee [IMP] requirements.txt: Add cryptography library
Installed by dependency with another lib, but the version 3.4.8 is
required to sign the DmfA declaration.

closes odoo/odoo#95495

Related: odoo/enterprise#29192
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-07-21 00:50:00 +02:00
Odoo's Mergebot cc788e05ab [MERGE] project: improve burndown chart performance
Purpose of this PR
===============

The Burndown Chart report was very slow on big databases as it was not
possible for Postgresql to optimize the query as it was based on a view
that was using several generate series.

This commit aims to improve the performance by injecting the constraints
at a lower level than it was in the past, lowering the amount of data
processed in the higher level of the query.

/!\ Important note
------------------

Overwriting the `read_group_raw` is really not a good practice and should
be avoided in most case. If you fall on this implementation by grepping
the source code, please be advised that this is not the right way of doing
things.

Implementation details
----------------------

- The report is now run by generating the `SQL` that is executed by the
  `read_group_raw`. This allows inserting `SQL` constraints at a lower
  level and simnifically improves performance. As there is no other way
  to do it, the code is unfortunately a modified copy of the actual
  `read_group_raw`.
- The pivot view has been removed as it had no meaning and was creating
  confusing data.
- The `Group By` menu has been limited to `stage_id` and `date` as bringing
  more data trough the different `GROUP BY` statements up to the higher level
  is costly. Further more, additional `Group By` did not bring added value
  as the Chart was less readable.
- The JS code has been adapted in order to force a group by both `stage_id`
  and `date` so that the date displayed is always making sense.
- The sort ascending and descending options have been removed as creating
  confusing data.
- The compare with previous period has also been removed as the chart only
  really make sense when seen chronologically.
- A lot of tests have been added in order to ensure that changes that would
  be harmful for the report will trigger test fails.

task-2845729

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

closes odoo/odoo#93225

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-07-21 00:49:54 +02:00
William Braeckman 57a1776c36 [IMP] website_sale: allow using alternative products in dynamic snippet
With this commit we replace the current way to show alternative
products with a new option on the dynamic snippets.

Instead of having alternative products show up on all products if the
option is enabled, it will now be on a per product (template that is) basis
using the dynamic product snippet.

TaskId-2695187

closes odoo/odoo#85189

Related: odoo/upgrade#3277
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-07-21 00:49:46 +02:00
William Braeckman c91c2712a1 [FIX] website_sale: fix dynamic product snippet
Since "website in backend" the dynamic product snippet on product pages
did not work at properly due to not being able to do a jquery find
inside of an iframe, making context dependent product filters such as
"alternative products" (which will become a dynamic snippet filter) not
show up as an option.

TaskId-2695187

Part-of: odoo/odoo#85189
2022-07-21 00:49:45 +02:00
Laurent Stukkens (LTU)andYannick Tivisse ac7cd0e874 [IMP] project: improve burndown chart performance
Purpose of this commit
======================

The Burndown Chart report was very slow on big databases as it was not
possible for Postgresql to optimize the query as it was based on a view
that was using several generate series.

This commit aims to improve the performance by injecting the constraints
at a lower level than it was in the past, lowering the amount of data
processed in the higher level of the query.

/!\ Important note
------------------

Overwriting the `read_group_raw` is really not a good practice and should
be avoided in most case. If you fall on this implementation by grepping
the source code, please be advised that this is not the right way of doing
things.

Implementation details
----------------------

- The report is now run by generating the `SQL` that is executed by the
  `read_group_raw`. This allows inserting `SQL` constraints at a lower
  level and simnifically improves performance. As there is no other way
  to do it, the code is unfortunately a modified copy of the actual
  `read_group_raw`.
- The pivot view has been removed as it had no meaning and was creating
  confusing data.
- The `Group By` menu has been limited to `stage_id` and `date` as bringing
  more data trough the different `GROUP BY` statements up to the higher level
  is costly. Further more, additional `Group By` did not bring added value
  as the Chart was less readable.
- The JS code has been adapted in order to force a group by both `stage_id`
  and `date` so that the date displayed is always making sense.
- The sort ascending and descending options have been removed as creating
  confusing data.
- The compare with previous period has also been removed as the chart only
  really make sense when seen chronologically.
- A lot of tests have been added in order to ensure that changes that would
  be harmful for the report will trigger test fails.

task-2845729

Co-authored-by: Yannick Tivisse <yti@odoo.com>
2022-07-20 15:57:32 +02:00
Laurent Stukkens (LTU) 4faeff02c7 [IMP] project: prevent test_delete_project_with_task to be run several times
Prior to this commit, `test_delete_project_with_task` is part of `TestProjectCommon`
which is inherited in several tests. Because of that, `test_delete_project_with_task`
is run several times, which is not relevant.

This commit moves the tests into a new class in order to prevent it to be run
several times.

task-2845729
2022-07-20 15:23:54 +02:00
Laurent Stukkens (LTU) 86b683bb38 [FIX] web: add hideCustomGroupBy option
Prior to this commit, it was not possible to hide the 'Add Custom Group'.
This commit adds this feature and associated tests. Hiding this menu entry
 can now be performed by adding `hideCustomGroupBy: false` in the `View`.

This commit also uses `MAPPING`  values in the components assignment of
`ControlPanel` in order to improve code maintenance.

task-2845729
2022-07-20 15:23:54 +02:00
Romeo Fragomeli 67add2bab3 [FIX] sale: fix layout of button
Since BS5 the `btn-block` don't exist anymore, we replace it with
CSS grid (`d-grid`) on the parent to take all width available.

Ref:
https://getbootstrap.com/docs/5.1/migration/#buttons

closes odoo/odoo#96358

Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2022-07-20 10:59:08 +02:00
Goffin Simon 24c05db8b8 [FIX] project: Deadline not reset when task is closed
Steps to reproduce the bug:

- Let's consider a project P with 2 stages S1 and S2 where S2 is a closing stage
- Create a task T in P and set T in S1 with a deadline in the past
- Pass T to S2

Bug:

T was still appearing when selecting the filter Late tasks

opw:2900663

closes odoo/odoo#96308

X-original-commit: a88611e634ca74478308c274e43ea0de0d4716b2
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-07-20 10:59:04 +02:00
MAHAMADASIF ANSARI 3bf88fcf79 [IMP] {fetch}mail, google_gmail, microsoft_outlook: merge fetchmail into mail
The `fetchmail` module is build on top of the `mail` module and enables
the incoming email capabilities. However, using the `mail` without
incoming email server is not a good use case.

This commit merges the `fetchmail` moudule into `mail` and lessens the module
complexity, along with adapting the xml/external ids in the dependent modules.

task-2797458

closes odoo/odoo#94143

Related: odoo/upgrade#3615
Related: odoo/enterprise#28659
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-07-20 10:58:56 +02:00
Umesh Gupta 5f8474429d [IMP] mail: improve mail notification template layout
In this task, we modified the template layout to match the other
mail notification template  and make it compatible with Outlook.

closes odoo/odoo#92847

Taskid: 2791286
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-07-20 10:58:50 +02:00
pedrambiria eb007f9d3b [FIX] point_of_sale: fix calling set_quantity_by_lot function
There is a mistake in forward-port of this PR (8cfc2bdcadff72bee9400c8893677d35e551b92d)
on version saas-15.2 (007e7e1563b89ebd2eef51e48303a5af1348d024).

This is the traceback when using the lot number in PoS:

	TypeError: this.pack_lot_lines.set_quantity_by_lot is not afunction at Proxy.setPackLotLines (https://17609393-saas-15-2-all.runbot70.odoo.com/web/assets/1996-322b17a/point_of_sale.assets.min.js:1424:49) at Proxy.add_product (https://17609393-saas-15-2-all.runbot70.odoo.com/web/assets/1996-322b17a/point_of_sale.assets.min.js:1566:55) at Proxy.add_product (https://17609393-saas-15-2-all.runbot70.odoo.com/web/assets/1996-322b17a/point_of_sale.assets.min.js:1772:36) at Proxy.add_product (https://17609393-saas-15-2-all.runbot70.odoo.com/web/assets/1996-322b17a/point_of_sale.assets.min.js:2358:883) at Proxy.add_product (https://17609393-saas-15-2-all.runbot70.odoo.com/web/assets/1996-322b17a/point_of_sale.assets.min.js:2749:359) at ProductScreen._clickProduct (https://17609393-saas-15-2-all.runbot70.odoo.com/web/assets/1996-322b17a/point_of_sale.assets.min.js:931:121)

The currect format is "this.set_quantity_by_lot();", but it's
"this.pack_lot_lines.set_quantity_by_lot();".

opw-2919419

closes odoo/odoo#96354

X-original-commit: ff780738dd4675a52557275c8ffae94559217776
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2022-07-20 08:30:18 +02:00
MerlinGuillaume 3bc6374e3a [FIX] website_sale_stock_wishlist: show notify button to connected users
The option to be notified when an item in your wishlist is back in stock
only shows when the debug mode is enabled

Steps to reproduce:
1. Install Inventory and eCommerce
2. Go to Settings > Website > Products and enable Wishlists
3. Open Website and go to the website
4. Open the shop and add 'Three-Seat Sofa' to your wishlist (with the
   heart button)
5. Open your wishlist, the product is out of stock but you can't see the
   'Be notified when back in stock' button (it's only visible in debug
   mode)

Solution:
Change the groups for which the button is displayed

Problem:
The button was restricted to `base.group_no_one` which refers to debug
mode

opw-2904847

closes odoo/odoo#96353

X-original-commit: 50366db4a51bf3191f5e37420ff2499c3d5820bc
Signed-off-by: Guillaume Merlin (megu) <megu@odoo.com>
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-07-20 08:30:15 +02:00
Antoine Guenet 79530cb088 [FIX] web_editor, mass_mailing: properly size the codeview
The codeview of mass_mailing had the wrong height in non full-width
contexts.

task-2894177

closes odoo/odoo#96342

X-original-commit: ee001e843a0a02f04030f0959c7db58beaaa3a3b
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-07-19 21:22:12 +02:00
Abdelouahab (abla) 5bc83b046a [FIX] base : fix importing file with special character
To reproduce
============

for example on accounting, attempt to import a record from excel containing a special character like `%`.
Gets error stating the system doesn't support these

Purpose
=======

the issue is caused by misfromatted error string :
https://github.com/odoo/odoo/blob/b859d78c3d56526f44fbdd9ce5e84d34cf8a0a35/odoo/addons/base/models/ir_fields.py#L410-L411

Specification
=============

to solve the issue use :
`str(value).replace('%', '%%')`

opw-2838573

closes odoo/odoo#96336

X-original-commit: eb0152d4c5ec38c33ccc5381d1277543354e3456
Signed-off-by: abla001 <abla@odoo.com>
2022-07-19 21:22:09 +02:00
Abdelouahab (abla) ddbe814cd5 [FIX] product_matrix : fix _grid_header_cell
To reproduce
============

- Make sure you have a product with variants with grid entry enabled.
- Make sure there is "value price extra" on some of the attribute values of the product.
- Make sure multicurrency is enabled and there is a pricelist using other than the main currency of the system, to compute the final price from product sales price.
- Then try to create a new sales order, using that pricelist, adding the product to it.

A traceback is raised.

Purpose
=======

the method `_convert` expects the `company` argument to be a `res.company` and not an `int`

Specification
=============

to solve the issue we use `company` instead of `company.id`

opw-2897688

closes odoo/odoo#96333

X-original-commit: aa5076941c48b660007be0bda3eb73e965bea931
Signed-off-by: abla001 <abla@odoo.com>
2022-07-19 21:22:06 +02:00
mafo-odoo cf12a41b94 [FIX] website_sale: no tax included in snipets products
Steps to reproduce:
- Take a product sold on the e-commerce and add taxes
- In the Website settings chose the product prices to be
 shown tax-included
- Add the snippet "Products"

Problem:
The price shown on the snippet is tax-excluded while the
price shown on the product page is tax-included. The
price on the snippet should also be tax-included.

Explanation
Bug introduced by commit 9e99a9df46
using the _get_contextual_price ignored the option where the taxes
needed to be computed. To solve the issue we create a new function
that calls _get_contextual_price but also add the taxes if
necessary.

opw-2894461

closes odoo/odoo#96285

X-original-commit: a029aea6e332eca8abbc0591f8885afaaa223e75
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-07-19 21:22:01 +02:00
Romeo Fragomeli f3f66d33db [FIX] web_editor: restore margin on we-selection-items
Margin top of `we-selection-items` was removed during the migration of
BS5 to avoid warning on runbot, but we have to restore it for non BS
`dropdown-menu`.

Ref:
odoo/odoo@e1ea58c941

closes odoo/odoo#96186

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-07-19 21:21:58 +02:00
Bruno Boi 6f6fb914b0 [FIX] web: ignore allowed company from session storage
When switching the company, if the displayed action hasn't any
identifier, the RPC will be based on the previous company.

To reproduce the issue:
(Need stock. Use demo data)
1. Inventory > Operations > Inventory Adjustments
2. Enable the column 'Company'
3. Switch the company to "My Company (Chicago)"

Error: The quants of "My Company (San Fransisco)" are listed -> this
does not respect the selected company

On step 1, when clicking on Inventory Adjustment, it loads a Server
Action that returns another action:
https://github.com/odoo/odoo/blob/68657a85eb09dd306feab91d805b8c21eb75010f/addons/stock/views/stock_quant_views.xml#L356-L364
The returned action is a Window Action built on PY-side:
https://github.com/odoo/odoo/blob/b5d16141dc48d4379452ea40e167f3b00f956c20/addons/stock/models/stock_quant.py#L283-L300
So this Window Action hasn't any identifier (there isn't any
`action=...` in the URL)

Later on, when reloading the page (because of the company switch), we
try to load the action. To do so, we first call `_getActionParams`. In
this method, we take the current state and try to extract some
information. Because there isn't any action defined on the state (as
explained in the previous paragraph), we use the `current_action` stored
in the session storage (i.e., the window action returned by the server):
https://github.com/odoo/odoo/blob/590fa18cafe2c7bbd109692f564c2175ca6d820c/addons/web/static/src/webclient/actions/action_service.js#L294-L302
And here is the issue: the stored action contains its context and this
context contains the `allowed_company_ids` key (-> with the previous
company)

As a result, when performing the search_read to get all the quants of
the view:
https://github.com/odoo/odoo/blob/f5ba34e45b66e0fccc2559bf434e255d38a0faa0/addons/web/static/src/legacy/js/views/basic/basic_model.js#L5016-L5025
And when getting the context, it leads to `_getEvalContext`
https://github.com/odoo/odoo/blob/f5ba34e45b66e0fccc2559bf434e255d38a0faa0/addons/web/static/src/legacy/js/views/basic/basic_model.js#L3716-L3728
We apply the user context (which contains the correct value for the
company) and then apply the element context (which contains the
incorrect one, as explained above)
This explains why it will display the quants of the previously-selected
company.

OPW-2871086

closes odoo/odoo#94039

closes odoo/odoo#96161

Signed-off-by: Géry Debongnie <ged@odoo.com>
2022-07-19 21:21:55 +02:00
Joseph Caburnay 438a87e97f [FIX] point_of_sale: undeletable order when it has fiscal position
NOTE that this is also a refactor.

When an order has a fiscal position, deleting it from the ui is impossible
unless it's deleted from the localStorage. To reproduce:
- Make an order with fiscal position
- Validate the order, and in receipt screen, click next order.
  - This will remove the paid order from `pos`.
- [BUG] Refresh the page the product screen will focus on that order.
  - This is because the order is kept in the localStorage.

Why? `save_to_db` is dependent on `pos.selectedOrder` when there is a fiscal
position in the order.

How come? This is because when computing tax mapping, it's using the
`selectedOrder`. And `save_to_db` is triggered because when deleting an order
`selectedOrder` is set to a order.

The proposed change removes this dependency of an order to the
`pos.selectedOrder` and it fixes the issue.

closes odoo/odoo#96090

Related: odoo/enterprise#29525
Signed-off-by: Masereel Pierre <pim@odoo.com>
2022-07-19 21:21:50 +02:00
Lucas Perais cdda5f50bf [FIX] web: relational model exports its offset
closes odoo/odoo#96079

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2022-07-19 20:13:18 +02:00
Brieuc-brd aca92c6887 [REF] mail: Message, review and simplify scss (phase 2)
Since the migration to Bootstrap 5, we can now use BS 5 utility classes
in the discuss_public view.
This commit simplifies the scss related to discuss_public.

task-2909016

closes odoo/odoo#95772

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-07-19 20:13:09 +02:00
Laura Schauer 6965066e9c [IMP] payment: allow (un)publishing of payment acquirers
Before this commit, it was impossible to migrate from one payment
acquirer to another as the only way to do so was to change a payment
acquirer’s state to ‘disabled’, subsequently disabling all tokens of that
acquirer (detrimental for eg. running subscriptions).

After this commit, payment acquirers have an additional boolean
‘Published’. With this functionality, users can safely migrate by
keeping an acquirer ‘enabled’, but invisible for customers.

There are five combined states an acquirer can take:

‘enabled’ & ‘published’: Visible to all users
‘enabled’ & ‘unpublished’: Visible only to internal users
‘disabled’ & ‘unpublished’: Same as previously ‘disabled’
‘test’ & ‘published’: Same as previously ‘test’
‘test’ & ‘unpublished’: visible only to internal users

task-2871459

closes odoo/odoo#94242

Related: odoo/upgrade#3688
Related: odoo/documentation#2308
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-07-19 20:12:58 +02:00
Valentin Chevalier a26ff947ff [FIX] payment: show the specific message for authorized transactions
When a customers paid a transaction through the `/payment/pay` route and
the transaction was authorized, the message for confirmed transactions
would be shown on the `/payment/confirmation` route instead of the one
specific to authorized transactions.

task-2527323

closes odoo/odoo#78843

Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-07-19 20:12:55 +02:00
Valentin Chevalier 9e59e47572 [IMP] sale: show the 'Authorized' badge on invoices in the portal
When a customer paid for an invoice linked to an SO and the transaction
was authorized, the badge 'Waiting Payment' would still be shown on the
list of linked invoices in the portal view of the SO. Since authorized
transactions are considered as confirmed payments, the 'Authorized'
badge is now shown instead.

task-2527323

Part-of: odoo/odoo#78843
2022-07-19 20:12:55 +02:00
Thibault Delavallée f4d2a12b26 [FIX] crm: fix crashing nightly test
closes odoo/odoo#96283

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-07-19 18:00:24 +02:00
MerlinGuillaume 6be9785544 [FIX] sale_product_configurator: use float quantities in configurator
The product configurator doesn't allow you to use non-integer quantities

Steps to reproduce:
1. Install Sales
2. Go to Settings > Sales > Product Catalog and enable Product
   Configurator
3. Create a Quotation and add product 'Conference Chair (CONFIG)'
4. In the product configurator, specify 3.5 as quantity and click on
   'ADD'
5. The total price is wrong
6. Add the optional product 'Chair floor protection' and confirm
7. The quantity of 'Chair floor protection' rounds to 3

Solution:
Parse the quantity as a float instead of an integer (and replace
potential commas to dots in case of different decimal separator), get
the quantity from default_quantity for the rpc call (as it was converted
to an integer because of its type) and convert the quantity to float in
the controllers

Problem:
parseInt was used to retrieve the quantity and the controllers converted
the quantity to an integer. The field quantity of the
SaleProductConfigurator is of type Integer, which rounded the quantity
when opening the configurator.

opw-2896367

closes odoo/odoo#96275

X-original-commit: 884a99357c1c44b2201e7116d7f6189626695f92
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Signed-off-by: Guillaume Merlin (megu) <megu@odoo.com>
2022-07-19 14:00:05 +02:00
Lucas Perais 28c9a752f2 [FIX] web: list renderer: better handle unselect when clicking
Have an editable list, select a record, click either on a group header or on the list header
press the arrow down key.

Before this commit, there was a crash because we attempted at navigating with the keyboard inside the list from
a wrong entry point. The crash occured because no record was selected.

After this commit, when clicking on something else than a data row or a column that is sortable
we unselect the record. Hence there is no crash when navigating with the keyboard

closes odoo/odoo#96233

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2022-07-19 14:00:01 +02:00
Nshimiyimana Séna 6957fe14f7 [FIX] crm: a lead created through a contact should be an opportunity
Currently, if you try to create an opportunity through the smart button on a contact form, a lead is created.
A lead created from a customer should be an opportunity.

opw-2886623

closes odoo/odoo#96268

X-original-commit: 415c8393f25ab47da45d15ebc455660bfa440389
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-07-19 11:51:28 +02:00
Odoo's Mergebot f8dd8678aa [MERGE] test_mail: move SMS tests, add performance tests
In this merge we introduce a new module ``test_mail_sms`` that holds the
tests for sms application, like ``test_mail`` does for mail. Currently all
sms tests are inside ``test_mail_full``. After this merge code is moved
from ``test_mail_full`` into that module. Full testing module should be used
mainly to test integrations with a lot of submodules and for performance
tests, not testing details of SMS implementation.

We also add ``mass_mailing_sms`` as dependency of ``test_mass_mailing`` so
that both mailing types are tested in the same module. It eases maintenance
and writing of tests. Mass mailing SMS tests  from `test_mail_full`` are
therefore moved in ``test_mass_mailing``.

This merge also allows some cleaning in classes used in tests, to have
classes in ``test_mail_sms`` and ``test_mail_full`` that contain everything
necessary to test mail features.

This merge also adds some additional features

  * new mail related tests;
  * new performance tests;
  * some cleanup in tools;
  * fixup in a randomly crashing test;
  * updater query counters;

See sub commits for more details.

Task-2890111 (Test Mail/Mass Mailing: SMS tests reorganization and move)

closes odoo/odoo#96223

Related: odoo/enterprise#29601
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-07-19 11:51:13 +02:00