Commit Graph
164380 Commits
Author SHA1 Message Date
Valeriya(vchu) c360a6e047 [IMP] base, payment: prevent changing currencies' rounding precision
- discourage users from changing the currency's rounding precision by
  making it editable only before the currency is saved;
- remove the hard-coded dict of minor units that util functions rely on.

task-3076355

closes odoo/odoo#119308

Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-07-04 11:35:00 +02:00
Guillaume (gdi) 65cae53535 [FIX] website: disable products carousel slide in edit mode
We have a public widget that disables automatic slides on carousels when
the user is in edit mode (see `registry.slider`). Unfortunately, since
[this commit], the automatic slide of the carousel in the "Products"
block was not disabled in edit mode. This was because a
`widget_start_request` was made without specifying whether the user is
in edit mode. When it's not specify, we consider that we are not in edit
mode. As a result, the public widget no longer stopped the carousel
because it considered that it was not in edit mode. This commit fixes
this problem by correcting `widget_start_request`.

Steps to reproduce the bug fixed by this commit:
- Have an ecommerce
- Edit a page
- Drop the "Products" block

=> If you wait a few seconds, the carousel moves, even though it
shouldn't as long as you're editing your site.

[this commit]: https://github.com/odoo/odoo/commit/7af099ccf1e5892513c1b0827553fe93614f2f07

task-3356629

closes odoo/odoo#127185

X-original-commit: 4231aca9665829673e29a027469471743dab16c4
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Guillaume Dieleman (gdi) <gdi@odoo.com>
2023-07-04 10:16:29 +02:00
Aurélien Warnon d353e91c26 [FIX] website_slides: failsafe when sharing content without a template
This commit implements a failsafe when trying to share a slide.slide by email
using the "Share" button in the course view.

Instead of a traceback, the user will now receive a clear error message.

Complementary to odoo/odoo#117952 that only handled sharing courses.

Task-3343052

closes odoo/odoo#127172

X-original-commit: 67a43047a0f81036abeae44c44ab05dd781238bb
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-07-04 10:16:23 +02:00
Matheus Leal Viana (malv) f69a6f3749 [FIX] point_of_sale: filter not invoiced orders in pos reporting
Versions:
---------
- 14.0+

Steps to reproduce:
-------------------
1. Go to POS -> Start a new session
2. Sell some orders and make some of them not invoiced and invoice the others
3. Go to POS -> Reporting -> Orders
4. Filter by not invoiced -> the chart becomes empty

Issue:
------
The filter for not invoiced orders in POS reporting is not working properly

Cause:
------
The filter not_invoiced is only filtering the orders with state paid, but it is
ignoring all the orders with state done

Solution:
---------
Add the state ‘done’ in the not_invoiced filter

OPW-3349139

closes odoo/odoo#127155

X-original-commit: 6546597fc63771951b28dd819896ea54de16b9da
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-07-04 10:16:15 +02:00
Mathieu (mano) 0e8e7935aa [FIX] *: onboarding reduce the darkness of the grey
Issue: the onboarding background is too dark and the view could breath
more on large screens

Fix: Use a slight linear gradient to reduce the darkness feeling and
add responsive spacing

task-3378939

part of: task-3326263

closes odoo/odoo#127152

X-original-commit: bcffa4145b9fcc7200784088f858ff4147a00e49
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-07-04 10:16:13 +02:00
tsm-odoo 00be461524 [IMP] im_livechat: improve operator assignation
This PR improves operator assignation for livechat channels
by first trying to match an operator with the same lang than
the visitor then an operator of the same country.

part of task-3332872

closes odoo/odoo#125911

Signed-off-by: Didier Debondt (did) <did@odoo.com>
2023-07-04 10:16:07 +02:00
hupo-odoo 51468d3484 [IMP] account: days of sales outstanding per customer
Add a read only field which enables to visualize the DSO ratio (days of sales outstanding) when determining a credit limit for a specific customer on the partner page. This helps the user to know in how many days its customers pay their invoices. In our case, we needed to adapt the computation of the DSO for a single customer. The computation is therefore: DSO = [(Total Receivable/Total Revenue) * number of days since the first account move] for this customer. The amounts used are tax included. If this number is large, it means this customer takes a large number of days to pay the invoices, while a short number means it pays fast.

