Commit Graph
168327 Commits
Author SHA1 Message Date
Yannick Tivisse de4fc8bb2f [FIX] point_of_sale: Make tests demo data independent
Part-of: odoo/odoo#146649
2023-12-18 23:32:05 +00:00
Yannick Tivisse b1f392ce58 [FIX] payment: Make tests demo data independent
Part-of: odoo/odoo#146649
2023-12-18 23:32:05 +00:00
Yannick Tivisse be58bb0586 [FIX] mrp: Make tests demo data independent
Part-of: odoo/odoo#146649
2023-12-18 23:32:05 +00:00
Yannick Tivisse 45db144ffe [FIX] mass_mailing: Make tests demo data independent
Part-of: odoo/odoo#146649
2023-12-18 23:32:05 +00:00
Yannick Tivisse 285541e9dd [FIX] mail: Make tests demo data independent
Part-of: odoo/odoo#146649
2023-12-18 23:32:05 +00:00
Yannick Tivisse a8e010c7b5 [FIX] hr_holidays: Make tests demo data independent
Part-of: odoo/odoo#146649
2023-12-18 23:32:05 +00:00
Yannick Tivisse 0ba65e908a [FIX] event: Make tests demo data independent
Part-of: odoo/odoo#146649
2023-12-18 23:32:05 +00:00
Yannick Tivisse 58a32832c2 [FIX] delivery: Make tests demo data independent
Part-of: odoo/odoo#146649
2023-12-18 23:32:05 +00:00
Yannick Tivisse 7d9824d3d6 [FIX] crm: Make tests demo data independent
Part-of: odoo/odoo#146649
2023-12-18 23:32:05 +00:00
Yannick Tivisse 043a60b59f [FIX] calendar: Make tests demo data independent
Part-of: odoo/odoo#146649
2023-12-18 23:32:05 +00:00
Yannick Tivisse 0f447989d1 [FIX] base_automation: Make tests demo data independent
Part-of: odoo/odoo#146649
2023-12-18 23:32:05 +00:00
Yannick Tivisse 2aa2d2655c [FIX] auth_totp,auth_signup: Make tests demo data independent
Part-of: odoo/odoo#146649
2023-12-18 23:32:05 +00:00
Yannick Tivisse b1537a0868 [FIX] account: Make tests demo data independent
Part-of: odoo/odoo#146649
2023-12-18 23:32:05 +00:00
Yannick Tivisse a913272136 [FIX] base: Make tests demo data independent
Part-of: odoo/odoo#146649
2023-12-18 23:32:05 +00:00
Julien Castiaux 3f8296a16e [FIX] core: set Content-Security-Policy on static
The Content-Security-Policy[^1] http header was only set on the response
generated by controllers but it was missing from the `/<module>/static/`
route.

It is not strictly necessary to set that header on the responses comming
from that routes as it is not possible to add new static files or edit
existing ones via the interface (not even as admin). Only the developers
and system administrator can access those files.

It is also worth mentionning that using the Odoo internal web server to
deliver static files is suboptimal. Outside of a dev environment, those
files will typically be delivered via a web server[^2] and sysadmins
should configure their web server to set the CSP header on static images.

[^1]: https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP
[^2]: https://www.odoo.com/documentation/master/administration/install/deploy.html#serving-static-files-and-attachments

closes odoo/odoo#146591

X-original-commit: 55e09d504df9bd134afb6e0b38f03457b5c71e8e
Related: odoo/documentation#6953
Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
2023-12-18 23:32:01 +00:00
Tiffany Chang (tic) 59564a4f4a [FIX] stock: avoid unnecessary seq renaming
Previous fix odoo/odoo#139277 was added to avoid the python constraints
that didn't allow for duplicate sequence names for picking types. This
constraint is now reverted, but it doesn't hurt to keep the renaming for
debugging purposes (i.e. in case a seq name is unexpectedly duplicated).
The code order of the original fix needs to be updated though since the
seq is created before the search so one is always found and renamed in
many cases.

closes odoo/odoo#143848

