Commit Graph
166719 Commits
Author SHA1 Message Date
Thibault Delavallée 5cd49fc0f8 [IMP] mail: allow to change 'alias_domain_id' in alias mixin
PURPOSE

Allow alias domains to be multiple, notably to be used in a multi company
environment where each company has its own alias domain.

SPECIFICATIONS

As 'alias_domain' is now dynamic and not based on a configuration parameter
it makes sense to be able to change it when having several alias domain.
We now allow writing on 'alias_domain_id' in 'mail.alias.mixin(.optional)'.
Users may now change the alias domain of the alias coming with the mixin
when they have write access on the record.

Task-36879 (Mail: Support Multi Domains Aliases)

Part-of: odoo/odoo#76734
2023-10-24 19:24:50 +00:00
Thibault Delavallée e8a41762ad [IMP] mail: link 'mail.alias_domain' to aliases
PURPOSE

Allow alias domains to be multiple, notably to be used in a multi company
environment where each company has its own alias domain.

SPECIFICATIONS

Add 'mail.alias.domain' information on alias model. Aliases do not use global
configuration parameters anymore. Instead they are linked to an alias domain
e.g. 'sales' linked to 'mycompany.com' alias domain: 'sales@mycompany.com'.

It is now considered as a different alias compared to 'sales@mycompany.in'
which has the same alias_name but a different alias domain.

Constraints and checks are added, as

  * uniqueness of aliases is now checked inside a given domain;
  * an alias name must not clash with its domain bounce or catchall;
  * a combination of (alias_name, alias_domain_id) must be unique;

Crm multi-company environment is also updated to match the new alias domain
behavior.

Task-36879 (Mail: Support Multi Domains Aliases)

Part-of: odoo/odoo#76734
2023-10-24 19:24:50 +00:00
Thibault Delavallée 1b16757d28 [IMP] mail: add 'mail.alias.domain' model to store alias domains
PURPOSE

Allow alias domains to be multiple, notably to be used in a multi company
environment where each company has its own alias domain.

SPECIFICATIONS

Add a new 'mail.alias.domain' model storing information previously stored
as a unique value in 'mail.catchall.domain' configuration parameter. Domains
are not completely linked to companies, allowing to have a mono-domain MC
setup, or mono-company multi-domain setup.

A main email domain is present on companies for all default domain computation
when being in that company while keeping flexibility of having other domains
defined.

Now that a new 'mail.alias.domain' model exists we move bounce and catchall
aliases definition directly on this model. Update related computation on
company model. Default_from is also moved on this model, allowing an higher
level default from computation for mail servers when having knowledge of
alias domain environment. Filtering configuration based on default_from_filter
is kept as an ICP as it is mainly used for odoo-bin with smtp-host.

Usage of 'mail.catchall.domain' will soon be completely removed to be replaced
by proposed company-based email alias domain usage.

Constraints are added so that each bounce and catchall defined on domains
do not clash with existing aliases. Sanitize of bounce and catchall is also
performed to ensure they make valid emails. This matches previous behavior
of ICP parameters. Domain name is also sanitized like alias names.

Currently only base modeling and computation is done. Their usage is about to
be gradually added in mail stack.

LINKS

Task-36879 (Mail: Support Multi Domains Aliases)

Part-of: odoo/odoo#76734
2023-10-24 19:24:50 +00:00
Thibault Delavallée f153e52e30 [IMP] test_mail: improve multi-company / server config tests
Composer tests now use the multi-company enabled model by default, allowing to
test company-dependent behavior. This has no impact on current tests, as there
is no company-dependent fields on composer model, and all tests are anyway
run into the main company (except multi-company specific tests, suffixed
by '_mc' generally).

We therefore also add some multi-company oriented tests to check notably
return-path or environment companies in various scenarios. Go until the SMTP
generation to test mail server choice, smtp_from and filtering, notifications
email.

Followup of odoo/odoo#136318 and odoo/odoo@3ffa1a0611 notably.

Task-36879 (Mail: Support Multi Domains Aliases)