task : 3196659

closes odoo/odoo#113296

Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
2023-07-04 10:16:05 +02:00
Chrysanthe (chgo) 404d8532c4 [FIX] stock: modal buttons spacing
=== BEFORE ===

Buttons inside the modal were missing a gap in-between. There are also
two other buttons on the right side of the modal but these don't need a
gap because they have no background.

=== AFTER ===

We add a combination of `d-flex` and `gap-1` class to space the button
consistently with other modules

task-3389116
part of task-3326263

closes odoo/odoo#127153

X-original-commit: e1a3d599acafe55bd4b432bf9495ebbd4eee33c7
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-07-04 09:04:52 +02:00
Benoit Socias 2b7cbddd9b [IMP] website: avoid fetching page dependencies with each key press
The `PageDependencies` obtains the page dependencies from the server
during its `onWillStart`. If the parent component state changes before
the component is mounted, Owl destroys and creates a new one.
This is the case if the server response is not obtained before the
value of the URL field is modified again.
Because of this, if the user types quickly in the URL field, an RPC
is sent for each key press.

This commit obtains the dependencies in a `useEffect` that is run only
once (instead of inside the `onWillStart`), and only after the
component is mounted. It stores them in the `state` so that they are
rendered once they are obtained.

Steps to reproduce:
- Open Website > Site > This page > Properties.
- Type quickly in the URL field.

=> One RPC was sent per key press.

task-3169376

closes odoo/odoo#127125

X-original-commit: a65d8811119f4d1a044be3e140fd0c27ad1cf823
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
2023-07-04 09:04:47 +02:00
Mohit Beniwal e7fd1d43ba [FIX] base: prevent json decoder error for default values
JSONDecoderError occurs when users enters invalid JSON format data in
'Default Value' field inside 'User-defined Defaults' and wherever this field is
being accessed to get default value this traceback will be generated.

Steps to reproduce:
1) Install 'Contacts' module.
2) Open 'Settings' > 'Technical' > 'User-defined Defaults'.
3) Click on record 'Language' > 'EDIT' button > in 'Default Value' field enter
   any improper JSON format data (e.g 'Maa' : FI ) .
4) Now, open 'Contacts' module > click on 'CREATE' button and traceback would be
   generated.

By applying this, it will check for proper JSON format.

Sentry-4169062951

closes odoo/odoo#126932

X-original-commit: 71b32d9ea892c8a79c8eac51b9f394c92c44f45d
Signed-off-by: Rémy Voet (ryv) <ryv@odoo.com>
2023-07-04 09:04:44 +02:00
bve-odoo 5a7885dd8d [FIX] base: context propagation make archived mail server usable
In 15.4 (with a226bd983b94a11af9b9785b753634213141127f)
was introduced the from_filter on the system param
and mail servers that would determine which
mail server should be use to send emails out.

In 15.5 (with dbb62515bc1772a79d336e8c2fc0bd1653f1f7ca)
was implemented a fix to prevent the usage of the
archived mail servers.
An email that is going out using an archived outgoing
mail server will be blocked with a specific error msg.

However, when doing specific flows, the context
active_test would be propagate and the function,
doing the search of the mail server to use,
would take into consideration an archived mail server
(the best matching depending on the from_filter param
-- see _find_mail_server fonction).

In order to reproduce this bug, here is one of the way
to do so (on runbot, local needs to add the CLI SMTP
args):
1/ Install sale_management and crm (including contacts).
2/ Add an outgoing email server and archive it.
3/ Go through a contact to an opportunity,
4/ Convert the opportunity to a new quotation,
5/ Send it by email (should be in quotation sent state)