closes odoo/odoo#145325

closes odoo/odoo#146050

closes odoo/odoo#146277

closes odoo/odoo#146362

Signed-off-by: Quentin Wolfs (quwo) <quwo@odoo.com>
Signed-off-by: Tiffany Chang (tic) <tic@odoo.com>
2023-12-18 23:31:58 +00:00
Tiffany Chang (tic) 2363b63dce [FIX] stock: avoid duplicate picking type seqs
Fixes 2 bugs:

- Users were confused when creating a picking type with a duplicated
  prefix name. Because of it, they were unable to distinguish between
  the 2 auto-generated ir_sequences since they default to the same name

https://github.com/odoo/odoo/blob/fe29860b22563bcae58a2e118b2a5ea79637589e/addons/stock/models/stock_picking.py#L102-L115

  Therefore we add a warning when they try to reuse an existing prefix
  (within a company), but not reuse the same seq id. We do not want to
  completely block duplicated prefixes in case the user really wants it
  and/or it is duplicated programmatically by accident (e.g. doing
  uninstall + reinstall of a module).

- When users duplicate an existing picking type, the auto-generated
  ir_sequence could result in duplicated picking names, which can result
  in a block due to the constraint:

https://github.com/odoo/odoo/blob/fe29860b22563bcae58a2e118b2a5ea79637589e/addons/stock/models/stock_picking.py#L440C1-L441

  A previous solution involved linking the existing sequence_id to the
  duplicated picking type, but this was NOT a good solution because it
  could lead to an inconsistency between the prefix used by the picking
  types due to one being changed and the other not, i.e.

https://github.com/odoo/odoo/blob/fe29860b22563bcae58a2e118b2a5ea79637589e/addons/stock/models/stock_picking.py#L123-L136

  would be applied, but the user may not see that it auto-changes it for
  the other picking type

Note that there are some other bugs that still exist related to these
bugs, but there's only so much time in the world to fix this mechanism,
so posterity (i.e. if someone else wants to fix them) they are:

- Previous fix: odoo/odoo#138471 ensures that the company of a picking
  type correctly matches its sequence_id's company. Unfortunately it
  does not take into account if the prefix has been changed (i.e. the
  picking type prefix WON'T match its sequence's prefix). This mismatch
  can also occur if the name of the warehouse is changed.
- Previous fix: odoo/odoo#139277 ensures that the sequence names are
  unique so that they are more easily noticed/fixed, but the prefix is
  left unchanged. Therefore there can still be issues with duplicate
  prefixes leading to the sql_constraints being triggered for pickings
  that use both the existing and the new sequence value.

Part-of: odoo/odoo#146362
2023-12-18 23:31:58 +00:00
Tiffany Chang (tic) f9e93327af [REV] stock: Enable the creation of a transfer from a duplicated operation type
This reverts commit 52219871e8d8357044763375f6f5318622e9894e.

Orig PR for ref: odoo/odoo#122838

Fix was ok for the specific bug it fixes, but then it adds the
additional bug of 2 picking types which can have different prefixes
but the same sequence_id. This on its own is not a big deal, except that
when a prefix is changed for one of the picking types, then the sequence
is updated for both picking types and the prefix of the not changed
picking type will not match anymore. For users not in debug mode, this
would be quite confusing since they cannot see that it is the same
sequence in both picking types.

A better solution is to default the sequences + their prefixes to be
different.

Part-of: odoo/odoo#146362
2023-12-18 23:31:58 +00:00
Tiffany Chang (tic) 5c25669ed3 [REV] stock: prevent creating sequences with same code
This reverts commit 9034602a028fb22fbd139cf41a2f5c71d9d8d032. Orig PR
for reference/auto-linking tracking: odoo/odoo#129394

Commit was intended to prevent having picking type sequences created
with the same code, but set up too strict a condition. This caused
issues with the following use cases:

- upgrades: see odoo/odoo#139277
- uninstalling and reinstalling modules that auto-create picking types
  see:
   - POS = odoo/odoo#138189
   - stock = odoo/odoo#134032
   - mrp = odoo/odoo#136755
   - repair = odoo/odoo#139841 saas-16.4 onwards

