Commit Graph
170708 Commits
Author SHA1 Message Date
Flotchet 040c314e91 [FIX] hr_skills: fix duplicate "skills" title
Steps to reproduice:
-go to myprofile with hr installed
-go to resume page
-> skills title is duplicated

Reason:
The no_label attribute is set to True but the widget will still display a label.

Expected behavior:
The label should only be displayed once

Fix:
Remove the effectless no_label attribute and remove the separator

closes odoo/odoo#158051

Task: 3815381
Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
2024-04-17 22:47:08 +00:00
Victor Piryns (pivi) d29a622740 [PERF] account: speed up dashboard
Description:
Add supporting indexes that are used in the queries generated when
openning the accounting dashboard. A query is tweaked to hit
those indexes and avoid `JOIN` where possible.

Benchmark:
Hot loading the default accounting dashboard, default filters and
1 company selected on a staging database with millions of accounting
related entries.

|         | Before   | After    |
|---------|----------|----------|
| Timings | 7.32 sec | 1.6 sec  |

Reference:
task-3805835

closes odoo/odoo#157892

Signed-off-by: William André (wan) <wan@odoo.com>
2024-04-17 22:47:08 +00:00
Paolo Gatti f043353880 [IMP] l10n_it_edi: Adding negative bill test
Added a test to verify the behaviour when receiving a negative bill. The
invoice gets imported with negative amounts, but it can't be posted.
When the user tries to post it, they are prompted to turn it into a
credit note with a UserError.

closes odoo/odoo#141485

Signed-off-by: Josse Colpaert <jco@odoo.com>
2024-04-17 22:47:07 +00:00
Julien (jula)andqsm-odoo d28774398f [FIX] website: review default hr color
By default, Bootstrap uses a solid color and dim the element by setting
`$hr-opacity` to `0.25`[1].
Our design comes with a color that is "dimmed by default" since:

```scss
$hr-color ← $border-color ← rgba(currentColor, .25)
```
This commit therefore sets `$hr-opacity: 1 !default`.

At the same time, this also removes the hr background-color that
Bootstrap sets, otherwise it conflicts with the transparent color we are
adding on top of it.

[1]: https://github.com/odoo/odoo/blob/1154556/addons/web/static/lib/bootstrap/scss/_variables.scss#L664

closes odoo/odoo#160495

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
2024-04-17 19:02:39 +00:00
Julien (jula)andqsm-odoo 3ec555eb38 [FIX] website: prevent crash due to color-mix in Safari 16.5
__Current behavior before commit:__
The `color` attribute of `hr` is set to `$hr-color`[1].
`$hr-color` is equal to `$border-color`[2] which itself is equal to
`--o-border-color`[3].
Finally `--o-border-color` is set using `fade-currentColor()`[4]
which uses the `color-mix` css function on `currentColor`[5].

In short, the `color` of `hr` depends on itself. This creates a circular
reference that makes Safari 16.5 crash.

This bug is caused by WebKit. There seems to be a commit to fix[6]
this bug but it looks like it was not backported to this version of
Safari.

__Description of the fix:__
Set `border-top` color of `hr` to `$border-color`. This way of doing
gives the same result as setting `color` but removes the circular
dependency with `currentColor` that makes Safari 16.5 crash.

`color` is set to `inherit` to override the bootstrap rule[1] that
leads to the bug.

For reference, `hr` color is already set like that here[7].

__Steps to reproduce the issue on runbot:__
1. Go to the website shop using Safari 16.5
2. Add an item to the cart
3. Open the cart view
4. Safari crashes

opw-3806725

[1]: https://github.com/odoo/odoo/blob/1154556/addons/web/static/lib/bootstrap/scss/_reboot.scss#L71
[2]: https://github.com/odoo/odoo/blob/1154556/addons/website/static/src/scss/bootstrap_overridden.scss#L333
[3]: https://github.com/odoo/odoo/blob/1154556/addons/website/static/src/scss/bootstrap_overridden.scss#L91
[4]: https://github.com/odoo/odoo/blob/1154556/addons/website/static/src/scss/website.scss#L35
[5]: https://github.com/odoo/odoo/blob/1154556/addons/website/static/src/scss/primary_variables.scss#L2219
[6]: https://github.com/WebKit/WebKit/commit/0d0b884
[7]: https://github.com/odoo/odoo/blob/1154556/addons/website/static/src/snippets/s_hr/000.scss#L7

Part-of: odoo/odoo#160495
Co-authored-by: qsm-odoo <qsm@odoo.com>
2024-04-17 19:02:39 +00:00
Julien Carion (juca) 77aadf471c [FIX] web, *: autocomplete cancels search on click out
This commit fixes a bug where the value of an autocomplete with autoselect
could go into an undefined state where the model value doesn't match the
input value but no change is detected. This would happen on escape press,
scroll and more recently due to https://github.com/odoo/odoo/pull/159333
on click out. To fix this issue, the commit introduces some change in the
autocomplete behavior so that it will no longer select the active option
on click out (blur) when autoselect is active and instead it will revert
the input value to the one stored into the model. Also applies this
behavior on escape key press and scroll for the before mentioned reasons.