Email will be failed with an error msg
"Connection failed (outgoing mail server problem)".
On the technical > Emails:
The server "<OMS name>" cannot be used because it is archived.

opw-3349593
opw-3341324

closes odoo/odoo#127187

X-original-commit: 716d07b49597ca2583a8e6587f1f530cca5ee8a7
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-07-04 07:55:39 +02:00
Dylan Kiss (dyki) 0d189590cd [FIX] account: keep modified tax amount
Currently when saving a miscellaneous journal entry, we always recompute
the taxes and modify them to be exactly as calculated by us.
However a user could also modify taxes based on a document he got from
a supplier, where the tax might be 1 cent off.

Before this change: On save, we recompute the taxes and override the
user's modification.

After this change: If the user manually modified the taxes, we don't
touch them anymore on save.

task-3262448

closes odoo/odoo#127166

X-original-commit: 8752013127160334c1690518586531fabd6d3f18
Signed-off-by: William André (wan) <wan@odoo.com>
2023-07-04 07:55:36 +02:00
Carsten Wolff (cawo) 0778891cc9 [FIX] account: avoid unneeded updates during chart data reload
During upgrade, l10n migration scripts that call `try_loading()` can cause an
exception _You cannot switch an account to prevent the reconciliation_ in
`_toggle_reconcile_to_false()` of model `account.account`.

This is caused by new chart template data containing a _False_ value for the
_reconcile_ field, while the already existing record has this field set to
_True_. Under this constellation, the code path leads into
`_toggle_reconcile_to_false()`, which checks for partial reconciliation and
throws the exception when the record is under partial reconciliation.
Also, the update of existing account.account data from the default data
triggers a lot of superfluous re-computes.

To avoid both the update of the reconcile field as well as other unnecessary
updates that trigger superfluous re-computes, filter the default data in the
update case to only update `tag_ids`. This is done after the code that fixes
XMLIDs to be sure about whether the record is being updated or created.

closes odoo/odoo#127099

X-original-commit: 2a8100e9ee8d49a957c1aab21a5a533a28dc2060
Signed-off-by: Carsten Wolff (cawo) <cawo@odoo.com>
Signed-off-by: William André (wan) <wan@odoo.com>
2023-07-04 07:55:21 +02:00
flvr-odoo 960eb211f0 [FIX] auth_signup: added a check for internal_user
add a write permission check on internal user to quietly dismiss the
error upon landing on the user page

closes odoo/odoo#127094

X-original-commit: ec85785b4629b474d96d070a5a8b44b9ba5f9dcb
Signed-off-by: Vranckx Florian (flvr) <flvr@odoo.com>
2023-07-04 07:55:16 +02:00
Brieuc-brd 33b051ac79 [FIX] web: fixed width for icons in view_button
Since the introduction of Milk design[1], the fixed width for icons has
been removed in `view_button`.
This creates alignment issues when we have several buttons with icons
displayed in a grid or list (eg. status buttons).

This commit fixes this issue.

[1] commit 824024f

task-3387198
Part of task-3326263

closes odoo/odoo#127090

X-original-commit: a801dc6c74031e5593063ccac0245b2fe32c8ef3
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-07-04 07:55:13 +02:00
Lucas Lefèvre e136b43e9b [FIX] spreadsheet: use localized week start
Steps to reproduce:
Go to CRM pivot view, group create_date by week, insert into spreadsheet.
=> week numbers are offset by one (W23 instead of W24)

Since 3a177c448, `read_group` returns week aggregates according to the
user's language first day (e.g Sunday for en_US, Monday for fr_FR).

Before the commit, it was always Monday (ISO week start).
This commit changes the moment formats from "W" (Week of Year (ISO)) to
"w" which is the localized week of year*.

Note there can still be some inconsistencies if the browser language is
different than the user's language. This hasn't changed and is a regular
known issue.

* https://momentjscom.readthedocs.io/en/latest/moment/04-displaying/01-format/

opw-3372581

closes odoo/odoo#127089