For uninstall + reinstall cases, we should indeed do something better to
clean up these sequences so they do not appear to be duplicates of the
re-added operation types (i.e. unlinking them is not a good solution,
especially since the picking type still exists afterwards). That will
be part of a separate task though and low priority since we already warn
users that uninstalling and reinstalling modules can result in
unexpected behavior.

Since the original issue was only that there was no way to distinguish
between the sequences, a "_copy" will be added to duplicated picking
type records + we will add a warning if users tries to use an already
used sequence prefix (since the name is based off of this) but we won't
block them from doing it.

Also, we move the test that was added after the commit that is being
reverted to a better location.

Part-of: odoo/odoo#146362
2023-12-18 23:31:58 +00:00
Habib (ayh) 8725127d45 [FIX] analytic: remove precompute
Anlytic distribution models did not apply to bank recon entries. The corresponding enterprise PR activates the feature, however due to dependencies on non-precomputed fields, the attribute is removed

OPW-3558060

closes odoo/odoo#146235

X-original-commit: b9047febf3c4d67ce409f9f1dba8a9cc7c7165fe
Related: odoo/enterprise#52742
Signed-off-by: Laurent Smet (las) <las@odoo.com>
Signed-off-by: Habib Ayob (ayh) <ayh@odoo.com>
2023-12-18 23:31:56 +00:00
Robin Lejeune (role) e956c76630 [FIX] web_editor: update cols options after drag release
Since [commit 1], the columns count in the options is updated while
dragging the width handle of a column. That behavior relies on
asynchronous code which is not awaited.

This commit corrects it to be in line with the behavior of all other
options: the count is updated after releasing the drag. It also freezes
the mutex during the resize.

[commit 1]: https://github.com/odoo/odoo/commit/710d000f1872fd99b41d52ec3d6923756bba7cba

task-3576046

closes odoo/odoo#141002

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-12-18 23:31:52 +00:00
Soukéina Bojabza a2c877ef18 [IMP] web_editor: improve the "outdated block" alert
Before this commit, when editing a snippet that is outdated, an alert
block is displayed above the options, warning about that. However, this
alert does not really catch the attention and it does not prevent the
user to still use the options.

This commit improves this alert block by making it cover the whole
outdated options section, to make it more visible. Moreover, it now
contains two buttons:
- one to replace the outdated snippet by its new version, and
- one to still access the options, despite the fact that they may not
work anymore.

task-3203590

closes odoo/odoo#117560

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-12-18 23:31:51 +00:00
Pierre Paridans b9fd7c5ac9 [FIX] website: broken assets test on multi website
The `test_01_multi_domain_assets_generation` was introduced in PR [1].
But afterward, the commit [2] introduced a unique constraint on the
`domain` field. With this additional constraint, this test broke when
run with multiple existing websites as it assigns the same domain for
each of them.

This commit made the dummy domain assigned in this test non-unique,
which doesn't alter the original meaning of the test but, allows to run
it with multiple existing websites.

[1]: https://github.com/odoo/odoo/pull/118526
[2]: https://github.com/odoo/odoo/commit/507db4e179514d171ec82e8ea0cbaf2323a6c30d

runbot-20848

closes odoo/odoo#146666

X-original-commit: 0c522e42a82ec596e69611c556c4fc0d50e6e978
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-12-18 21:13:03 +00:00
Antoine Dupuis (andu) 79cf19dc3e [FIX] l10n_ro: Fix some account types.
4424 VAT to be recovered should be liability_current.
4426 VAT deductible should be asset_current.
4427 VAT collected should be liability_current.

closes odoo/odoo#146572

Taskid: 3634044
X-original-commit: 2581dda5217a6434cee529ed2ef144eb71fca467
Related: odoo/enterprise#52907
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
Signed-off-by: Antoine Dupuis (andu) <andu@odoo.com>
2023-12-18 18:46:39 +00:00
Antoine Boonen 5b940bbd6f [FIX] accounting: Fix accounting tour message.
Problem
---------
In the accounting tour, during the invoice creating step, the message
asking to confirm the invoice was irrelevant.

