Commit Graph
151052 Commits
Author SHA1 Message Date
MerlinGuillaume e7e15aafef [FIX] product_margin: show product margin graph
The graph view of product margins cannot be displayed because it raises
an error

Steps to reproduce:
1. Install Accounting
2. Go to settings and enable Margin Analysis
3. Go to Accounting > Reporting > Management > Product Margins
4. Go to the graph view
5. A User Error is thrown

Solution:
Remove the `:sum` operators for non-stored fields in read_group

Problem:
The graph view tries to sum up the total_margin with `total_margin:sum`
but as the field is not stored, it is not possible to compute it and it
raises the error

opw-2738456

closes odoo/odoo#92719

X-original-commit: fbaedeb18e49e5ed055c597cab33061153aaf1da
Signed-off-by: Guillaume Merlin (megu) <megu@odoo.com>
2022-06-02 08:58:04 +02:00
Adrien Widart 064ce8dcfe [FIX] stock_account: create AML for SML owned by company
If a picking is owned by the company and if the user receives a FIFO
product, a SVL will be created without any journal entry

To reproduce the issue:
(Need account_accountant)
1. In Settings, enable "Consignment"
2. Create a product category PC:
    - Costing Method: FIFO
    - Inventory Valuation: Automated
3. Create a product P:
    - Type: Storable
    - Category: PC
    - Cost: 1
4. Create and validate a receipt:
    - Owner: <The company of the picking>
    - With: 1 x P
5. Open the generated SVL

Error: There isn't any journal entry associated with the SVL

When validating the picking, a method filters the SML that will be
considered during the SVL creation process. This method filters out the
SML that has an owner and if this owner is not the company:
https://github.com/odoo/odoo/blob/f8e2f2a4836d23fe507cad3bd5cac92d41ca91a3/addons/stock_account/models/stock_move.py#L69-L70

However, the filter in the journal entries creation is not that accurate
and does not correspond to its comment line:
https://github.com/odoo/odoo/blob/f8e2f2a4836d23fe507cad3bd5cac92d41ca91a3/addons/stock_account/models/stock_move.py#L475-L476

OPW-2859144

closes odoo/odoo#92716

X-original-commit: 13d4963d10e14c0295a1c7abeefd52b070cd4a58
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Adrien Widart <awt@odoo.com>
2022-06-02 08:57:59 +02:00
Merlin (megu) ed586dfc68 [FIX] account: prevent draft entry for reconciled statement
Journal entries of a bank statement can be reset to draft even if the
bank statement has been validated

Steps to reproduce:
1. Install Accounting
2. Go to Accounting dashboard, click on the 3 dots of Bank and go to
View > Statements
3. Create a new statement with a transaction of 100, correctly set the
ending balance, save and post
4. Click on reconcile then validate the reconciliation
5. Go back to the statement and validate it
6. Open the journal entry of the statement
7. You can reset it to draft but you shouldn't be able to

Solution:
Prevent the user from resetting a journal entry to draft if the
statement has been confirmed

opw-2827117

closes odoo/odoo#92713

X-original-commit: 5622bc103e063d62f75625ca413a06aa7395d654
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Guillaume Merlin (megu) <megu@odoo.com>
2022-06-02 08:57:56 +02:00
Ricardo Gomes Rodrigues (rigr) c0cf6d79de [IMP] l10n_be: update taxes in Belgium
This commit updates the taxes in Belgium.

- Tax names will use the following nomenclature
Rate (Territory) (Scope).(Special)

- Label on Invoices should not mention TVA, only the rate

closes odoo/odoo#92711

X-original-commit: b06b7c8be812f1e920703b55f0c9185976c6c769
Related: odoo/enterprise#27960
Signed-off-by: William André (wan) <wan@odoo.com>
2022-06-02 08:57:49 +02:00
Dossogne Bertrand 921dd26ba8 [IMP] hr_holidays: automatic time-off recovery after public holiday edit
If a public holiday is created, modified or deleted,
all declared (non-refused) leaves related to that period will have
their duration re-evaluated and individual remaining time offs will
be computed accordingly.
If the duration of the leave is evaluated at 0 after the creation
of the public holiday, the leave will be set as cancelled.