X-original-commit: c5738479dc1c1879a9ac0169e1ec87eb5098c525
Related: odoo/enterprise#43516
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2023-07-04 07:55:08 +02:00
Guillaume (guva) c373be77b6 [FIX] account: date on cash basis move
When having lock date for non advisor
set before all user lock date, reconiling
lines between the two lock dates leads
to a wrong calculation of the cash basis
move, even for user with advisor rights.

Steps:

- With a company having cash basis activated
- Set a period_lock_date to a specific date
- Set a fiscalyear_lock_date one month later
  than period_lock_date
- With user having Advisor rights, create
  an invoice between the two lock dates
- Register a payment in the same period
-> Cash Basis move is created with date == today,
   it should be the date of the payment.

opw-3245409

closes odoo/odoo#127060

X-original-commit: ffb9230afbfb5b0f76148e102463e37a55b42f64
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
2023-07-04 04:54:42 +02:00
Alexandre Kühn 987eeef710 [FIX] mail: debounce suggestion (and channel selector) searches
Before this commit, fetching suggestions (e.g. channel selector
in discuss sidebar "Find or create a channel", or `@`-mentions)
were performing RPCs on each user input, resulting in wasted
network and server load.

This commit fixes the issue by debouncing the fetching of
suggestions to 0.5 sec.

closes odoo/odoo#126952

X-original-commit: 6770ac3
Related: odoo/enterprise#43502
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-07-04 03:43:48 +02:00
Hugo Carlier (Huca) 9c338783af [FIX] project: avoid invalid subtask when customer is required (FSM)
Steps
=====
- Install module industry_fsm
- Create a task from the kanban view
- In the form view, add a title but no customer
- Open the subtasks tab of the notebook
- Add a subtask and add a title to it
- Save the created parent task
- A pop-up indicate that the customer is missing
- Add a customer and save the task

Issue
=====
A pop-up indicate that the subtasks field is invalid and there is no way
to save the current task with its subtask.

Cause
=====
the module industry_fsm introduces a required=True for the field
"partner_id" when edited from a view in the app Field Service. When a
parent task is created without a "partner_id" id set, it can not be
saved, but subtasks can still be created from it. Those child tasks
should have the "partner_id" set to the same value as the one of their
parent. As it is not set in the parent task, its value will be False for
the child task, and changing it in the parent task (by adding a
customer) will not update the child task. As this field is required when
a task is edited from the app Field Service, the task can not be saved.

Fix
===
A dependency to "parent_id.partner_id" is added to the method
"_compute_partner_id" of model project.task allowing to updating it if
needed when a "partner_id" is set on the parent task.

task-3343423

closes odoo/odoo#127088

X-original-commit: 7f8da6a4148c86b61d994bf692725378f8dafc52
Related: odoo/enterprise#43515
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-07-04 00:51:56 +02:00
Louis Wicket (wil) ce07b37111 [IMP] mail: make channel_info private
Make `channel_info` private so that it is no longer exposed to RPCs.

closes odoo/odoo#127078

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-07-04 00:51:54 +02:00
Thomas Lefebvre (thle)andFeyensv 0d0546c455 [FIX] website_sale_loyalty: set price_subtotal for reward
Steps to reproduce:
-------------------
- create a product that costs 100 with 10% tax excluded;
- create a discount program to obtain 10% discount on the order;
- configure website to display tax excluded;
- go to ecommerce and create a cart with the product;
- apply the discount program.

Issue:
------
The price shown for the discount is tax included (i.e. 11)
and not tax excluded (i.e. 10).

Cause:
------
Set the field `price_unit` during `new` will trigger
a chain of compute methods that will falsely modify
the value of `price_reduce_taxexcl`
(because will modify `price_subtotal`).

Solution:
---------
Set the value of `price_subtotal`,
to compute the `price_reduce_taxexcl` field.
In this way, `price_reduce_taxexcl` and `price_reduce_taxinc`
can be used if the website displays tax included or not.

opw-3302488

closes odoo/odoo#127072