Part-of: odoo/odoo#76734
2023-10-24 19:24:50 +00:00
Thibault Delavallée c53aae845d [REF] mail, various: lint / reorder code bits, improve tests
Perform some code cleanup not really related to other commits notably in mail
gateway where alias domains will have some impact. Extract some processing
in sub-methods, allowing to better distinguish code purpose. This implies
notably some checks in mail gateway (write to bounce or catchall detection).

In mail.message, reorder some fields according to their usage, just to keep
definitions / section.

Also improve docstrings and/or fix some of them.

This is mainly a "reduce diff in other commits" commit. No change should occur
with this commit.

Task-36879 (Mail: Support Multi Domains Aliases)

Part-of: odoo/odoo#76734
2023-10-24 19:24:50 +00:00
Thibault Delavallée b99d16670c [FIX] base: make ir_mail_server ordering deterministic
This may have an impact when trying to find an outgoing mail server based
on from and filter, as first match wins when checking matching filter on a
bunch of mail servers.

Prepares Task-36879 (Mail: Support Multi Domains Aliases)

Part-of: odoo/odoo#76734
2023-10-24 19:24:50 +00:00
Stephane Debauche 503508fb8e [FIX] base: fix mock of IrMailServer methods
Due to current implementation of mocks context is lost when accessing methods
'connect' and '_find_mail_server' of IrMailServer. Indeed self is replaced by
an instance of IrMailServer and code relying on context could not be called as
planned.

This commit aims at doing a custom mock so that we can correctly rely on self
and context in those methods. This is necessary for incoming changes in mail
notably to allow testing SMTP feature in multi domains environment.

Logged information when having failed SMTP check is improved: we now also
log found From in order to ease debugging failing tests due to invalid from.

Prepares Task-36879 (Mail: Support Multi Domains Aliases)

Part-of: odoo/odoo#76734
2023-10-24 19:24:50 +00:00
Thibault Delavallée 93f378ea4f [FIX] mail: add default recipients from composer only in email mode
When composer runs in 'rendering' mode, it is often based on a mail.template
record that gives information about recipients. When having no template
default recipients are added to be sure to contact 'intended people'.

When rewriting code in 16.2, support of batch-comment was added in addition to
mass mailing. Result is that now default recipients are also computed when
posting in batch. However when posting we consider recipients are already set
on records using followers. Adding default recipients to avoid dummy emails
is present mainly for the mass mailing mode.

Followup of odoo/odoo#107356

Prepares Task-36879 (Mail: Support Multi Domains Aliases)

Part-of: odoo/odoo#76734
2023-10-24 19:24:50 +00:00
tsm-odoo 66bb1d351b [FIX] {im,website}_livechat: only send guest token when available
Before this commit, live chat would fail for guest portal. In this
scenario, there is no guest token. Before this commit, the guest
token was sent anyway with `null` as value which caused a crash.

closes odoo/odoo#139585

Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
2023-10-24 18:11:31 +00:00
Maryam Kia 687295e408 [FIX] mail: attribute with object value isn't rendering properly in owl template
closes odoo/odoo#139576

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-10-24 18:11:29 +00:00
Thomas Lefebvre (thle) 3a219172a5 [FIX] hr: not set partner of a bank account to False
Steps to reproduce:
-------------------
- install `account` module;
- create an employee;
- add a bank account;
- add a related user and save;
- remove the user and save;

Issue:
------
A traceback occurs.

Cause:
------
We synchronize the `partner_id` of the `bank_account`
with the `work_contact_id`.
If the latter is `False`, this triggers an error.

Solution:
---------
Do not trigger the logic that updates the `partner_id` of
the `bank_account` if the value is `False`.
This keeps the logic that the `partner_id` field
in the `res.partner.bank` model is required.

opw-3558983

closes odoo/odoo#139570

X-original-commit: c19574e26d8814a745152489eb16915f13b2a6c0
Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
Signed-off-by: Thomas Lefebvre (thle) <thle@odoo.com>
2023-10-24 18:11:27 +00:00
Antoine Boonen 56d1776ba7 [FIX] account_peppol: Fix peppol kanban button display
Problem
---------
When zoomed in, the peppol buttons would be displayed inline with
previous buttons in the journal cards. This is not user friendly.

Objective
---------
Make sure the buttons are displayed under (new line) the previous one on
the kanban card.

Solution
---------
Encompase the buttons in div tags.

closes odoo/odoo#139567