Steps to reproduce:
- Go to CRM form view
- Edit the salesperson name to some non existant one and click out (or
scroll or press escape)

Before the fix, the name was stuck to the invalid one but no change was
detected so we couldnt save it. Before https://github.com/odoo/odoo/pull/159333,
click out would select the active option of the dropdown instead (and
launch a dialog for quick create). This is removed because the behavior
is neither intuitive nor practical. After the fix, the name is reset to its
previous valid value instead. This applies to all autocomplete components
with autoselect prop set to true.

closes odoo/odoo#162040

X-original-commit: 9d9026ed0c7bb0af6cf910cc206cf8b55d1b7a36
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Julien Carion (juca) <juca@odoo.com>
2024-04-17 13:44:45 +00:00
Sanjay Sharma ef631c5d10 [FIX] website: remove sub level options of border width
Steps to reproduce :

1. click on edit website.
2. click on THEME tab from snippet options.
3. scroll down to input fields.
4. the border width has options for small and large size, which serves
no purpose and were displayed empty.

Purpose:

This commit aims to remove the changes made on [1] which added 2
sublevel options for Border Width for Input Field which served no
purpose.

After this commit :

The Border Width option will not have sub options small and large.

[1]: odoo@388e4bb

task-3771146

closes odoo/odoo#161872

X-original-commit: f35123799408614c0bd50fcb79d147d2f69a84f7
Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
2024-04-17 13:44:44 +00:00
Benoit Socias 07f6d71e4d [FIX] website: keep track of throttled scroll event target for Chrome
In Chrome, if a scroll event is not brand new, its `currentTarget` is
lost.

This commit makes sure that the `currentTarget` of the throttled scroll
event sent to `_onScrollWebsiteAnimate` is kept separately to avoid the
issue in case of throttling delay.

task-3449843

closes odoo/odoo#161850

X-original-commit: 277e9f292a031ed835f4135e597c17dab2fd067d
Signed-off-by: Benjamin Vray (bvr) <bvr@odoo.com>
2024-04-17 08:01:26 +00:00
Benoit Socias f6aa408095 [IMP] web: further document throttlingForAnimation
This is a followup on [1].

In Chrome the event's currentTarget is cleared after events such as
"scroll" are handled. For asynchronously called methods to be able to
access it, the current value of currentTarget needs to be kept.

To help developers that might stumble on this issue when using
`throttleForAnimation`, this commit emphasizes the fact that usage of
that function is not limited to event handlers, and it adds a test case
that illustrates a solution for tracking the lost scroll event target.

No scenario was identified in 15.0, but this could be used as an
alternative solution for [1].

[1]: https://github.com/odoo/odoo/commit/0ba601d2ef5c4e2f846818e78dcd23966d6f563d

task-3449843

X-original-commit: 6cc4cbf2b91d624368c489460a90795921985f6b
Part-of: odoo/odoo#161850
2024-04-17 08:01:26 +00:00
AllePilli 529419957f [IMP] account_edi_ubl_cii: handles UBL files with namespaces per line
Backporting: 1e24b151c6ad0023769b5a561690cb62bcda1d8a

When importing a UBL file, Odoo expects the UBL specific namespaces to
be in the root element of the file. This is not always the case as these
namespaces could exist in every element in the file. When a file is
formatted this way, Odoo cannot extract the necessary data from it
because it is missing the necessary namespaces. To cover this case we
use the lxml.etree.Element.find function instead, and pass in the UBL
specific namespaces to successfully extract the data.

task-3657563
opw-3839398

closes odoo/odoo#161959

X-original-commit: 2845db5966bae3d6f81b6007980053f4ecb00a03
Signed-off-by: Wala Gauthier (gawa) <gawa@odoo.com>
Signed-off-by: Julien Van Roy (juvr) <juvr@odoo.com>
2024-04-17 06:41:22 +00:00
Alvaro Fuentes b278241a71 [FIX] base: ensure existing ir.model.constraint xmlids are loaded
When we load a module and the SQL constraints exist both in the table
and in `ir_model_constraint` we need to ensure the xmlid is loaded.
Otherwise the record in `ir_model_constraint` is removed.

Since 4c9968397b we skip returning
existing non-updated constraint records in `_reflect_constraint`. This
leads to them being removed by the ORM. At the end of the load the ORM
sees the record in `ir_model_data` but not in the xmlid pool, thus it
removes it.

closes odoo/odoo#162105

X-original-commit: b5670c7f0d35d13affee2ae93158556346b7dd23
Signed-off-by: Christophe Simonis (chs) <chs@odoo.com>
2024-04-16 17:38:14 +00:00
Julien Van Roy 992532e9ef [FIX] account_edi[_ubl_cii]: company_id when searching retrieve_partner
Bug:

1. Have at least 2 companies ("A" and "B")
2. Export an xml (Bis 3 for instance) for an invoice with customer
"Azure Interior"
3. Set a company on "Azure Interior" (say: A)
4. Import the xml in multicompany mode, with current company = B The
partner "Azure Interior" should be retrieved, but when writing it on the
invoice, it will throw a UserError "odoo.exceptions.UserError:
Incompatible companies on records: 'Draft Invoice (* 63)
(INV/2024/00006)' belongs to company 'B' and 'Partner'
(partner_id: 'Azure Interior') belongs to another company."

Cause:

We try to write a partner on an invoice belonging to another company. It
only occors when we have several companies selected because there is the
global rule `base.res_partner_rule` that will add `('company_id', 'in',
company_ids + [False])` to any search domain on the partner
(`company_ids` is replaced by `env.companies.ids`, see `_eval_context`).

Fix:

Ensure any search domain contains `env.company.id`: the `company_id` of
the move being created.

opw-3829223

closes odoo/odoo#162019

X-original-commit: 18119d446bdca9c04b7085bd1a1bd2f0e0b94ff3
Related: odoo/enterprise#60816
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Julien Van Roy (juvr) <juvr@odoo.com>
2024-04-16 17:38:12 +00:00
Guillaume-gdi 1d16d3a095 [FIX] website_blog: remove problematic test without cache
Since [this commit], the `test_10_perf_sql_blog_standard_data` test
failed randomly. As testing sql perf for website without cache doesn't
really make sense (as explained in [this other commit]) we can can just
remove the test without cache.

[this commit]: https://github.com/odoo/odoo/commit/88b016fdc407e318c43c96df9b582853512f04fa
[this other commit]: https://github.com/odoo/odoo/commit/dad8dca0da23143eb2f28debde5139e907368a2e

runbot-55755

closes odoo/odoo#162036

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2024-04-16 16:18:46 +00:00
Arthur Detroux (ard) c7c1f53bef [FIX] web: properly define at method in array polyfill
Commit [1] introduced a fix for old browsers to make the `at` method of
the Array class. It did so by simply adding a property on the prototype
of the Array class.
Unfortunately this way of adding a method means that it is exposed in
`for...in` loops.

To avoid this, this commit uses Object.defineProperty and sets the
property as not enumerable, removing it from the for..in loop.

[1]: https://github.com/odoo/odoo/commit/6e39e31030c28a8eb09ddcd93ca9ca382b4f6f10

opw-3824593

closes odoo/odoo#161891

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2024-04-16 16:18:45 +00:00
clesgow eb2f6cfde8 [FIX] purchase_mrp,stock: Avoid issues with backorders in Overview
Steps to reproduce:
- Set warehouse to two-steps reception
- Create a BoM using a MTO (buy) component
- Create a MO for 2 units of that BoM
- Produce 1 and create a backorder
- Open the Overview

Issue:
When there is a backorder (or if the MO is splitted), then when browsing
the dests through `_rollup_move_dests()`, at some point it will branch
into two differents path, related to each backorders. This will raise a
traceback, as we only expected a single MO at that point.

To avoid this, we made the `_rollup_move_dests()` method batchable, so
we can fetch all moves linked to a manufacturing order in a single call,
avoiding this issue.

Note: For consistency sake, updated the `_rollup_move_origs()` method to
be batchable as well, to avoid confusion when using one or the other.

opw-3849252

closes odoo/odoo#161790

X-original-commit: d2830fccbe5dc733673d048303f573bb57a398a6
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: Quentin Wolfs (quwo) <quwo@odoo.com>
2024-04-16 16:18:44 +00:00
Gorash d82ffde0b3 [FIX] http_routing: fix wrong overwrite of column_invisible in tree view
closes odoo/odoo#162050

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2024-04-16 14:12:53 +00:00
Valeriya(vchu) 371701863c [FIX] website_sale_mondialrelay: override shipping partner fields check
Steps to reproduce:
1) Set up mondial relay and publish it
2) Go to /shop, add a product and checkout
3) Choose a pickup location of mondial relay
4) Reload the page
5) Observe an error 'You cannot edit the address of a Point Relais'

Reason: a partner was created without
mandatory field 'phone` for the shipping address

Solution: do not check mandatory fields for mondial relay partners
as it is not allowed to edit them

closes odoo/odoo#162047