X-original-commit: dd6c01f07c3bf1caa9545108429bf6537a7fef32
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Signed-off-by: Thomas Lefebvre (thle) <thle@odoo.com>
Co-authored-by: Feyensv <vfe@odoo.com>
2023-07-04 00:51:51 +02:00
Alex (roal) f3212ccede [FIX] tools: fix TypeError in literal_eval
A TypeError is thrown when an AST node is passed to `literal_eval`
because a string is expected and the object has no len().

Check the type of the expression and make sure it's a string before
calling len() on it.

closes odoo/odoo#126874

X-original-commit: 28b5cbb33a99cdca00daa35e5ae598cc8d4b2dae
Signed-off-by: Vranckx Florian (flvr) <flvr@odoo.com>
2023-07-03 21:56:06 +02:00
David Monnom (moda) 0ae2b9a3f2 [IMP] pos_self_order: change authorisation token
Previously, access_token were linked to tables. These tables were linked
to a floor_plan, which could be linked to several pos_configs.

The only way to access the self-order was to obtain a valid table
access_token. This behaviour was not correct because sometimes we would
allow table selection directly in the interface or commands without
a table.

Now, access_token is managed by pos_config. When a user has this token,
they can place commands and select the table they want if the option is
enabled.

closes odoo/odoo#126186

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-07-03 21:56:04 +02:00
tsm-odoo 61ef69a8cf [IMP] im_livechat: small name, ui changes
This PR improves several things linked to visitors in the discuss
app:
- Change window header to "Visitor #, country"
- Change operator's name to Online Chat name if defined
- Rename "Public user" to "Visitor #", add country instead of website
- Change name of the thread to "Visitor #, country" (left panel + header)
- Remove "Website" from visitor's name (small and big threads)

part of task-3332872

closes odoo/odoo#125931

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-07-03 21:56:01 +02:00
tsm-odoo 7ec8d66ce4 [IMP] im_livechat: improve livechat channel kanban
This PR improves livechat channel kanban:
- Remove image field (always the same and does not bring value)
- Replace the count of operators by the many2many_avatars widget with connected users
- Join button as secondary button, Leave button color should be primary
- Add options from channel card: Ratings + configure
- Compute ratings based on last 2 weeks on channel's card
- Highlight active channels (at least one operator)

part of task-3332872

closes odoo/odoo#125769

Related: odoo/enterprise#42852
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-07-03 21:55:56 +02:00
Ali Alfie (alal) 3c6c6e6bb3 [IMP] web: rename cancel button in RedirectWarning to close
"Cancel" button in the RedirectWarning is renamed to "Close"

task-3339621

closes odoo/odoo#125751

Signed-off-by: Quentin De Paoli <qdp@odoo.com>
2023-07-03 21:55:53 +02:00
prye-odoo 7694f012cd [FIX] *: handle unlink/create access for reporting views
*: account,event_sale,fleet,hr_attendance,hr_contract,hr_timesheet,
im_livechat,point_of_sale,project

When the user tries to delete a record(s) from the reporting views,  this
traceback will be generated.

Steps to produce (Example only):

- Settings > Technical > Actions > Window Actions
- Search for the Work Entries Analysis. Open it and add a 'tree' as view_mode
in that action.
- Payroll > Reporting > Work Entries Analysis menu and select the tree view.
- Select one or more records and try to delete these records.

Error: A traceback appears: "cannot delete from view "hr_work_entry_report"

Handled the unlink access by using their model access of the reporting models.
similarly, this issue resolves in other reporting models.

Sentry-3975590063

closes odoo/odoo#125697

X-original-commit: 209d8c76ce9bb1d6cc7084d55b5623e939af8fbc
Related: odoo/enterprise#42825
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2023-07-03 21:55:48 +02:00
divy-odoo 1c2c46d96b [FIX] website: dynamic product snippet error on prev/next
The issue occurred after the merge of this PR [1]. In that, we removed
the dependency on underscore.js and introduced new functions to the
qweb engine: `range` and `uniqueId`.