task-2636215 [Time Off]Grant back time off when public day off is created

closes odoo/odoo#81225

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-06-02 08:57:40 +02:00
sofiagvaladze d70000bf21 [IMP] hr_expense/sale_expense: allow splitting an expense
Purpose: Sometimes, taxes are distinct on parts of the expense
(for example alcohol and food).
Therefore the expense should be split in two.

In order to split the expense, we added an wizard.
When creating a new expense from the split, we also
copy the attachments.

'hr.expense.split' has to have the similar logic and dependencies between
the fields as 'hr.expense' does. For example, in case we change the
product_id to the product that has cost defined on it, it should have
the same behavior as expense has. In particular, the 'total_price'
will be set and the user should not be able to modify the amount.

Similarly, if we change the product_id to the one that has no tax defined
on it, then split tax_ids should be cleared out and be set to readonly.
Similar logic goes to sale_order_id (Customer to Reinvoice'),
we should not be able to set it, in case the product can not be re-invoiced.

All of the above constraints leads to the amount of similar code to to the 'hr.expense.split' side.
But it could not have been avoided, if we want the smooth flow.

task - 2831024

closes odoo/odoo#90770

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-06-02 08:02:04 +02:00
sofiagvaladze 09609889e3 [FIX] hr_expense: fix updating the unit amount on the expense form
The unit_amount should be updated when product changes, in case the product
has price defined on it.

task - 2831024

Part-of: odoo/odoo#90770
2022-06-02 08:02:04 +02:00
Christophe Monniez 80c2204e20 [FIX] tests: increase navigation timeout
When instrumenting the Chrome Browser and asking to navigate to a
location, it happens that the 10 seconds timeout is exceeded.

This happens particularly when executing qunit tests by navigating to
`/web/tests`. This route has an average loading time around 7 seconds
but when the runbot is loaded, it can exceed 10 seconds.

With this commit, the timeout is set to 15s. It would be better to split
the qunit tests by module in order to avoid the huge assets bundle
generation.

closes odoo/odoo#92699

X-original-commit: 6c0fa6b72bf5d15e8323b81cf930a01d4c0f3291
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2022-06-01 21:28:46 +02:00
Ricardo Gomes Rodrigues (rigr) c56c137f53 [IMP] account: improve tax name search
This commit improves tax name search by ignoring punctuation and spaces.
This allows faster searching for taxes (while editing an invoice line or
while configuring them)

Example:
Searching for `21M` should match `21% M.` , `21% EU M.` and `21% M.Cocont`.
Searching for `0EUT` should match `0% EU T`.

Task id: 2851341

closes odoo/odoo#92683

Signed-off-by: William André (wan) <wan@odoo.com>
2022-06-01 18:34:56 +02:00
Odoo's Mergebot 3ba7cf26ef [MERGE] project: link milestones in tasks
Purpose
=======

The goal of this PR is to create a link between milestones and tasks. Indeed, milestones usually contain a set of tasks. Once all of these tasks are done, the milestone can be considered as reached. This link would help users organize their projects more efficiently and have a better overview of what needs to be done when.

## Implementation details

- A new many2one field is added in the `project.task` called `milestone_id` to link a milestone to tasks.
- Add `Milestones` as global setting and project setting. It means the user will can globally enable the feature and choose in which project he wants to use the feature.
- In the form view of milestone, a stat button is added to display the tasks linked to current milestone.
- Add `Late Milestone` filter in tasks, when this filter is applied the user will see the tasks linked to a milestone with a deadline in the past. This filter is also added in the Burndown chart and Tasks analysis report.
- When the user set a milestone on a task and no SOL is found in the project and/or parent task related then set the SOL of the milestone as a default SOL for the task.
- Display in green the milestone in project update view if all tasks linked to that milestone are in a closed stage.
- When a user changes a stage of a task to a closed stage, a wizard will be displayed if the task is linked to a milestone and all others tasks are in a closed stage too. This wizard will allow the user to reach the milestone since all tasks linked to that milestone are considered as finished.
- Remove `delivered_milestone` option in the `invoice_policy` selection field in `product.template` model when the Milestones feature is globally disabled. If some products are milestone one than they will be converted into a manual service ones to allow the user to manually set the quantity delivered for those products.
- Display the milestone field in task in Project Sharing feature.

task-2829542

closes odoo/odoo#90972

Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-06-01 18:34:46 +02:00
Fabio Barbero 7ec3a50aa6 [IMP] website_event(_sale): improve event confirmation page
Purpose
=======
Avoid having "dead-ends" when registering to an event.

Specifications
=============
Add link to event to registration confirmation for free events.
Display list of each bought event on the confirmation page for paid
events.

PR: odoo/odoo/pull/78599
Task-2657635

closes odoo/odoo#78599

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-06-01 18:34:42 +02:00
Nikunj Ladava 0d83e4a66a [FIX] mass_mailing: fix emoji widget position
Before this commit, in the editable form view of mass mailing, the
emoji widget is outside of the subject field, which is not optimum.
This issue was re-spawned after a recent commit that enabled saving
the mailing as a template, which changed the layout to add a star
next to the subject field.

With this commit, emoji widget is now inside the subject field.

task-2826521

closes odoo/odoo#92672

X-original-commit: 09991b477353e6167d576779b7364408b2109cd6
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-06-01 17:36:52 +02:00
Jordi Ballester aba7ffc38d [FIX] product: Only trigger unlink when there are records to unlink
closes odoo/odoo#92663

X-original-commit: 9039380f74984878f95a4dcf9cf425a855330a38
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-06-01 17:36:45 +02:00
Nicolas Bayet f3cbb27fc1 [FIX] web_editor: correct selection after applying a color
Ensure the selection in the fonts tags after `applyColor`, otherwise an
undetermined race condition could generate a wrong selection during
multiples call of `_processAndApplyColor` from the color picker.

task-2822221

closes odoo/odoo#92654

X-original-commit: 2b2aba49550cf7c2ba1914f03beef9cbdf60b166
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-06-01 16:26:40 +02:00
Kishan Gajjar 4e46181331 [FIX] website_sale_comparison_wishlist: don't show compare button if option is disable
closes odoo/odoo#92652

Closes: #92548
X-original-commit: 45aa45c35f07782fb91d3a3dc26ee493dd1b405c
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-06-01 16:26:37 +02:00
Alvaro Fuentes d5f2fc2e37 [FIX] payment: fix misplaced sudo
On 02eba891cb8cd58985837090f2b60cf263bce065
we changed
https://github.com/odoo/odoo/blob/b5cf1ee3e21f2e60b8edd64f24c04c952fb7df3f/addons/payment/models/account_payment.py#L47
to
https://github.com/odoo/odoo/blob/02eba891cb8cd58985837090f2b60cf263bce065/addons/payment/models/account_payment.py#L47-L48
Effectively moving the place where `sudo` is called.

This causes issues during migration of some DBs
upg-328570

closes odoo/odoo#92651

X-original-commit: 90c321cc8bad04f7f094a221a39ca6f647944f5d
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-06-01 16:26:32 +02:00
Ahmed Khalaf (ahkh) 964bfda3bf [FIX] mrp: transfers are created from manual moves in MO
When manfacture in 2 steps is setup on warehouse, transfers are created
when confirming an MO, manual moves added did not have a warehouse and thus not
included in the picking. The default warehouse is set to the source location
warehouse in MO.

closes odoo/odoo#91879

Related: odoo/enterprise#27577
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2022-06-01 16:26:29 +02:00
Ahmed Khalaf (ahkh) 1b2cf66f6e [FIX] mrp: skip archived operations in bom
Part-of: odoo/odoo#91879
2022-06-01 16:26:29 +02:00
Ahmed Khalaf (ahkh) c7c835f7a3 [FIX] mrp: div id conflict between stock and mrp quality settings
Part-of: odoo/odoo#91879
2022-06-01 16:26:28 +02:00
Ahmed Khalaf (ahkh) 616aa3855f [IMP] mrp_account: analytic account added to MO tree view optional
Part-of: odoo/odoo#91879
2022-06-01 16:26:28 +02:00
Ahmed Khalaf (ahkh) 3734709ef1 [FIX] repair: manually set return picking on repair form
User Can now manually set return picking on repair form,
only pickings of return type

Part-of: odoo/odoo#91879
2022-06-01 16:26:28 +02:00
Ahmed Khalaf (ahkh) 20ce3cc03f [IMP] mrp: Routing Performance label to Operations performance
Part-of: odoo/odoo#91879
2022-06-01 16:26:27 +02:00
Odoo's Mergebot 2454f5e990 [MERGE][IMP] website_sale_slides: slightly improve "publish" management
This commit adds a couple improvement to the "publish" flow of courses:

- Improve the published synchronization between the course and its product
- Adapt wording when the course is unavailable on the frontend view

See underlying commits for details.

task-2842624

closes odoo/odoo#90736

Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2022-06-01 16:26:09 +02:00
Jérémy Hennecart (jeh) d26c55698f [IMP] website_sale_slides: describe course unavailability
When a product linked to a course is unpublished, the course is not
buyable. This commit improves the design in this case.
- Change the text of disabled button into "Course Unavailable"
- Add an alert message to group_website_slides_officer letting them
know that the course is not buyable because the product is unpublished

task-2842624

Part-of: odoo/odoo#90736
2022-06-01 16:26:08 +02:00
Jérémy Hennecart (jeh) 5881195bfe [FIX] website_sale_slides: fix sync between product and course
Before, each time we created a course "on payment". The product
linked to it was automatically unpublished. If multiple course
share the same product this leads to issues. Indeed, with the
product unpublished all the courses depending on the product are
no longer buyable.
To avoid this, we synchronise the published value when the
course is published which published the product.
If we create a new course or unpublished a previous course linked
to a product, we don't update the published value of the product
unless all courses linked to this product are unpublished.

We also fix a Forbidden error raised when the product was unpublished
but not the course. This was leading to a previous member to not have
access to a course he previously buyed.

task-2842624

Part-of: odoo/odoo#90736
2022-06-01 16:26:08 +02:00
Adrien Schoffeniels 2e0490beb5 [IMP] website_slides: improve website_slides_survey integration
SPECS

1. Change the default content of the modal opened after the installation
of a module

When the installation of a suggested module from the upload dialog is
completed, the page is reloaded and the upload dialog is opened on load.
Since the user installed the module to add content of the category related to
this module, it is more convenient to open the modal directly on this category.

2. Replace the notification displayed when the user creates a new
certification by a permanent button allowing to add questions

When a user creates a certification, he must then add questions to this
certification. Instead of showing a notification after the creation
proposing to add questions that was shown only once, a permanent button
has been added to the view of the certification so that anyone with the
sufficient access rights can add questions, at any time, from the certification
view.

Task-2727654

closes odoo/odoo#86721

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-06-01 16:26:02 +02:00
Adrien Schoffeniels 99499a7c40 [IMP] website_slides: improve wording & editor integration
PURPOSE

This commit slightly changes the wording and improves the website editor
integration.

SPECS

Reword "slide" to "content"
As slide is a technical term that does not mean much to end-users.

Make some elements not editable by adding "o_not_editable", or non visible
in edit mode by adding "css_editable_mode_hidden".
The e-learning website interface allows the course editors to modify the course
content using various buttons ("Add Quiz", "Add Content", ...).

Those buttons should not be edited by the web-editor, as it could mess up the
display and break potential future changes to the module / features.

Task-2727654

Part-of: odoo/odoo#86721
2022-06-01 16:26:02 +02:00
Alexandre Kühn 106c76c236 [FIX] mail: allow use of raw field command inside FieldCommand
closes odoo/odoo#92644

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-06-01 15:23:14 +02:00
Nicolas Bayet 7ee954e84b [FIX] web_tour: observe iframe without body
In mass mailing, when an iframe is loaded, the `contentDocument.body`
could be `undefined` this caused a traceback when trying to observe
the iframe.

Observing the `contentDocument` is safer as it will always be defined.

task-2869490

closes odoo/odoo#92630

X-original-commit: 00a2843216128df6454d5c6ced3a34cd02e7d6d9
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-06-01 15:23:10 +02:00
pedrambiria 40d4679093 [FIX] google_calendar: allow to sync a private contact
Before this commit: if a user is the attendee of an event containing
a private contact, the user couldn't sync with google calendar. Because
of the "res.partner.rule.private.employee" record rule restriction.

Steps to reproduce the issue:
 1. Create users A and B
 2. Enable "Access to Private Addresses" for user A and disable it for B
 3. Login with user A
 4. Integrate with Google Calendar in setting
 5. Create a contact with private address (type = 'private')
 6. Sync with Google Calendar in the calendar module
 7. Create an event with user B and the private contact as attendees
 8. Reset account of google calendar from user A setting
 9. Login with user B
 10. Try to sync with Google Calendar

 => You will receive an access error

The solution is not to allow any user to add private contacts as an
attendee. Also, create a new contact with the same email if it wants to
match existing private contact with a google event attendee.

opw-2850552

closes odoo/odoo#92624

X-original-commit: 96ee1ef45954bd27632da9c2cef3cf9ba44caca0
Signed-off-by: Arnaud Joset <arj@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2022-06-01 15:23:06 +02:00
Alexandre Kühn 669dccddd9 [IMP] mail: introduce Throttle model
Task-2831082

closes odoo/odoo#91502

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-06-01 15:22:59 +02:00
Horacio Tellez 557a3e28ed [IMP] payment, sale: prevent paying for a canceled SO/invoice
Before this commit, sales orders/invoices that had been canceled could
still be paid from a payment link. Now, when trying to pay for a
canceled sales order/invoice, the amount to pay is set to zero.

Task - 2735019

closes odoo/odoo#85728

Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-06-01 15:22:55 +02:00
Parth Gajjar 760b4a5c14 [FIX] payment_mollie: mollie shows 404 page when only one payment method is active
Mollie supports multiple payments methods, these payment methods can be
enabled/disabled from the mollie dashboard. When you activate only one payment
method from mollie dashboard, you will get 404 page instead of payment page.
This commit will fix that issue by providing necessary query parameters in url.

closes odoo/odoo#92637

X-original-commit: 500be5b85d99ee4fa9590c18d3795977fbf48c4f
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-06-01 14:16:07 +02:00
Hiral Bhavsar a35c71690a [IMP] mail: chatter file drag and drop
PURPOSE

The attachment icon in the chatter is too discrete, a lot of users easily miss
it.

SPECIFICATIONS

- Allow for file upload through drag and drop and the whole chatter.
  It doesn't matter whether the file tray is unfolded.
  Hence, removed DropZone on attachmentBox as now have DropZone on
  the whole chatter.
- On the file tray, rename "Attachments" to "Files" and
  "Add attachments" to "Attach files".
- When there are files attached to the record, display "X files".
- when there is no file yet, display 'Attach files'. Although clicking on it
  opens the file explorer, but doesn't unfold the tray yet. Once the file is
  submitted, the file tray unfolds to show confirmed upload to the user.

Task-2413814

closes odoo/odoo#91335

Related: odoo/enterprise#27763
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-06-01 14:16:01 +02:00
Alexandre Kühn 7144d2fe7c [IMP] mail: remove useless min-height 0 on DiscussContainer
DiscussContainer is specific component for content of Discuss app
in "whole screen" client action. The parent is not flex, so
it needs `h-100` to take the whole screen.

Consequently, `min-height: 0` is useless, hence this commit
removes it.

closes odoo/odoo#92613

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-06-01 13:13:59 +02:00
Horacio Tellez e4c63126b4 [ADD] payment_authorize: add refund for Authorize.
Users can now ask for a refund from Odoo for their transactions done
through Authorize.net. A refund will be triggered from Odoo when
necessary.
Only full refunds are possible.
Note that unsettled transactions will be voided as they cannot be
refunded.

Task - 2678757

closes odoo/odoo#92279

Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-06-01 13:13:55 +02:00
mafo-odoo 3a4cb6f59a [FIX] hr_holidays: right responsible for validation type set
Steps to reproduce:
- Create a Time off Type for which an allocation can be requested
by the employee and with approval "Set by Time Officer"
- Set a Time Off approver on the employee
- Create an allocation

Current behavior:
The allocation approval activity is assigned to the employee

Expected behavior:
The allocation approval activity is assigned to the time off officer

Explanation:
The first fix commit c2bac984f2de160008b27fb52b1d0ae7abd02abb didn't
take into consideration the "Set by Time Officer" approval, we add
here this possible value "set" in order to have a complete fix.

opw-2849972

closes odoo/odoo#92608

X-original-commit: 7239fad29c4b409097ba2a0d2f92d8b9fa8fd5ca
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: Fockedey Martin (mafo) <mafo@odoo.com>
2022-06-01 12:14:13 +02:00
tsm-odoo 7ddcf5d5b1 [FIX] mail: remove useless flex grow class from discuss container
The discuss container used to have a flex parent but hasn't anymore (its parent
is now the actionManagerContainer instead of the discussWidget). The flex-grow
class has now become useless. This PR removes it.