Signed-off-by: Valeriya Chuprina (vchu) <vchu@odoo.com>
2024-04-16 14:12:52 +00:00
Antoine Vandevenne (anv) c9bba0df5a [FIX] payment: flag the SEPA Direct Debit payment method as tokenizable
The payment method's `support_tokenization` field was incorrectly set to
`False` instead to `True`. This didn't prevent the SEPA Direct Debit
provider from tokenizing this payment method because it always creates
tokens when a payment transaction is confirmed. However, the payment
method was not shown in payment contexts where tokenization is required
(e.g., Subscriptions' portal page, /my/payment_method page).

opw-3756773

closes odoo/odoo#161561

Related: odoo/enterprise#60562
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2024-04-16 14:12:48 +00:00
arpr-odoo 3f8dacd26c [IMP] hr_homewroking: fine tunning
This commit adds slight improvement to the design of remote work
by adding margin to "Set Location" button.

task-3693392

closes odoo/odoo#157502

Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
2024-04-16 14:12:47 +00:00
Thomas Lefebvre (thle) 5fe2866cc4 [FIX] base_automation: differentiate between creating and writing
Steps to reproduce:
-------------------
[A] Create an automated action with:
- Model: Tasks (project.task)
- Trigger: On save
- When updating: ID (to mimic "on_create" trigger)
- Execute code:
```py
record.message_post(body="This is a message from automated action (fields triggers: ['id'])")
```

[B] Create a server action (contextual action) with:
- Type: execute code
- Model: Tasks (project.task)
- code:
```py
record.write({})
```

[C] Test:
- create a new task --> message has been posted (OK)
- write some values on the task --> no message has been posted (OK)
- run the server action --> message has been posted (KO)

Issue:
------
No message should be posted as the ID field has not been modified.

Cause:
------
`if not self._context.get('old_values')` is considered as `True`
because we have an empty dict.
In fact, when we make a write on a record, old_values will be always a dict.

```py
old_values = {
    old_vals.pop('id'): old_vals
    for old_vals in (records.read(list(vals)) if vals else [])
}
```

Solution:
---------
Old values are not defined in the context during a create.
We can compare `self._context.get('old_values')` with `None`
to differentiate between creating and writing on records.

opw-3736068

closes odoo/odoo#155832

Signed-off-by: Rémy Voet (ryv) <ryv@odoo.com>
2024-04-16 14:12:46 +00:00
Benjamin Vray 6f44b78954 [FIX] website_payment: fix "Donation" snippet "Pre-Filled Options"
Steps to Reproduce :

- Install eCommerce.
- Drag and drop the "Donation" snippet.
- Click on the prices in the snippet.
- Toggle the "Pre-Filled Options" option.
- => There is a traceback.

This bug is due to the fact that since commit [1], all templates have
been added to the OWL app. With OWL, a t-foreach in a template can no
longer loop over a 0 number and causes an error if we try to. This is
what happens here, as toggling off the "Pre-filled Options" option sets
the donationAmounts to 0, which is then used in a loop in the templates.

This commit fixes this by replacing the number by an empty array, so the
loop cannot fail.

[1]: https://github.com/odoo/odoo/commit/4703e4a2efa9213979307e4d3dedeedc61ad0fc3

task-3859207

closes odoo/odoo#161431

Signed-off-by: Soukéina Bojabza (sobo) <sobo@odoo.com>
2024-04-16 12:24:48 +00:00
Louis (loti) 90f16d0979 [FIX] *_loyalty: consider product domains for min amount to reach
Product domains were not considered when computing the min amount to reach to get a discount. For
example, if you created a discount with a minimum amount of 100 for product "X", the discount
would have been applied, even if the amount for "X" was less than 100, as long as the total amount
of the SO was at least 100.

After this fix, only products that match the domain will be considered when computing the amount
that should be compared to the discount's min amount.

opw-3626345

closes odoo/odoo#155085

closes odoo/odoo#162020

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Signed-off-by: Louis Tinel (loti) <loti@odoo.com>
2024-04-16 10:32:32 +00:00
Gauthier Wala (gawa) 994aef18c5 [FIX] account: analytic_distribution on counterpart of transfer
To reproduce:
- Create 2 lines with the same balance but only one has an analytic_distribution (of 100% on an analytic account).
- Create a transfer of accounts for these
=> The counterpart has a distribution of 100% or no distribution.
Indeed, we simply put the distribution of the last line.

It makes no sense: analytic "balance" is generated and does not reflect the transfer move.
We should make a prorata of the distributions of the lines to transfer.

closes odoo/odoo#161982

X-original-commit: dcfe607d48021902c88b79a571a15559434d1592
Signed-off-by: Laurent Smet (las) <las@odoo.com>
Signed-off-by: Wala Gauthier (gawa) <gawa@odoo.com>
2024-04-16 10:32:31 +00:00
luvi b4a798d843 [FIX] web: remove duplicate classname in RecordSelector
This commit removes the unnecessary duplicate of the 'o-input' class being present
in the template of the (Multi)RecordSelector components. As the RecordAutocomplete
component uses the Autocomplete component, which already set this classname on its
<input> node, the class was present twice in the DOM.

This could affect the style when trying to write a rule on .o_input since both elements
would get the style.

Now, only the input keep the class, which makes things easier and more predictable.

closes odoo/odoo#161934

Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
2024-04-16 10:32:29 +00:00
guva-odoo cfc072c475 [FIX] base_vat: greek vat number format
According to https://www.easytax.co/en/countries/greece
the vat number format for Greece is EL123456783
instead of GR12345670.
We also delete the line for country code `el`
from `_ref_vat` dict as we use `gr` for Greece.

opw-3845662

closes odoo/odoo#161955

X-original-commit: b97c74e43638d685b2af8ede4940f37b6a5cd031
Signed-off-by: Wala Gauthier (gawa) <gawa@odoo.com>
Signed-off-by: Guillaume Vanleynseele (guva) <guva@odoo.com>
2024-04-16 08:36:06 +00:00
Mahdi Cheikh Rouhou (macr) 537b8d354c [FIX] web_editor: position powerbox correctly in rtl direction
Issue:
======
The powerbox keep increasing in size when you input.

Steps to reproduce the issue:
=============================
- Install arabic
- Go to notes
- write `/`, you can see the powerbox is a bit smal
- use `down/up`arrows to navigate in the powerbox.
- The powerbox width increase until finally gets to it's intended
  position.

Origin of the issue:
====================
Since we are providing that `marginRigh` should be equals to `20` in
`getRangePosition` we will move the powerbox to the left a bit and then
with the style property `max-width=100%` it will increase in size
because the current size is a bit small for it. So at every key pressed
it will increase by 20px until it gets to a point where everything is
set and the `marginRight=20` is finally visible.

Soltuion:
=========
We set min-width as max-content so we can position correctly the
powerbox knowing it's final width.

task-3721794

closes odoo/odoo#161924

X-original-commit: b815447bf239049b37a3705cd014c67e3897ba9c
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Mahdi Cheikh Rouhou (macr) <macr@odoo.com>
2024-04-16 08:36:05 +00:00
lase@odoo.com 85a75d2d82 [FIX] project: assign copied task to copied project
Steps to reproduce:

- Create a project with a task with a sub-task
- Assign manually the sub-task to the project
- Create a product that creates a project based on this product template
- Create an SO with that product

> A copy of your project template will be created and assigned to the SO

Expected Behavior:

Just as in 16.4, the copy of the subtask created during this process
should be associated with the copy of your project template.

Current Behavior:

The subtask is associated with the original project template.

Cause of the issue/Fix:

Confirming the SO will call the copy method on your project template.
During this call copies of its task and sub-task will be created and
should then be remapped to the correct project/task using by the
`map_tasks` method call:
https://github.com/odoo/odoo/blob/f31174e02157e612650e77ebba3ed1fe54b96776/addons/project/models/project_project.py#L436-L437
This use to do the job correctly in 16.4 because of these lines:
https://github.com/odoo/odoo/blob/ce28edbaae5a9af0a8c6e1f2addf4285ec56e9e1/addons/project/models/project_project.py#L415-L419
However, these were removed by Commit 62e53fa, probably because the new
write method of the "project.project" model introduced by this commit
sometimes relies on the "project_id" of these tasks and this information
should be consistent with the future value of the  "project_id" of these
tasks. However, the "project_id" of these tasks should still be remapped
to the copied project at some point and in my opinion this should be
done before the new write method is called, so that this method can be
used correctly.

opw-3823013

closes odoo/odoo#160625

Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2024-04-16 08:36:04 +00:00
Augusto Perez 93e6541e83 [FIX] account: Fix mapping from xmlid to tax
Rewrite the mapping from xmlid to tax to only take into account
standard taxes from the 'account' module

closes odoo/odoo#161945

X-original-commit: d31f3382453a1d288b732e7cb2aa27b26dcfe645
Signed-off-by: William André (wan) <wan@odoo.com>
2024-04-16 07:02:58 +00:00
Odoo's Mergebot 0b2a8f5ba0 [FW][FIX] crm: avoid spurious date_open/last_stage_update
Before this commit:
  * when a user changes 'user_id' to set the same previous 'user_id', the
    assign date 'date_open' is updated but it should not as the responsible
    did not change;
  * when a user changes the salesperson 'user_id' of a crm lead, it triggers
    a recompute of 'team_id' that triggers a recompute of 'stage_id' that
    updates  'date_last_stage_update' even if the stage does not change, which
    happens frequently when changing leads within a given team (new assign,
    salesperson on holidays, ...)
  * when merging opportunities, 'user_id' can be set on the main opportunity
    which triggers a recomputation of both 'date_last_stage_update' and
    'date_open' as explained in above points;

Reason:
The 'date_last_stage_update' field depends on 'stage_id' which depends on
'team_id' which depends on 'user_id'. As a result, when 'user_id' changes,
'date_last_stage_update' also updates.

Moreover those fields are implemented using editable stored computed fields
which are triggered everytime a value is given to those fields, even when
the same value is given.

After this commit:
'date_last_stage_update' and 'date_open' will only update when there are
real changes.

Also fix 'date_open' update when lead is converted into an opportunity.
'date_open' is the date when a user is assigned to a lead / opportunity. It
should not be set when converting a lead to an opportunity, as those two
flows are different. Only setting a responsible should update it.

Task-3515225

closes odoo/odoo#161918

Forward-port-of: odoo/odoo#144848
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2024-04-16 07:02:57 +00:00
Thibault Delavallée 4672b525aa [FIX] crm: fix demo data date_open
date_open should not be set when there is no user_id set. Let us be coherent
so that we can see the effect of assigning users that updates the date_open
field.

Task-3515225

X-original-commit: 3720e5aefd7bf9971d0d7b6fc93fc90c1eeecad3
Part-of: odoo/odoo#161918
2024-04-16 07:02:57 +00:00
Thibault Delavallée f21801ec93 [FIX] crm: do not update assign date when converting a lead to opp
'date_open' is the date when a user is assigned to a lead / opportunity. It
should not be set when converting a lead to an opportunity, as those two
flows are different. Only setting a responsible should update it.

Task-3515225

X-original-commit: a3dbe23b83e7aae108ff72737c69c783e059f603
Part-of: odoo/odoo#161918
2024-04-16 07:02:57 +00:00
Jay Savaliya 1e45ec7b36 [FIX] crm: fix date_{last_stage_update/open} update issues
Before this commit:
  * when a user changes 'user_id' to set the same previous 'user_id', the
    assign date 'date_open' is updated but it should not as the responsible
    did not change;
  * when a user changes the salesperson 'user_id' of a crm lead, it triggers
    a recompute of 'team_id' that triggers a recompute of 'stage_id' that
    updates  'date_last_stage_update' even if the stage does not change, which
    happens frequently when changing leads within a given team (new assign,
    salesperson on holidays, ...)
  * when merging opportunities, 'user_id' can be set on the main opportunity
    which triggers a recomputation of both 'date_last_stage_update' and
    'date_open' as explained in above points;

Reason:
The 'date_last_stage_update' field depends on 'stage_id' which depends on
'team_id' which depends on 'user_id'. As a result, when 'user_id' changes,
'date_last_stage_update' also updates.

Moreover those fields are implemented using editable stored computed fields
which are triggered everytime a value is given to those fields, even when
the same value is given.

After this commit:
'date_last_stage_update' and 'date_open' will only update when there are
real changes.

Task-3515225

X-original-commit: 8dc18806847e5240dba6f05bdd80d313bf466ebf
Part-of: odoo/odoo#161918
2024-04-16 07:02:57 +00:00
Jay Savaliya 7eeeb52f44 [IMP] crm: add tests for assign / stage update dates
Just to see how it behaves currently, as we are going to fix some unwanted
changes. Notably

  * setting user_id to the same value as before should not update the
    date_open value;
  * setting stage_id to the same value as before should not update the
    last stage update value;
  * triggers generate chain update of those fields (changing team_id
    changes user_id that changes date_open, ...);

Task-3515225

X-original-commit: a1c72fff151524f636fae3f253d33b8228d0add9
Part-of: odoo/odoo#161918
2024-04-16 07:02:57 +00:00
Achraf (abz) 050a17de3f [FIX] hr_expense: Allow users to use optional_column
Since https://github.com/odoo/odoo/pull/120915

Steps:
	- Install `web_studio` and `hr_expense`
	- Open Expense/list view
	- click on optional column
	- Traceback

The error occurs because the dropdown needs the id of the view list in order to "hook" onto it.
This unique id is added via a `t-att-class` here

https://github.com/odoo/odoo/blob/saas-16.3/addons/web/static/src/views/list/list_renderer.xml#L7

and is used by the dropdown here

https://github.com/odoo/odoo/blob/saas-16.3/addons/web/static/src/views/list/list_renderer.xml#L50

The problem here is that the hr_expense module inherits from `web.ListRenderer` to add some classes to `o_list_renderer` with this

``xml
<xpath expr="//div[hasclass('o_list_renderer')]" position="attributes">
            <attribute name="t-att-class">'hr_expense h-auto o_forbidden_tooltip_parent'</attribute>
        </xpath>
```

but by doing so, the t-att-class of `hr_expense.ListRenderer` overwrites that of `web.ListRenderer`.

One solution was to do as the documents application does

https://github.com/odoo/enterprise/blob/saas-16.3/documents/static/src/views/list/documents_list_renderer.xml#L5

This does not override the `t-att-class`

opw-3858726

closes odoo/odoo#161846

X-original-commit: e4f222f0f05565301515ca020de3ae19c35bef06
Signed-off-by: de Wouters de Bouchout Jean-Benoît (jbw) <jbw@odoo.com>
Signed-off-by: Achraf Ben Azzouz (abz) <abz@odoo.com>
2024-04-16 07:02:56 +00:00
Sarah Bellefroid 2ee201e402 [FIX] point_of_sale: add missing test
This commit adds a test to protect the partial refunding of orders in the point of sale app.

This commit is an annex of https://github.com/odoo/odoo/commit/59ffd20113b8d42aa2d7d91511c41804a08e01c6 .

opw-3827876

closes odoo/odoo#161879

X-original-commit: 64091f8cd3f66bae7f8fc3bc152482f38bac0e1b
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Sarah Bellefroid (sbel) <sbel@odoo.com>
2024-04-16 05:53:14 +00:00
Nicolas Viseur (vin) 68f706bcd0 [FIX] account: credit limit inverse
While in practice you would never get this inverse
called with more than one record at a time, it is
still wrong to get the company of self in the loop.
Fixing it to keep good conscience :)

closes odoo/odoo#161979

X-original-commit: 56fe4f71f0cca2ca11624bd267e1dec4de2ac929
Signed-off-by: de Wouters de Bouchout Jean-Benoît (jbw) <jbw@odoo.com>
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
2024-04-16 00:41:54 +00:00
agrabsi 541251c79e [FIX] base_vat: vat_vies_container view priority
`base_vat.view_partner_base_vat_form` creates a new div `vat_vies_container` referenced by other views such as `l10n_mx_edi_stock.mx_partner_operator_form`

All these extension views have the same priority and in this case the later is trying to access the div before it is even created.

We fix this issue by changing the priority of the view that creates the div from 16 to 15.

closes odoo/odoo#161902

X-original-commit: 67e7289296ea12e69cb07864a2974cd5d4e46cf2
Signed-off-by: William André (wan) <wan@odoo.com>
2024-04-15 18:41:49 +00:00
Antoine Vandevenne (anv) f0016849c1 [ADD] sale_async_emails: allow sending order status emails asynchronously
This commit adds a new module to allow delaying the sending of sales
order confirmation emails, thus removing a performance bottleneck in the
order confirmation flow.

This is particularly useful for "flash" sales in which a large number of
event tickets are sold in a very short time span. When the emails are
scheduled to be sent right away, the email rendering that is part of the
payment post-processing keeps the worker busy. When the system parameter
`sale.async_emails` is set to `True`, the email rendering is delegated
to a cron, allowing the payment post-processing to execute much faster.

task-3782827

closes odoo/odoo#157612

Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2024-04-15 16:21:47 +00:00
Guillaume-gdi 9f319cbc95 [IMP] web_editor, website: add database ID to OLG calls
This commit adds the database ID to the IAP calls made to generate text.
It permits to prevent abuses of OpenAI calls.

task-3740440

closes odoo/odoo#154615

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2024-04-15 16:21:46 +00:00
Florent de Labarre 0f0a9845fc [FIX] mail: bounce incoming email with catchall email and other unroutable emails
How to reproduce
- Send an email to catchall@exemple.com, random@exemple.com
(Note : random@exemple.com is an email witch does not exist)
--> Issue the email is not bounced

To justify the change, this was actually the behavior a while ago, prior to odoo-dev@68a457e
The intent of that commit was to consider other possible routes, so this commit
doesn't contradict the change.

Task-3714565

closes odoo/odoo#161782

X-original-commit: df0c05afbf81ce41c9b1b4cfe93476d4ca397749
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2024-04-15 14:09:45 +00:00
Gaetan Vanden Bergh (gavb) 7c5a2c601d [FIX] hr_skills: Add skill from "My Profile"
Steps:
- Login as "Mitchel Admin"
- Install hr_skills_survey
- Delete all employee except "Mitchel Admin"
- Open "My profile"
- Open "Resume"
- Add a skill

Actual result:
- Error due to missing employee
- default_employee_id is using the current record id so a user id
- default_employee_id is not the correct ID
- Can lead to record not existing error or access error

Expected result:
- No error
- default_employee_id is the correct employee of the user
- Default employee in dialog is "Mitchel Admin"

opw-3852542

closes odoo/odoo#161636

Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
2024-04-15 14:09:44 +00:00
Walid 1648ee1abf [FIX] stock_landed_costs: skip display lines in reconciliation
Steps to reproduce:
- Create a vendor bill with landed costs
- Add section and note lines
- Try posting the bill (ERROR)

Bug:
display lines should be skipped

opw-3715660

closes odoo/odoo#161791

X-original-commit: 3174c4a793f24782d835a15d96376e45b5f333e4
Signed-off-by: Walid Hanniche (waha) <waha@odoo.com>
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2024-04-15 09:10:20 +00:00
lase@odoo.com 094447485c [FIX] base: change the adress format in Luxembourg
Steps to reproduce:

Create and print an SO for a customer based in Luxembourg

Expected behavior:

According to Bpost and to the Post of Luxembourg, the zip code should be
displayed before the city name in the address format in Luxembourg.

Current behavior:

The zip code is displayed after the city name.

opw-3791142

closes odoo/odoo#161738

X-original-commit: 83b38fab6cc69d0ed2c6abae34f2b4e76ef8a601
Signed-off-by: Lancelot Semal (lase) <lase@odoo.com>
2024-04-15 09:10:19 +00:00
Andrea Grazioso (agr-odoo) 5f1bfa84c5 [FIX] l10n_it: 0% S tax invoice repartition line tag
In IT localization open tax "0% S (Services)"
Issue: invoice repartition line tax tag is "+02", it should be "+03"

opw-3860109

closes odoo/odoo#161696

Signed-off-by: Wala Gauthier (gawa) <gawa@odoo.com>
2024-04-15 09:10:18 +00:00
Arnold Moyaux 5c7be00378 [FIX] mrp: run_pull in store after manufacturing more generic
There is 2 issues with it:
- People that want to use multiple picking type or multiple store after
  manufacturing locations. It's not possible since the equals is strict
  on the warehouse store after manufacturing picking type.
- The procurement group always use the default manufacture picking type
  and ignore the picking type on the manufacture rule that will be use.

This commit checks if the location is a child of the post production in
order to create the procurement group. It would be an issue for people
having multiple step in post prod. But it could be fix by using a subset
of the warehouse post production location.

Check if we have a manufacture rule with the same warehouse in the
current route. It's not perfect but it could give a more accurate result than
today.

closes odoo/odoo#161690

X-original-commit: f82a0f2ea8f3c57bae915520f9e4a25b54b81ce4
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2024-04-15 09:10:17 +00:00
mizosoft 50e55bd8dd [FIX] account: add search field to reconciliation models based on name
Issue
-----

Reconciliation models are not searchable by specific fields (e.g. name).

Steps
-----

 - Open Accounting -> Configuration -> Reconciliation Models.
 - Try typing something into search.
 - No field are suggested to search on.

Cause
-----

No search fields are defined for `account.reconcile.model`, only filters.

opw-3847744

closes odoo/odoo#161648

X-original-commit: 973ad96c7cf4b37fbdeea463bbf676cfee920975
Signed-off-by: Wala Gauthier (gawa) <gawa@odoo.com>
2024-04-15 09:10:16 +00:00
lase@odoo.com 6a177c503d [FIX] hr_recruitment: notify interviewers followers
Steps to reproduce:

- Change the recruitment access rights of Marc Demo to "Interviewer".
- Go to Recruitment > Applications > All Applications.
- Create a new application and add Marc Demo as follower of the chatter.
- Write and send a message on the chatter.

> Marc Demo will not be notified

Expected behavior:

As discussed the PO of the recruitment module (gmf), since users with
"interviewer" access rights have access to the chatter and since the
sensible informations are now shared via the salary offer model instead
of relying on the chatter of the application model, the followers of the
chatter with "interviewer" access rights should be notified if pinged on
a log note or if a general message is sent.

Cause of the issue:

Since sensitive informations used to pass through the chatter, users
with "interviewer" access rights did not have access to it, and were
removed on purpose from the recipients of the notifications:
https://github.com/odoo/odoo/blob/cd6ed7f9fd2e0654cfb0672d7a9536dca21035cf/addons/hr_recruitment/models/hr_applicant.py#L376-L379
to avoid any leak of sensible information.

Note:

This access right did not exist before saas-16.4

opw-3783965

closes odoo/odoo#161198

X-original-commit: 6e8795cf5a7d51c4682941a253fb158e8e7e874e
Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
Signed-off-by: Lancelot Semal (lase) <lase@odoo.com>
2024-04-15 09:10:11 +00:00
Guga 3ff2775b8f [CLA] Add signature for Gugizm
closes odoo/odoo#160844

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2024-04-15 09:10:09 +00:00
Daniel Kosky (dako) 4a522be2c1 [FIX] l10n_ke_edi_tremol: price decimal length
An update made to the tremol device has changed the expected content of
the price field. It now expects up to 15 characters in this position,
with a maximum of 5 decimal places.

At present we can send prices with a decimal position greater than 5,
doing so will result in an error from the fiscal device.

This commit adapts the content that gets serialised in order to ensure
that the decimal provided is no longer than 5 decimal places.

closes odoo/odoo#161804

Task-id: none
X-original-commit: 3373ac3a7945d25fee70d114816ce23a16d6e0ef
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Daniel Kosky (dako) <dako@odoo.com>
2024-04-14 21:02:42 +00:00
suth-odoo bad8b1e837 [FIX] l10n_in: fixes warning issue & allow the user to confirm the vendor bill
Steps to Reproduce :
- install indian Accounting module
- click on invoice
- go to vendor bills
- create new

Issue:
- while creating new and confirming, it will throw a warning message,  as this
 warning required only for eInvoice only (while confirming the invoice) not for
 vendor Bills.

Cause:
- while generating warning message there is no specific condition like that it
 is not for vendors

Solution:
- if we gave condition that this warning message is only for out_invoice then
  the issue will be solved.

task-3657558

closes odoo/odoo#161333

X-original-commit: 6480dccfea696e759d0ed4225f4edc033adbfc0e
Signed-off-by: Julien Van Roy (juvr) <juvr@odoo.com>
Signed-off-by: Laurent Smet (las) <las@odoo.com>
2024-04-14 09:28:07 +00:00