The variable named `uniqueId` was clashing with the qweb function
`uniqueId()` that's why variable were getting compiled as a function
instead of the actual value, which led to unexpected behaviour.

This commit renames the uniqueId variable to avoid conflicts with the
qweb function `uniqueId()`.

[1]: https://github.com/odoo/odoo/pull/123018

task-3357115

closes odoo/odoo#124659

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-07-03 21:55:45 +02:00
Saurabh Choraria 5ee7fa1e29 [FIX] auth_signup: prevent traceback while connection refused of SMTP server
When there is no valid outgoing mail server and user tries to send email by
'send an invitation email' or 'send password reset instructions' button, it
shows the error in our locolhost.

see this traceback : https://tinyurl.com/2fdn2m5z

steps to reproduce :
    1. Go to users in settings and select a user.
    2. Click on 'send an invitation email' or 'send password reset instructions'
       button
    3. the error will occur.

Applying this commit will resolve this issue.

sentry-3961333326

closes odoo/odoo#117613

Signed-off-by: Achraf Ben Azzouz (abz) <abz@odoo.com>
2023-07-03 21:55:43 +02:00
pedrambiria 4f19f2040a [FIX] pos_loyalty: correctly compute discount with existing discount
Before this commit, if you have a discount promotion on the order,
adding a free product reward would change the discount incorrectly.

The problem is that in the `_getDiscountableOnSpecific` function the
non-discount rewards weren't excluded from `discountLinesPerReward`.

opw-3276337

closes odoo/odoo#127003

X-original-commit: 914dad0d23df4c3f8a117252a8159c07df9ee8ad
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-07-03 19:57:49 +02:00
Mathieu Duckerts-Antoine 1c2c18a0a5 [FIX] web: domain selector: invalid path/operator
We make the domain selector accept any expressions in the first and
second components of a domain condition. Along the way, we have found
necessary to refactor the Tree type (see domain_tree.js) and use it
directly in the domain selector instead of having yet another auxiliary
structure. Another simplification brought by this commit is that the
virtual operators is, is_not, set, and not_set are introduced earlier
and make possible to simplify the way operators are managed.

closes odoo/odoo#126350

Related: odoo/enterprise#43161
Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
2023-07-03 16:58:55 +02:00
Mathieu Duckerts-Antoine b72791f05b [REF] web: remove unused props in TagsList
Some props like className were declared as optional in TagsList while
they are not used by the component. We remove them from the props
declaration.

Part-of: odoo/odoo#126350
2023-07-03 16:58:55 +02:00
Mathieu Duckerts-Antoine 2b23f73f51 [IMP] web: domain selector: use TagsList in TagInput
We make TagInput use the generic component TagsList. This gives a better
looking/working to the editors used for the operators "in"/"not in" for
char fields.

Part-of: odoo/odoo#126350
2023-07-03 16:58:55 +02:00
Mathieu Duckerts-Antoine 1b94eefe26 [FIX] web: domain selector: treat false,true as in py interpreter
A string representation of a domain like "[('bar', '=', false)]" is
evaluated by py.js the same way as "[('bar', '=', False)]".So both domains
are recognized as correct while false is not a valid python expression.
We do the same in domain selector, the expression "false" ("true")
will be understood as "False" (resp. "True").

Part-of: odoo/odoo#126350
2023-07-03 16:58:54 +02:00
Mathieu Duckerts-Antoine 089e0e680c [IMP] web: domain selector: in/not in labels
We change the label of "in" to be "is in". The label of "not in" becomes
"is not in"

Task ID: 3291990

Part-of: odoo/odoo#126350
2023-07-03 16:58:54 +02:00
Mathieu Duckerts-Antoine 7a13c3f3d0 [IMP] web: domain selector: getDefaultFieldValue should know operator
The computation of the default value used by an editor used to assume
that the (default) operator is equal. We now pass the operator info to
getDefaultFieldValue in order to be able to have a different default
operator ("in" will become the default operator for relational fields).