Landed in 17.0 with this commit:cc6f85af2aac31816b51a0b39c9b119049f9954f

Objective
---------
Change the message into "Once your invoice is ready, confirm it."

Solution
---------
Change the relevant message in the tour JS file.

task-3619638

closes odoo/odoo#144963

Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
2023-12-18 16:56:37 +00:00
Vivek Pabari 7cc9ae5b42 [CLA] signature for vivekpabari1894
closes odoo/odoo#146650

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-12-18 14:34:27 +00:00
Aaron Bohy 8f839e997c [FIX] web: allow to resize columns in grouped list views
Before this commit, columns in list views could be manually resized
only if there were records in the table. For the ungrouped case it
makes sense, as the table is empty anyway. However, for the grouped
case (either with empty groups, or with all groups being folded),
the list contains no records, but resizing could make sense as
there could be aggregate values displayed on group headers.

Technically speaking, there's no reason to restrict the resize
feature if the table is empty. Functionally wise, a user could get
confused if the feature is sometimes available, and sometimes not.
For that reason, this commit simply removes the isEmpty condition,
meaning that resizing columns is now always available, even if the
table is empty.

Task 3621490

closes odoo/odoo#146622

X-original-commit: 8fbdbb59eb3f37fad1fb75f4ff363f7fa17e6d27
Signed-off-by: Francois Georis (fge) <fge@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-12-18 14:34:25 +00:00
MerlinGuillaume 33a06f0e85 [FIX] web: open tooltip with mouse event on touch device
On device which are primarily recognized as "touch", when using a
mouse-like pointer, the tooltip can't be opened both on "touch" and on
"hover" (withe the mouse).

This commit fixes it by removing the escaping that prevented the mouse
events' listeners from being registered on touch-enabled devices.

Steps to reproduce:
1. Using Chrome, open the developer tools and click on "Toggle device
   toolbar"
2. Install Contacts
3. Go to Contacts and open the form view of any contact
4. Now click again on "Toggle device toolbar" to disable it but do not
   reload the page: touch device capabilities will be loaded but you
   will be able to use a mouse
5. Click on the question mark next to "Tax ID", nothing happens

opw-3493571

closes odoo/odoo#146621

X-original-commit: 5cbfa9751d6186ac6515a4341676706a807642ec
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-12-18 14:34:24 +00:00
Xavier-Do 3f9bf7da98 [FIX] base: faster fill_assets_path
After the previous fix introducing a deepcopy, the pregenerate of the
assets became slower because of the many call to get_manifest (in loop,
recursively)
Since the manifest is immutable here and won't go outside of the call,
we can use the lower level version.

closes odoo/odoo#146602

X-original-commit: acb671f4d1b9c53c9e7d91414e847f26e8026ca3
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2023-12-18 14:34:23 +00:00
sesn-odoo ff51570aed [FIX] account: restrict invoice sending to customer and added recipients
Summary
-------
Currently, when you send an invoice, every recipient receives the link
including the access token. Only the invoice's customer and manually
added recipients should receive the token.

Steps to reproduce
------------------
* Create and validate an invoice
* Add a follower `F `to the invoice
* Click on the Send & Print button, then add a recipient `R` who is not
  the customer associated with the invoice
* Proceed to send the invoice.
* Access the emails that were sent
* Using an incognito or private browsing window, open the `View Invoice`
  link for each of the 3 recipients.

You should see that all the links give access to the invoice.
What should happen is that only partner `R` and the invoice's customer
should haveaccess to the invoice.
`F` should be asked to login.

Cause
-----
Issue was introduced by 95c585f

Fix
---
Add a new notification group for partners that were manually added as
recipients, and give that group access to the invoice.

opw-3385302

closes odoo/odoo#146575