Signed-off-by: Habib Ayob (ayh) <ayh@odoo.com>
2023-10-24 18:11:26 +00:00
FrancoisGe 2f0e7d5822 [FIX] web: KanbanRenderer is rendered twice
Before this commit, the KanbanRenderer was rendered twice.

Why:
---
The "getGroupsOrRecords" function used in the KanbanRenderer templace
uses the "sort" function on "list.groups". The "sort" function modifies
the array on which it is called, which will generate a rerender because
"list.groups" is reactive.

Solution:
---------
Call the "sort" function on a clone of "list.groups".

closes odoo/odoo#139547

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-10-24 15:23:31 +00:00
Pierre Pulinckx (pipu) 1d6f2da14a [REF] *: add chartjs assets bundle
In the goal of simplify assets loading, in this commit we create a new
assets bundle for chartJS and its luxon adapter.
With this, we can now use loadBundle instead of load these two libraries
with loadJS.

task-3562357

closes odoo/odoo#139544

Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
2023-10-24 15:23:30 +00:00
Pierre ParidansandAaron Bohy feaa6d64bd [FIX] web: tests: click helper: throw error if target is disabled
This commit is a backport of odoo/odoo@f065276a46

Before chrome 116, programmatic clicks on disabled buttons weren't
actually fired. With chrome 116, they are. As a consequence, some
tests fails on chrome 116 because they click (on purpose) on
disabled button to highlight the fact that nothing happens.

This commit improves the click helper to make it throw an error
when the target is disabled. It also adapts the tests that were
clicking on disabled button, in general to simply assert that the
button is disabled instead.

closes odoo/odoo#139537

X-original-commit: 0e8b50d540c9eee0837282883d603937b94b2fd2
Signed-off-by: Romeo Fragomeli (rfr) <rfr@odoo.com>
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
Co-authored-by: Aaron Bohy <aab@odoo.com>
2023-10-24 15:23:28 +00:00
Antoine (ande) cd1ddc7cad [FIX] auth_totp_mail_enforce: cannot save option
Current behaviour:
When checking "All users" then saving,
it unchecks it then checks "Employees only"

Steps to reproduce:
1. Install auth_totp_mail_enforce
2. Go to Settings
3. Check "Two-factor authentication enforcing policy"
4. Hit Save
5. ("Employees only" is selected)
6. Select "All users"
7. Hit Save
8. ("Employees only" is still selected)

Cause of the issue:
Because of onchange, _onchange_auth_totp_enforce is
called when refreshing the page, which causes
auth_totp_policy to default as 'employee_required'

opw-3523880

closes odoo/odoo#139535

X-original-commit: 1d8423e397e7646eec9eebab8a1fd40e39605404
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Antoine Demany (ande) <ande@odoo.com>
2023-10-24 15:23:26 +00:00
Achraf 0a21137baa [FIX] sale: prevent transaction confirmation with group_auto_done_setting
Steps:
	- Install `website_sale`
	- Enable `Lock Confirmed Sale`
	- Enable `On Site Payments & Picking`
	- Enable `Pay in-store` payment provider
	- Login with demo user and go to shop
	- Add a random product and go to checkout
	- Confirm and choose on-site payment/picking
	- In the backend with admin user confirm the newly created sale order
	- Go to Payment Transaction

The transaction is marked as confirmed without payment. Without `Lock Confirmed Sale` it works.

The solution is to mark transaction as confirmed only if it is `wire_transfer`

opw-3501140

closes odoo/odoo#139533

X-original-commit: 71db47cff99ce3b2090c3be5dfa3205654625d51
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Signed-off-by: Achraf Ben Azzouz (abz) <abz@odoo.com>
2023-10-24 15:23:25 +00:00
lrizzi1 09e61284d3 [FIX] base: fix traceback _compute_parent_ids res.company
When a company is created and then archieved there will be
tracebacks upon acessing res.companies records because the company
is not active and in _compute_parent_ids at company.parent_ids[0]
an empty recordset will be returned since the company is inactive
With (active_text=True) the company is returned in the recordset
even being inactive.

opw-3565757

closes odoo/odoo#139527