Part-of: odoo/odoo#126350
2023-07-03 16:58:54 +02:00
Mathieu Duckerts-Antoine 03858851a9 [REF] web: domain tree: add negate key
The key negate is defined as mandatory in the definition of the type Tree.
We add them at some places (event if it did not pose a problem for now:
undefined and false are both falsy).

Part-of: odoo/odoo#126350
2023-07-03 16:58:54 +02:00
Ahmed Khalaf e8284f1afa [IMP] stock: break move_dest_ids link on location change
Before this commit, if a move is followed by a second move, if the destination
location of the first move is changed, and done, the second move will be assigned
and reserving from the new location.

This commit, compares the location destination of the move in `_action_done` with
the move_dest_id source location and breaks the link between them if they don't match,
the first move would trigger push rules if any exist and the destination move is set to MTS
to be able to reserve qty from the its source location.

Other minor improvements:
-Recomputes the state of the move when creating a backorder to correct
the backorder picking state.

-Recompute the state of move_dest_ids linked to PO when cancelling the PO
to show that it is converted to MTS.

closes odoo/odoo#123759

Task: 3321842
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2023-07-03 16:58:47 +02:00
Antoine Vandevenne (anv) d41b7a1f48 [CLN] payment(_stripe): cleanup of ee963d10
closes odoo/odoo#127054

Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-07-03 15:37:37 +02:00
Didier (did) 56582ee3c0 [FIX] im_livechat: archived chatbot not active on the frontend
task-3374783

closes odoo/odoo#127052

X-original-commit: 2250585c21c4ad10622ed009bd4c12b82f13d945
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Didier Debondt (did) <did@odoo.com>
2023-07-03 15:37:34 +02:00
Géry Debongnie 4a5dc95fb3 [FIX] sale: sol_product_many2one should not crash
The `sol_product_many2one` field is a sub many2one field that should
open the proper configuration system, such as the product configurator.

Before this commit, when inputting some data, then clicking on another
notebook tab, we would often see a crash, because the field has been
destroyed (since it is no longer in the current tab) and it tries to
open the configurator, which requires rpcs.

It is usually a problem when a destroyed component tries to perform some
work. Note that it happens at creation and update. Also, the field
overrides some many2one methods that display confirmation dialog. To fix
this, this commit simplifies the field by only calling the configuration
methods when its value has changed. This is a different strategy that
does not interfere with the many2one basic features. Also, it does not
crash since it will only call the configuration methods on patched, so
it is guaranteed to be alive.

It is certainly not a complete solution, since we should probably move the
code somewhere else not in a field widget, but this would require a
redesign of the code, so it is not appropriate in a bug fix anyway.

Note that the tour had to be adapted, since now the methods
_onProductUpdate/_onProductTemplateUpdate are now called in an effect
(so after a render), which is slightly later than before. But the tour
would click on confirm even before the product update code was executed,
which means that the product was not properly configurated.

This is clearly a concurrency problem: the product configuration code
should be properly coordinated with the basic model, but doing so is a
significative change. Also, in practice, it is not worse than before
this commit.

opw 3178297

closes odoo/odoo#127048

X-original-commit: de7a6f5f3d83356eb02f8fc25b4a0b8aabb946b3
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-07-03 15:37:32 +02:00
Nshimiyimana Séna c0bff2262f [FIX] account: payment state when reconciling refund with bank statement
**Summary**

Currently, if you create a credit note/refund and reconcile it directly
with a statement line (without creating a payment), the
credit note/refund ends up in the "reversed" payment state, whereas it
should be "paid".

**Setup**

- Install `account_accountant`

**Steps to reproduce**

- create a credit note/refund and confirm it
- create the corresponding bank statement line
- reconcile those two

Go back to the credit/refund not, you should see that its payment state
is "reversed", instead of "paid".

opw-3328830

closes odoo/odoo#127027