X-original-commit: 755814ea170adbade23692767fcb17b5422863e7
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
Signed-off-by: Séna Serge Nshimiyimana (sesn) <sesn@odoo.com>
2023-12-18 14:34:21 +00:00
vevi-odoo 7e58f703f4 [FIX] stock: calculate sum of quantity mapped with quant
This traceback arises when the user tries to click on 'Lot/ serial Number' in
Create Move Line

To reproduce this issue:

1. Install 'stock'
2. Create a new record in Lot and Serial Number from 'products/Lot and Serial
   Numbers'
3. Now go to 'operations/Transfers/Deliveries'
4. Create a new record and select the above-created 'Lot and serials' product
5. Save the record and click 'Mark as Todo'
6. Click on the 'Detailed Operations'  button and add a line
7. Set the quantity
8. Again add a line click on new then select  Lot/serial Number

ValueError:
Expected singleton: stock.quant(5, 24)

when the user tries to  click on 'Lot/serial Number' in Create Move Line
a value error occurs because getting many values excepted single value

Which leads to the traceback from here
https://github.com/odoo/odoo/blob/230b680bf92583c9f5e4a3739be1d8602df44331/addons/stock/models/stock_quant.py#L905-L929

After applying this commit will resolve the issue of getting a sum of quantity
mapped with the quant

sentry-4715604118

closes odoo/odoo#146560

X-original-commit: c7612dfc4349bc9b21a48ca5192523f180f9b5e8
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-12-18 14:34:20 +00:00
micheledic 58d2429c48 [IMP] mrp: new prepare move line finished vals to write custom values before the post_inventory
closes odoo/odoo#146526

X-original-commit: 6f5519105787ead32d27658ac291ef18dac51698
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-12-18 14:34:19 +00:00
Rob Coekaerts ce1eb19d4b [FIX] hr_holidays: fix invisible attribute on public holidays view
This attribute was not correctly updated with the big attribute revamp.
This commit fixes that.

closes odoo/odoo#146523

Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
2023-12-18 14:34:18 +00:00
ravb-odoo cff83453fd [FIX] hr_holidays: correct domain to compute timeoff and allocation request
Steps to reproduce:
- open kanban view of department from employee module.
- click on 'Allocation Requests' and 'Time Off Requests'.

Issue:
- When viewing the department's allocation and time-off requests in the employee
  module, all department data is displayed, regardless of the department
  selection.

Solution:
- The issue is resolved by correcting the domain, ensuring that only data
  related to the selected department is displayed. This adjustment results in
  accurate department-specific request information.

Task ID-3541358

closes odoo/odoo#145575

X-original-commit: 6bef791f4336725e8ab02b8531bd3507cc9624a5
Signed-off-by: Bertrand Dossogne (bedo) <bedo@odoo.com>
2023-12-18 14:34:16 +00:00
Thomas Lefebvre (thle) 0fd4e9e67c [FIX] hr_holidays: restrict multi-company rules
Steps to reproduce:
-------------------
- in a second company, giving leave to an employee;
- go to reporting in Time Off app;
- remove all filters.

Issue:
------
We see leaves of the other company's employees.

Cause:
------
The global rule which allows a domain to be added to manage
the multi-company case on the `hr.leave` model takes account
the company of the type of leave.

Solution:
---------
As types of leave can be shared between different companies,
it is also necessary to filter on the employee's company.

In fact, even a time off administrator is not supposed to see
the holidays of employees in companies that are not activated for him.

opw-3594737

closes odoo/odoo#145001

X-original-commit: d59e645b2edf167cb7f108fd7db563799b3db2f1
Signed-off-by: Bertrand Dossogne (bedo) <bedo@odoo.com>
2023-12-18 14:34:15 +00:00
Louis (loti) 7e14f920da [IMP] sale: hide "Sign & Pay" button for expired draft quotations
Previously, draft quotations were never marked as expired. However, draft quotations can be viewed in the portal if you have the link. In order to prevent customers from paying for draft quotations, we now mark draft quotations as expired when applicable.

task-3577657