X-original-commit: b15975739810fe0c94ae5965cef3038ac54a58ba
Signed-off-by: Rémy Voet (ryv) <ryv@odoo.com>
2023-10-24 15:23:24 +00:00
Walid fc1ee847dc [FIX] website_sale_delivery: disable pay button durring update
Steps to reproduce:
refer to ticket

Bug:
if there's no available pickup points on the selected delivery method
the pay button is disabled but clicking on a payment option reanbles the
button
eventhough "_onClickPaymentMethod" doesn't enable the button since
_isPayable is false,
"_onClickPaymentOption" already enabled the button.

Fix:
disable the button before updating the payment method
also disable the button at the start when changing shipping method
(to avoid client clicking pay while carrier data is loading)

opw-3432905

closes odoo/odoo#139522

X-original-commit: 6a91e63504cb45d2f80162d2a91b76e733c0facf
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-10-24 15:23:23 +00:00
Didier (did) ea0071ffc7 [FIX] mail: improve messaging menu performance
To reproduce:

* Populate mail.message as medium or more
* Open odoo and click the messaging menu
* The messaging menu take an unreasonable amount of time to open.

This PR cache the threads getter to avoid unnecessary computations

task-3551625

closes odoo/odoo#139519

X-original-commit: aa92a630d5146b7a4ee5eb5d09bb6db04c1ba146
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-10-24 15:23:22 +00:00
Thomas Lefebvre (thle) 3b11745923 [FIX] website_sale: add 'sale_order_id' in qcontext
Issue:
------
When we use stripe to pay for a subscription via ecommerce,
we get the following error message:
```
The provided setup_future_usage (off_session) does not match the
expected setup_future_usage (null). Try confirming with a Payment Intent
that is configured to use the same parameters as the Stripe Elements.
```

Cause:
------
On the JS side, the value of `is_tokenization_required` is set to `False`,
which doesn't set the value of `setup_future_usage` to `off_session`,
causing the mismatch with the PY side.

The `_is_tokenization_required` method uses `sale_order_id` which comes from the template.
The template finds this value in the `sale_order_id` variable,
which is passed via the context.