X-original-commit: 2dd3fa7d4d367e38baf529fdde5d18caa2f238cf
Signed-off-by: Laurent Smet (las) <las@odoo.com>
Signed-off-by: Séna Serge Nshimiyimana (sesn) <sesn@odoo.com>
2023-07-03 12:21:12 +02:00
Julien Mougenot 5b2593e675 [REF] web: Make datetime hook independant from props
This commit makes the datetime hook independant from the props update
mechanism it previously relied on (onWillStart & onWillUpdateProps) to
update its internal props.

This was an incoming issue as the future relational model will rely on
fine-grained reactivity to update the fields rather than updating the
model and re-rendering all child components (effectively calling
'onWillUpdateProps').

Now, the hook relies on an internal state that tracks whether the props
given by its caller changed from one render to another, which is checked
at render time (i.e. in 'setup' and 'onWillRender').

closes odoo/odoo#125039

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-07-03 12:21:05 +02:00
Julien Mougenot e74672d71d [REF] web,*: Centralize shallowEqual
Before this commit, 2 implementations of a "shallowEqual" function
coexisted, one in 'web/core/utils/objects.js' and another in
'web/core/utils/arrays.js'.

This commit only keeps the one in objects.js and makes the other simply
import and export it as well (easier to maintain while also easier to
find for those who want to work with arrays), while also taking an
optional comparison function argument in case the comparison needs to be
more specific (e.g. compare DateTime objects).

Part-of: odoo/odoo#125039
2023-07-03 12:21:05 +02:00
luvi 592794b397 [IMP] web: support new enable_formatting boolean option
This commit adds the enable_formatting option to integer and float
fields. This allow an input to display and handle unformatted values,
independantly of the localization setting.

A test has been added for each type of field to verify that the
value is entered with the default formatting as 'raw' values.

task-3307126

closes odoo/odoo#121495

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2023-07-03 12:21:02 +02:00
luvi 1239951fe0 [IMP] web: add missing documentation for widget options
This commit simply adds documentation in the supportedOptions of the text
field as well as the progressbar field. Since the support of documentation
has been added recently, those options were not yet documented in the
widget declaration.

This will improve the usability of those options in places like Studio

Part-of: odoo/odoo#121495
2023-07-03 12:21:02 +02:00
Surabhi Varma bbfd5aa614 [IMP] stock_delivery: route based on shipping method
In this commit, we added a new field in the shipping methods this field can be
used select rules. These rules can only be used when the corresponding SO has
one of the selected shipping methods.

task-3236149

closes odoo/odoo#119320

Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2023-07-03 12:20:58 +02:00
Josse Colpaert d34cba59c6 [FIX] account: avoid to delete tax mappings when no new taxes (so on most reloads)
Before, when you click the Reload button at the chart template in the accounting
settings on an already installed CoA that has no changes in the taxes, it will
delete the tax mappings in the fiscal positions.

Apparently the values['tax_ids'] == [] was interpreted by the ORM as remove all
tax mappings instead of do nothing, so we remove the key from the dictionary
when there is nothing to change.

closes odoo/odoo#127008

X-original-commit: ca40db275f4ba8da2d6a2f1bfcb980fb387fc44d
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
Signed-off-by: Josse Colpaert <jco@odoo.com>
2023-07-03 11:02:55 +02:00
Adrien Guilliams (adgu) ebbb81f2de [FIX] pos_restaurant: assertion of restaurant tour not ok
The pos_restaurant first test (test_01_pos_restaurant) has an assertion
that failed due to the fact that the deleteion of an order is
not awaited in the frontend. This led to the tour finishing very fast
after the orm call and the assertion done just after that. We add steps
in this test to see if the orm call has been done propely before ending
the tour.

Runbot Error: 22613, 22614

closes odoo/odoo#126779

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-07-03 11:02:49 +02:00
Mehdi Bendali Hacine 954426cf16 [FIX] l10n_sa_edi: ZATCA tab visibility for non-sales journals
closes odoo/odoo#126600

X-original-commit: 53b20557be5ca52d84b124f1ba29b109406858b2
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: William André (wan) <wan@odoo.com>
2023-07-03 11:02:41 +02:00