closes odoo/odoo#144581

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-12-18 14:34:15 +00:00
Benjamin Vray 078903948f [FIX] website: fix button snippet
The commit [1] of this PR [2] has been merged requesting some changes to
be made later, which are fixes to the button that can now be dropped
onto the page from the snippet menu.

This commit makes the following changes requested:

- Before this commit, when we duplicated a button (by clicking on the
"duplicate" button), the style of the new button was generated again in
Javascript in the "_adaptButtons" function even though it is not
necessary since we duplicate the HTML of the copied button. That is why
this commit adds the "adaptAppearance" parameter for the "_adaptButtons"
function.

- Prior to this commit, when a button was dropped between two buttons,
the style of the next button was copied as a priority. After this commit
, the style of the previous button is now copied as a priority.

[1]: https://github.com/odoo/odoo/commit/507b80a12574ce19bcb925d88868fb377b1c4b06
[2]: https://github.com/odoo/odoo/pull/126717

task-3555413

closes odoo/odoo#139621

Signed-off-by: Robin Lejeune (role) <role@odoo.com>
2023-12-18 10:58:39 +00:00
Benoit Socias 952ebac37d [FIX] website: fix border color or button preset preview
Since [1] when website was moved to backend, with the introduction of
the iframe, the preset previews are replicating the CSS of the page.
In [2] the mechanism was adapted to make it faster, but in the new
replication the `border-color` of buttons was wrongly copied from the
`background-color` of the buttons.

This commit uses the right variable instead.

[1]: https://github.com/odoo/odoo/commit/31cc10b91dc7762e23b4bde9b945be0c4ce3fe3b
[2]: https://github.com/odoo/odoo/commit/7f5a9d040348048990b25c271875c77d2c314e4d

task-3642550

closes odoo/odoo#146587

X-original-commit: b69658898e6944f86d17460e214c529f68c66a10
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
2023-12-18 09:31:45 +00:00
Aaron Bohy 23611e65fa [FIX] web: correctly display domain in field tooltip (debug)
This commit fixes 3 issues with the domain in field tooltips, in
debug mode.

1) it only displayed the domain defined on the field in the model,
 not the domain set in attrs in the view, if any.

2) when the domain was the empty array, `domain: ` was displayed.

3) unset values should not appear in the tooltip (invisible,
 column_invisible, required, readonly).

opw 3455119

closes odoo/odoo#146563

X-original-commit: 8c4ff1fac9eb003c23770bf74f9d7ffe062f6ce7
Signed-off-by: Francois Georis (fge) <fge@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-12-18 09:31:44 +00:00
maad-odoo d4505666c3 [FIX] mail: activities in lost opportunities should appear
Before this commit:
Activities made on the archived record are not shown in the activity
system-tray menu.

After this commit:
Activities made on the archived record are shown in the system-tray
activity menu.

task-3458597

closes odoo/odoo#146462

X-original-commit: d6d91b4f86d3d0ef954160a9de6e42a1bc4e184f
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-12-18 09:31:43 +00:00
Odoo Translation Bot 304a6caa14 [I18N] Update translation terms from Transifex 2023-12-17 00:08:26 +01:00
Pelayo García 91764ec8e0 [CLA] oyale
closes odoo/odoo#146530

X-original-commit: eb44303380433c1ee807952bba19418cb569e927
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-12-16 18:31:06 +00:00
Claire Bretton (clbr) 0870357cc4 [FIX] l10n_ch: activate 2024 taxes, deactivate outdated taxes
REMINDER: old taxes = {7.7%, 3.7%, 2.5%}; new taxes = {8.1%, 3.8%, 2.6%}

1. We created 2024 taxes in advance and made them inactive by default
to avoid confusion for our users, while making them available for those
who needed them. Now that we are about to enter 2024 its time to active
new taxes by default and deactivate outdated ones.

We are keeping outdated taxes a bit more for clients that are not closing
their accounting at the end of the year and might need them for upcoming
months.

2. Remove the activation of new taxes that was made in the module migration
since now those taxes are already active.

closes odoo/odoo#146495