closes odoo/odoo#92597

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-06-01 12:14:09 +02:00
qsm-odoo 44a19384fc [FIX] tools, base: restore branding on siblings of a replaced root node
Since [1] which tried to fix the data-oe-xpath branding on nodes in some
cases, the branding actually became potentially incorrect on siblings of
a node which is replaced multiple times. E.g.

Parent view:

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

Child view 1:

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

Child view 2:

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

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

But in this other case:

Parent view:

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

Child view:

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

Child view of the child view:

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

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

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

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

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

Parent view:

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

Child view:

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

Child view of the child view:

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

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

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

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

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

closes odoo/odoo#92589

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

closes odoo/odoo#92551

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

Fixes
-----

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

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

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

closes odoo/odoo#92599

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

Part of task 2860257

closes odoo/odoo#92577

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

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

SPECIFICATIONS

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

Task-2802810

closes odoo/odoo#92013

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

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

task-2794182

closes odoo/odoo#89537

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

Issue:
A lead will be created. Not opportunity.

Solution:
Fetch the info related to the team

opw-2856520

closes odoo/odoo#92563

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

opw-2830883

closes odoo/odoo#90417

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

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

Task-2429708

closes odoo/odoo#90203

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

opw-2702912

closes odoo/odoo#92542

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

closes odoo/odoo#92539

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

Expected behavior:
The date_closed does not change

Current behavior:
The date_closed changes

opw-2839298

closes odoo/odoo#92534

X-original-commit: 0c55c0d31021abe966c453c4827d5873a7af485c
Signed-off-by: Fockedey Martin (mafo) <mafo@odoo.com>
2022-06-01 08:51:46 +02:00