Unfortunately, this key does not exist in the context.
As a result, the method _is_tokenization_required`
returns False instead of True.

Solution:
---------
Add `sale_order_id` in the context to render the template
and therefore detect the sale order afterwards.

opw-3541316

closes odoo/odoo#139518

X-original-commit: c6b803baf26b3f26ace6464de944f681c7078c2e
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Signed-off-by: Thomas Lefebvre (thle) <thle@odoo.com>
2023-10-24 15:23:20 +00:00
Anna Janiszewska b0b1dc5e0f [FIX] base: skip etag when attachment checksum is missing
png images not shown on ir.attachment kanban

Attachment that use db_datas have no checksum by default, which is used
to compute the stream's http ETag. Skip updating the ETag when it is
missing and determine freshness using the Last-Modified header instead.

closes odoo/odoo#139498

X-original-commit: 2d43bbae72fddf17e7d9045e90dbc070b2f57a19
Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
2023-10-24 15:23:19 +00:00
Adrien Widart (awt) 0c68ddce1e [FIX] {sale_,}stock: cancel SM only if no done quantity
On a picking, it is not always easy to make the difference between a
waiting SM and a cancelled one.

To reproduce the issue:
1. Create two storable products P1, P2 with on hand qty > 1
2. Create and confirm a SO with 1 x P1 and 1 x P2
3. On the delivery, set the done quantities
4. Edit the SO: 0 x P1
5. Validate the delivery

Error: The SM of P1 is a bit confusing. Its demand is 0, which makes
sense because of step 4. However, its done quantity is 1 although
nothing moved according to the quants. Actually, the SM is cancelled
but nothing gives this information UI side, hence the confusion.

Step 4, we decrease the qty. It creates and runs a procurement of -1,
which creates a SM with a demand of -1. We then merge it with the SM
of the delivery and since its demand becomes 0, we cancel it:
https://github.com/odoo/odoo/blob/aebe6e616c4d62010aba67e7c4fbcc82f1385bea/addons/stock/models/stock_move.py#L1003-L1007

However, nothing displays this information client side. When the
picking is not done, the line will be red because the done quantity is
greater than the reservation (see `decoration-danger`):
https://github.com/odoo/odoo/blob/aebe6e616c4d62010aba67e7c4fbcc82f1385bea/addons/stock/views/stock_picking_views.xml#L254
When the picking is `done`, both lines will be grey (see
`decoration-muted` in above code). Therefore, the information is not
clear for the user, he could beleive that the SM has been processed.

Moreover, the user has completed the line with a done quantity. We
can't decide for him that this quantity no longer has any value. If
he really has moved the product, we have to consider it on Odoo side.
Else, he has to update the done quantity himself.

OPW-3478871

closes odoo/odoo#139495

X-original-commit: d5a1c6bfadc28503a6928580e854264e94074fa0
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Adrien Widart (awt) <awt@odoo.com>
2023-10-24 15:23:18 +00:00
Abdelouahab (abla) 9bafb5e0c8 [FIX] website_crm_partner_assign: give portal user right to read crm.stage
To reproduce
============
- connect with a portal user and try to consult your opportunities
-> 403 error

Problem
=======
after this [commit](https://github.com/odoo/odoo/commit/604a47ead80eb8a07102a978f364d82776f69da3), only internal users can read `crm.stage`.
which leads to this error.

Solution
========
portal user must read `crm.stage` only through the portal, so we give
back the right to read when `website_crm_partner_assign` is installed

opw-3559043

closes odoo/odoo#139490

X-original-commit: 9b64a6b29cdafaee044bc4bdcd8693225d05b1ca
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-10-24 15:23:15 +00:00
Arnaud Joset 61eaaae4a6 [FIX] calendar: prevent userError when base_event is not defined
Before this commit, the follwing traceback was sometimes raised.

Error message
ERROR: TestCalendar.test_event_creation_mail
Traceback (most recent call last):
  File "/data/build/odoo/addons/calendar/tests/test_calendar.py", line 339, in test_event_creation_mail
    m.write({
  File "/data/build/odoo/addons/calendar/models/calendar_event.py", line 574, in write
    self._rewrite_recurrence(values, time_values, recurrence_values)
  File "/data/build/odoo/addons/calendar/models/calendar_event.py", line 1084, in _rewrite_recurrence
    update_dict = self._get_time_update_dict(base_event, time_values)
  File "/data/build/odoo/addons/calendar/models/calendar_event.py", line 993, in _get_time_update_dict
    raise UserError(_("You can't update a recurrence without base event."))
odoo.exceptions.UserError: You can't update a recurrence without base event.

closes odoo/odoo#139486

X-original-commit: bd1c46a79ea3d41a374fac47dd16af802d18045d
Signed-off-by: Arnaud Joset (arj) <arj@odoo.com>
2023-10-24 15:23:14 +00:00
Thomas Josse (thjo) 560e6ed4fd [IMP] mail: adds new props and buttons to handle comment Threads
This commit adds new optional props to the Message and Thread Components:
closeThread, openThread, avatarPlaceholder and showDates.
* `closeThread` is a function that enables the user to close an active comment
  thread.
* `openThread` is a function that reopens a previously closed thread.
* `avatarPlaceholder` is a boolean that will add an avatar placeholder
  (fa-user icon) when needed. For example when using Knowledge via the portal.
* `showDates` enables us to hide the dates showed inside the Thread component,
  it may not be useful for certain comment threads.

We also added a button inside the actionBox in the Message Component and it is
only rendered if we are on the first message of the thread.
The button can trigger either of the new function props depending on what is
provided to the component.

task-3317056

closes odoo/odoo#127380

Related: odoo/enterprise#41951
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-10-24 15:23:08 +00:00
Adrien Dieudonne a2016359d0 [REF] web, *: avoid extend on h5 for kanban card title
´extends´ generates a lot of css rules.

So in this commit, we remove it by replacing it by the ´h5´ html tag.

closes odoo/odoo#139484

Related: odoo/enterprise#49408
Signed-off-by: Romeo Fragomeli (rfr) <rfr@odoo.com>
2023-10-24 13:55:30 +00:00
Christophe Monniez f194271823 [FIX] http: comply with rfc6265
Werkzeug changed the behavior of url_quote in
pallets/werkzeug@babfc93b38

Which appeared in Werkzeug 2.2.2 used in Debian Bookworm.

This change broke at least the export feature in Odoo. In summary,
the character set specified by [RFC5987] is more restricted than
that of [RFC3986]. So url_quote now allows invalid characters.

For example, a filename like `Journal Entry (account.move).xlsx`
leads to a crash of the client with Werkzeug 2.2.2.

url_quote is not really made to conform to [RFC6266] but we did not
find any [RFC6266] escaping tool in the standard library. This
commit explicitly specify as unsafe this list of chars.

[RFC6266]: https://datatracker.ietf.org/doc/html/rfc6266/ [RFC5987]:
https://datatracker.ietf.org/doc/html/rfc5987#section-3.2 [RFC3986]:
https://datatracker.ietf.org/doc/html/rfc3986/ [RFC2616]:
https://datatracker.ietf.org/doc/html/rfc2616#section-2

closes odoo/odoo#139483

X-original-commit: d145cb57eaf39fbe7612d4a79f209fc191828a8b
Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2023-10-24 13:55:28 +00:00
Christophe Monniez 308854e4fc [FIX] packaging: build and test tgz from latest debian
The source packaging was a bit left behind, it was still using Debian
buster to build and test.

With this commit the Debian bookworm is used. As the installation of pip
packages as root is now forbidden, the build and tests are now using a
python virtual environment aka venv.

closes odoo/odoo#139482

Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2023-10-24 13:55:27 +00:00
Christophe Monniez 2cea8b1450 [FIX] packaging: fix rpm tests
As [postgresql 15] changed the permissions of the public schema,
when testing the rpm package with Fedora 38, the test fails with
`InsufficientPrivilege: permission denied for schema public`.

With this commit, we properly create the database with the odoo user.
While at it, let's do the same with the poor left behind tgz package.

[postgresql 15]: https://www.postgresql.org/docs/release/15.0/

Part-of: odoo/odoo#139482
2023-10-24 13:55:27 +00:00
Christophe Monniez a05683fdd2 [FIX] packaging: force ofxparse install in rpm
When building the rpm package with Fedora 38, for an unknown reason, the
`python3-ofxparse` package refuse to be installed in the Docker image.

When specifying the `.noarch` specification the magic happens.

The reason remains obscure, nor I can't tell if it's linked to the
container itself.

Part-of: odoo/odoo#139482
2023-10-24 13:55:27 +00:00
Aaron Bohy da257e9d57 [IMP] web: save a has_group rpc at webclient startup
...when voip addon is installed.

We want to avoid predictable rpcs that are systematically done at
webclient startup. In particular, the voip service needs to know if
the user has group "base.group_user", which produces a rpc when
the service is started.

To avoid this, this commit adds the information in the page
directly. As this information is also useful at other places
(even though it's not at startup), we directly add it to the
groupCache of the user service (and we do the same for the
"base.group_system" group, which we also receive in the page).

closes odoo/odoo#139477

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-10-24 13:55:26 +00:00
Aaron Bohy e5161c86fe [IMP] hr_attendance: do not slow down webclient for attendance item
The attendance systray item needs data to determine whether or not
it should be displayed, and what to display. Before this commit, it
fetched it in the standard way, in onWillStart, and returned the
fetch promise.

However, for a systray item, it's better not to wait for the
promise, such that the webclient doesn't wait for it to be mounted.
In the case of this item, it is simply not displayed until data is
fetched, and when it is displayed, it's the right most item so it
doesn't produce any flickering.

This allows to save several ms on specific screens (e.g. home menu).

Part-of: odoo/odoo#139477
2023-10-24 13:55:26 +00:00
Victor Feyens 24c8ff9b28 [FIX] website_sale: address updates
Improved header (billing/shipping address instead of 'my details')
Keep the use_same input value on invalid form refresh

closes odoo/odoo#139474

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-10-24 13:55:25 +00:00
Victor Feyens 7a1f505e31 [FIX] website_sale: do not request shipping address when already given
* if customer said to use the same address as shipping
* if customer already chose/has/gave shipping address

Part-of: odoo/odoo#139474
2023-10-24 13:55:25 +00:00
Victor Feyens e18f6b8f5a [FIX] website_sale: clear empty ecommerce description
Part-of: odoo/odoo#139474
2023-10-24 13:55:25 +00:00
Brice bib Bartoletti d97a52cd1b [FIX] {l10n_}account_edi_ubl_cii/dk_oioubl/ro_edi{_tests}: remove DocumentTypeCode from standard
The aim of this commit to fix our bis3 e-invoice by setting the
DocumentTypeCode node only for the EDIs that fills its values otherwise
not setting that nodes.

Currently, we only set it for Denmark as it is mandatory, for Romania
because it was developped with it on the standard and we don't
set it for the others to be defensive. (Because it's not mandatory)

Before this commit:
All e-invoice based on BIS3 gets rejected.

After this commit:
BIS3 e-invoice pass the validation again.

Additional information:
Bis3 DocumentTypeCode node: https://docs.peppol.eu/poacc/billing/3.0/syntax/ubl-invoice/cac-AdditionalDocumentReference/cbc-DocumentTypeCode/
UBL 2.0 DocumentTypeCode node: http://www.datypic.com/sc/ubl20/e-cbc_DocumentTypeCode.html
UBL 2.2 DocumentTypeCode node: http://www.datypic.com/sc/ubl22/e-cbc_DocumentTypeCode.html

closes odoo/odoo#139468

Task-id: 3563754
X-original-commit: 1da22571c43fceedb4ab8c13aa9d0d6a78372595
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
2023-10-24 13:55:23 +00:00
Jorge Pinna Puissant 54ae8f96cc [FIX] web: clickbot test modal menus
Before this commit, the clickbot avoid testing modal menus.

Now, the clickbot open and closed the modal menus.

task-id 3535596

closes odoo/odoo#139389

X-original-commit: 60e16f1e32a0e1448c91826ec06c1e0e8a7bb1fc
Related: odoo/enterprise#49352
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2023-10-24 13:55:20 +00:00
Loukas Wets (lowe) 01d59c7d39 [IMP] pos_restaurant: display ticket screen filter in the search bar
Prior to this commit when the ticket screen was opened from a table, the
orders were filtered by context. This commit displays the filter in the
search bar so it can be removed. This allows the user to simply remove
the search to display all orders. This commit also removes the display
order count when null from the POS burger menu.

closes odoo/odoo#139357

Signed-off-by: David Monnom (moda) <moda@odoo.com>
2023-10-24 13:55:18 +00:00
Sylvain Francis a17a271618 [FIX] Automatically open attachment box after attachments are loaded
Before this commit:
If attachments are not loaded by the time useEffect is triggered,
the attachment box is not opened

After this commit:
The attachment box opens after the attachments are loaded, if there are any
and the "open_attachments" option is set

The bug can be reproduced by adding a time.sleep here:
https://github.com/odoo/odoo/blob/saas-16.3/addons/mail/controllers/thread.py#L13
And is caused by:
https://github.com/odoo/odoo/pull/134527

opw-3532736

closes odoo/odoo#139336

X-original-commit: e6c232a2554af79b5003aaad7c3ce55126104b66
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
Signed-off-by: Sylvain Francis (syf) <syf+odoo@odoo.com>
2023-10-24 13:55:17 +00:00
Rémi Rahir (rar) b2167e0a23 [IMP] spreadsheet: Add class props to SpreadsheetShareButton
Make the share button style parametric as we use it in different
contexts.

closes odoo/odoo#139302

Task: 3329419
Related: odoo/enterprise#49302
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2023-10-24 13:55:13 +00:00
Sébastien Theys d3b5ff1290 [FIX] mail: tests: fix "open the chatWindow of a channel from [...]"
Back-port test with `contains` from `master` and specify text present
on command before clicking it.

runbot-24981

closes odoo/odoo#138087

X-original-commit: ddc9da828ad338678bfa6e3b44461f87683b828f
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-10-24 13:55:11 +00:00
vlst 5a72165b95 [IMP] point_of_sale: simplify kanban view
In this commit we simplify the POS kanban view by replacing some
of the text shown to the user with more relevant versions.

Task 3562493

closes odoo/odoo#139246

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-10-24 12:38:32 +00:00
Benjamin Vray 6ac95d8e71 [FIX] website_blog: fix latest blog tag color
Since commit [1], the color combination system has been introduced,
affecting the colors of elements in the snippets. For the "blog" page
cover, it wasn't adjusted to work with this color combination system.
This resulted in inconsistencies, like the "Latest blog" tag having
nearly the same background and text color. This is because some elements
are affected by the chosen color combinations, while others have a
hardcoded color in the XML template (for example, the "text-white" class
on the blog title link).

In this stable version, we address this by ensuring that the text color
of the "latest blog" tag matches our original intention before the
introduction of the color combinations.

[1]: https://github.com/odoo/odoo/commit/69190959ce8e08481be7ebdfefd314edf0c5dce1

opw-3524351

closes odoo/odoo#139155

X-original-commit: 733ac082fbaf47ce02bd82a66e342a99f1780ff4
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Benjamin Vray (bvr) <bvr@odoo.com>
2023-10-24 12:38:30 +00:00
Aaron Bohy a4069e25b6 [FIX] web: CodeEditor: do not notify value props updates
Before this commit, the CodeEditor component called the `onChange`
props function each time the ace library fired the `change` event.
This in particular happens the value of the editor is set
programmatically by a update of the `value` props. Worse, in that
case, the event is fired twice: once with the empty string, and
one with the new real value. This isn't what we want for the
CodeEditor API. We only want to notify the parent of updates done
by the user in the UI. This commit thus filters out the noisy
`change` events fired by ace.

This fixed an issue with the ResourceEditor of the website: select
a scss or js custom resource, click on Reset: the resource is
marked as dirty, because `onChange` is called when the CodeEditor
is updated with the new value.

closes odoo/odoo#139154

Related: odoo/enterprise#49286
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2023-10-24 12:38:30 +00:00
Aaron Bohy 87c6dde49d [REF] web,*: SearchDropdownItem becomes CheckboxItem
Before this commit, there was a special kind of dropdown item
defined in the search/ folder, named SearchDropdownItem, which was
basically a DropdownItem but with role "menuitemcheckbox" instead
of "menuitem". It allowed to displayed a check icon in front of
values to indicate that they are selected. It is used especially
in the search menu, to indicated which filters/groupbys/favorites
are active.

This specific item is used in other context that search (e.g. pivot).
A similar usecase has also been introduced in website, in the
ResourceEditor (the wowl version of the AceEditor).

This commit thus moves the component to web/core/dropdown and
renames it into CheckboxItem.

Part-of: odoo/odoo#139154
2023-10-24 12:38:30 +00:00
Aaron Bohy 85372ffa94 [REF] web,*: remove last legacy stuff from several bundles
This commit removes the last low level legacy stuff (e.g. Widget,
mixins...) from the backend bundle, and from the webclient bundles
of mrp_subcontracting and project. They are no longer used in the
backend. There're still necessary for the frontend and for the
web_editor though, so we had to manually add them in the lazy
loaded bundle of the editor. Hopefully, the last widgets and
dialogs will be converted soon, and we'll finally get rid of all
those legacy files.

Part-of: odoo/odoo#139154
2023-10-24 12:38:30 +00:00
Aaron Bohy 5b511e27b8 [REF] web: remove select2 from backend assets
The select2 library is only used in the frontend, now that the last
backend usecase (AceEditor) has been removed. This commit thus
removes the select2 library from the backend assets.

Part-of: odoo/odoo#139154
2023-10-24 12:38:30 +00:00
Aaron Bohy 28d85defa5 [REF] web: remove useWidget compatibility helper
Now that the last Component using that helper have been fully
converted to Owl (AceEditorWrapper -> ResourceEditor), we can
remove it.

Part of task~3439226

Part-of: odoo/odoo#139154
2023-10-24 12:38:29 +00:00
Aaron Bohy 3f3175d4ca [REF] website,web,web_editor: convert AceEditor to owl
This commit refactors the website AceEditor to owl. The wrapper
around the lib was defined in web_editor, and extended in website,
where it was used (single usecase). This commit thus introduces an
owl Component to replace it, directly in website, and specialized
to the website usecase.

This thus allows to remove the legacy implementation.

This also removes the last usecase of Widget and select2 library
in the backend bundle, which will allow to trim it down.

Part of task~3439226

Part-of: odoo/odoo#139154
2023-10-24 12:38:29 +00:00