Task-id: 3184792
X-original-commit: 69868b3a1e327346138835ee4c91d86a5229f9c4
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Claire Bretton (clbr) <clbr@odoo.com>
2023-12-16 17:11:25 +00:00
Lucas Lefèvre (lul) 2fd6499c49 [FIX] spreadsheet: translate odoo links
Change your language and open any dashboard.
The table titles (e.g. "Top countries" of the Leads dashboard) are not
translated.

It was lost in commit odoo/o-spreadsheet@9616681
With this commit not all link labels are translated. Only odoo links.
I don't think other (regular) links should be translated.

closes odoo/odoo#146574

X-original-commit: a2e406db138d51e710caf61a2809cfa991ea6cb3
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2023-12-16 11:15:08 +00:00
Josse Colpaert ec988e8b3b [FIX] l10n_latam_invoice_document: the gaps message does not make sense for LATAM journals
As the vendor bill names are those from the vendors
and the customer invoices are per document type,
it does not make a lot of sense to care about the gaps
in the traditional sense for LATAM journals.

closes odoo/odoo#145173

Signed-off-by: William André (wan) <wan@odoo.com>
2023-12-15 22:24:14 +00:00
Chong Wang (cwg) c74528b8e3 [FIX] core: avoid 'Registry' object has no attribute '_m2m' error
This is because the `env.registry` may not be the latest registry in the
Registries pool, which happens when new modules are installed by a request and
fail. In the `setup_model` the `_m2m` is set to the old registry, but models
will try to read the `_m2m` from the latest registry and raise 'Registry' object
has no attribute '_m2m' error

This commit fix the issue by resetting the env when necessary

closes odoo/odoo#146544

X-original-commit: a433f3175a5105d9028dd9937d5461ae2d5d11fe
Signed-off-by: Raphael Collet <rco@odoo.com>
2023-12-15 21:02:10 +00:00
Chong Wang (cwg) a7f2056b15 [FIX] core: KeyError odoo.fields in compute_value
`field_computed` is decorated with `lazy_property` and will be reset by
`setup_models` If a request comes, read `field_compute` when `setup_models`
just clears some fields. The `field_compute` will be cached with fewer fields
and cause KeyError for the registry in the future.

This commit re-clear lazy_property for registry after fields are modified

X-original-commit: 04e35d7bf3ca98dc722795c75033747697d70d30
Part-of: odoo/odoo#146544
2023-12-15 21:02:10 +00:00
Chong Wang (cwg) 6341805d5c [FIX] core: avoid 'Registry' object has no attribute '_m2m' error
If `setup_models` is called concurrently,
the first one just delete the `registry._m2m`.
then the latter one tries to access `registry._m2m`.
An error 'Registry' object has no attribute '_m2m' will be raised

This commit add a lock to the `setup_model` to fix the problem

X-original-commit: 9ae78193f5c9ae4dcfa28c4ea4be1a7f98e42136
Part-of: odoo/odoo#146544
2023-12-15 21:02:10 +00:00
Sébastien Theys 6d14689280 [FIX] mail, im_livechat: fix perf of thread sorting
Make correspondent a compute to benefit from cache.

This reduces the time on populate medium from around 600ms to 200ms.

closes odoo/odoo#146109

Related: odoo/enterprise#52703
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-12-15 19:37:26 +00:00
Sébastien Theys 9372de8789 [FIX] mail: clean js models code to improve performance
On my machine, this reduces the time of the qunit suite from around
115s-120s to 100s-105s. This reduces the time of init messaging with
populate medium from around 3s to 1s.

Avoid having to split local id to find record. This is a slow process
that is better avoided.

Make _fields a Map rather than an object.

Name anonymous methods to get better trace and profiling.

Move field update to separate methods. Start making the update method
return whether the value has changed, to go into the direction of
removing reactive from internal code (especially for on change).

Use markRaw or toRaw on technical values that don't need to be observed.

Start better naming variables, especially having a specific name when
the value is possibly a proxy, and keeping the simple name for when it's
definitely not.

Part-of: odoo/odoo#146109
2023-12-15 19:37:26 +00:00