Commit Graph
168759 Commits
Author SHA1 Message Date
Pedram (pebr) 2e7a18883a [FIX] point_of_sale: use system date format for date search
Prior to this commit, the date search was hardcoded to
"yyyy-MM-dd HH:mm a", inconsistent with the system's date format
display. This commit adjusts the date search to align with the system
date format.

opw-3677157

closes odoo/odoo#148827

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2024-01-11 17:00:48 +00:00
roen-odoo 9564374aa1 [FIX] point_of_sale: fix session report payment difference
Current behavior:
If you use a non cash payment method, with "identify customer" option
and register a payment difference at the closing of the session. The
difference is not taken into account in the session report.

Steps to reproduce:
- Activate "identify customer" option on the bank payment method
- Open a session
- Add a product to the order
- Pay the order with the bank payment method
- Close the session with a payment difference
- Print the session report
- Open the report, at the bottom you should see the payment difference
  but it is not the case

opw-3597291

closes odoo/odoo#148753

X-original-commit: 30ba7fd9eb3d1910431cbf543e2ca691f0fdcfc0
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Robin Engels (roen) <roen@odoo.com>
2024-01-11 17:00:47 +00:00
dejan.mirosavljevic ec9610ddd7 [FIX] l10n_rs: remove duplicate report template inheritance
closes odoo/odoo#148651

Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
2024-01-11 17:00:46 +00:00
dejan.mirosavljevic 02d596ac9d [CLA] Update Modoolar CLA to include additional members of the team
Part-of: odoo/odoo#148651
2024-01-11 17:00:46 +00:00
vlst-odoo a0496586ff [IMP] pos_self_order: add barcode scanning
In this commit we implement barcode scanning functionality
in the `pos_self_order` module.

This is useful for kiosk devices in shops.

closes odoo/odoo#148480

Task: 3637834
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2024-01-11 17:00:45 +00:00
David Monnom (moda) 5924b75dbd [IMP] pos_restaurant: improve UX of order button
Before, when category name is small it can be difficult to read
quantities.

closes odoo/odoo#147753

Now: quantities are to the left of category names with a little padding
Taskid: 3630619
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2024-01-11 17:00:44 +00:00
vava-odoo 64aea1a402 [FIX] base_import_module: raise error if dependencies not in addons path
If the addons path does not contain enterprise, the industry module
cannot be installed since all of them rely on knowledge. The same
applies if there is a theme in the industry and that the design-themes
repository is not in the addons-path.

This commit raises a UserError in case the installation would fail due
to a missing repository in the addons-path.

closes odoo/odoo#147138

Signed-off-by: Pierre Masereel (pim) <pim@odoo.com>
2024-01-11 17:00:42 +00:00
Flotchet d7d40f5233 [FIX] website_hr_recruitment: remove useless csrf_token field
Steps to reproduce the bug:
- Go to /@/jobs/apply/experienced-developer-4
- Click on "Edit" button
- Click anywhere in the form
- Try to add a field
=> Nothing happens

Expected behavior:
You should be able to add a field without any problem.

Explanation of the bug:
A dynamic element is in the form (csrf_token) and it is preventing
the form to be modified correctly.
This was an artifact of a mistake made in commit [1].

Behavior after the fix:
You can add a field without any problem.

[1]: https://github.com/odoo/odoo/commit/ab93449323140d8a315c1e9dc2a1c789bfa3d859

task-3593111

closes odoo/odoo#143456

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2024-01-11 17:00:41 +00:00
Damien Bouvy 128032a8b1 [FIX] base: correct spanish address format
Commit 8889a896f introduced the state in the address format for spain
between parentheses, however if the state is unset this leads to weird
values like
```
Isabella López Navarro
()
Spain
```
which is bad.

This commit instead formats spanish addresses by adding the state below
the Zip+City line and above the Country, as suggested here:
https://en.wikipedia.org/wiki/Address#Spain

This avoids empty parentheses.

Task-3679058

closes odoo/odoo#149012

Signed-off-by: Bouvy Damien (dbo) <dbo@odoo.com>
2024-01-11 15:16:24 +00:00
Hubert Van De Walle e660cd94a8 [FIX] web: no_quick_create option ignored
Steps to reproduce
==================

1. Install event
2. Go to Events
3. Configuration > Event Templates
4. Click on any event
5. Click on Communication
6. Add a line, change type to SMS
7. Type anything in Template
8. Click on Create "..."
9. The operation cannot be completed

Cause of the issue
==================

For many2one and many2many editable fields, the server sets the
can_create and can_write attributes on the field nodes. [1][2]

In some cases [3], those attributes are missing even though the fields
are actually editable. They are also absent for reference fields.

The `canQuickCreate` props was set to the following value:
`canCreate && !noQuickCreate`. When canCreate was absent, this was
evaluated to undefined, thus ignoring the noQuickCreate option.

Solution
========

When the permission attributes are missing, we have to assume that the
user has the appropriate permissions.

We also have to cast the extracted props to booleans as if you have an
props with a value of undefined, it will fall back to the default value.

In the test `no_quick_create option on a many2one when can_create is absent`,
we set the field as readonly and then cancel the readonly on the view.
This reproduces one of the bug of [3] which causes the permission
attributes to be missing.

-----

[1]: https://github.com/odoo/odoo/blob/fa6da3d63a3a4cce4e8ca788a49772925d318764/odoo/addons/base/models/ir_ui_view.py#L1296-L1297
[2]: https://github.com/odoo/odoo/blob/fa6da3d63a3a4cce4e8ca788a49772925d318764/odoo/addons/base/models/ir_ui_view.py#L1080-L1086
[3]: https://github.com/odoo/odoo/pull/138032

opw-3609799

closes odoo/odoo#148163

X-original-commit: efcb2a820bb57f1fae809725e799b3145fbbe599
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Antoine Demany (ande) <ande@odoo.com>
2024-01-11 15:16:22 +00:00
roen-odoo 04943d400b [FIX] point_of_sale: correct refund amount on rounded orders
Current behavior:
When an order total is rounded, if you refund it from the backend. The
refund amount is not correct, and you will not be able to close your
pos session.

Steps to reproduce:
- Create a rounding of 0.05 HALF UP and activate it on the PoS
- Create a product with a price of 49.99
- Sell the product in the PoS
- Go back to the backend without closing the session
- Refund the order from the backend
- Try to close the session

opw-3574913

closes odoo/odoo#147931

X-original-commit: d5e955523efc05457744f4331d4c2ecda2b14215
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Robin Engels (roen) <roen@odoo.com>
2024-01-11 13:42:57 +00:00
Anh Thao Pham (pta) ae2219d6f6 [FIX] account: fix single bill creation with PDF and XML from alias
Steps to reproduce:
- Install Accounting
- Configure an Email alias for Vendor Bills journal
- Send an email to the alias with an PDF containing an embedded EDI XML and
the EDI XML corresponding to the PDF as attachments

Issue:
- 2 bills are created (one with the PDF as attachment and one with the XML),
instead of one with both PDF and XML as attachments
- The PDF with the embedded XML is linked to the invoice created by the attached
XML file and not the embedded one
- The embedded XML is decoded before the attached XML file.

Cause:
The order in which the documents are decoded.

opw-3604697

closes odoo/odoo#144243

Signed-off-by: Laurent Smet (las) <las@odoo.com>
2024-01-11 13:42:56 +00:00
Florian(flg) 179980768c [FIX] l10n_dk: Add Flex ERP as author
As Flex ERP help us a lot to implement this localization, we
add them as author of the module.

issue id: #148085

closes odoo/odoo#149006

Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
2024-01-11 11:40:29 +00:00
Djamel Touati 04a5806c8c [FIX] purchase_stock: allow validation of a receipt with invoiced qty
Steps to reproduce the bug:
- Create a storable product “P1”:
    - Product category > Costing method: AVCO
    - Purchase tab:
        - Vendor: Azure interior - 190$
        - Control Policy: On Ordered quantities

- Create a Purchase order with P1:
    - Confirm
    - Create a bill and don’t post it
    - Try to validate the transfer

Problem:
A traceback is triggered:

```
File "/home/odoo/src/odoo/saas-16.4/addons/purchase_stock/models/stock_move.py",line 76, in _get_price_unit
price_unit = float_round(remaining_value / remaining_qty, precision_digits=price_unit_prec)
ZeroDivisionError: float division by zero
```

opw-3667533

closes odoo/odoo#148911

X-original-commit: 40ef15f33a1e523350c653d93cedebb7543a3dce
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
2024-01-11 11:40:28 +00:00
Lucas Perais a0db7871ab [FIX] web: useRecordObserver error bubbles
Have a fieldWidget using useRecordObserver. In its callback, have a line that will
throw an error.

Before this commit, the Promise created by the hook was not rejected, leaving the error untreated and
popping until the window's onunhandledrejection event handler.

After this commit, the error appears on the owl errors stack, catchable with the hook onError.

opw-3667395

closes odoo/odoo#148887

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2024-01-11 11:40:25 +00:00
roen-odoo 6c78e65959 [FIX] point_of_sale: fix access error for company branch
Current behavior:
When you create a new company branch, and setup a user that only have
access to this branch. Then try to open the PoS app, you get an access
error.
This was happening because we try to read the company of the journal
that is not accessible by the user when we do the `_compute_currency`

Steps to reproduce:
- Create a new company branch
- Change demo user to only have access to this branch
- Login as demo user
- Open PoS app
- Get access error

opw-3640468

closes odoo/odoo#148625

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2024-01-11 11:40:25 +00:00
nda c32628641b [FIX] base_import_module: use full version for uploadable module
uploadable modules latest_version are not fully defined (ex: 1.0 instead of
15.0.1.0), which lead to issues in the MigrationManager.

Steps (in 17.0):
- make sure you have the industry repository in the addons-path and the upgrade
one in the upgrade-path
- create an empty database
- On 'Hair Salon', click 'Activate'
- On the 'Install an App' popup window, click 'Install'
- Wait for the Hair Salon Industry to install > Once finished, go to the Website
- Click 'Edit' to open the website editor
- Click 'Theme'
- Next to the 'Theme' field under the 'Website' section, click 'Switch Theme'
- Click 'Ok' on the Confirmation popup window
- Click 'Use this theme' for the BEAUTY them
- The 'Building your website...' animation begins
An error is thrown
File "/home/odoo/src/odoo/17.0/odoo/addons/base/maintenance/migrations/theme_common/9.saas~13.1.1/pre-views.py", line 4, in <module>
from openerp.addons.base.maintenance.migrations import util
ModuleNotFoundError: No module named 'openerp'

opw-3589376

closes odoo/odoo#148955

X-original-commit: b96b34dc69458b165e8660520832bd8d02adec70
Signed-off-by: Raphael Collet <rco@odoo.com>
2024-01-11 10:06:44 +00:00
luvi 6872f0a547 [FIX] web: prevent annoying focus on touch devices
This commit fixes an annoying issue when using Odoo on a tablet or a PC when using
the touch screen primarly. The virtual keyboard popped way too much when navigating
in between views and screens, since the focus is often set on inputs (mostly the
search bar with useAutofocus).

Steps to reproduce:
- on a Windows laptop or tablet with a touch screen, open any view
- the virtual keyboard appears
- you must touch out of the keyboard to use Odoo

To fix the useAutofocus hook, hasTouch is now being used instead of relying on the size
of the screen.

Autofocus test with isSmall has been adapted to specify that touch isn't modified, and
that the autofocus is still present. And another test has been added asserting the
behavior on a touch device.

In the form renderer, the autofocus set manually on the first element is now prevented as
well, reducing the popping effect of the keyboard when opening a view. A test has been
added as well.

task-3627697

closes odoo/odoo#148925

X-original-commit: 1f2ab6d5dda61a6aad6e0e9bd282195cdd990f15
Related: odoo/enterprise#54074
Signed-off-by: Romain Estievenart (res) <res@odoo.com>
Signed-off-by: Luca Vitali (luvi) <luvi@odoo.com>
2024-01-11 10:06:41 +00:00
Daniel Kosky (dako) 2b296fa0c0 [FIX] l10n_ke_edi_tremol: fix reference to prepare_edi_tax_details
A recent commit (03466c2) introduced a change that allowed for users to
place multiple taxes on a line (provided only one of them was a VAT
tax) when sending invoices to the device. This made use of the
_prepare_edi_tax_details method, which is only available from the
account_edi module.

This fix adapts the function to make use of the
_pepare_invoice_aggregated_taxes method (available from) the account
move model instead. The references to the keys in the returned tax
details dictionary have also be corrected (since the structure of the
dictionary between from version 16 onwards).

closes odoo/odoo#148901

X-original-commit: 4fddcc8fdb0a82938be665c81232268ae59ed37e
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Daniel Kosky (dako) <dako@odoo.com>
2024-01-11 10:06:40 +00:00
mano-odoo a66fe99800 [FIX] web: kanbancard reestablish 16.0 outline effect
Since milk redesign the kanbancard lost their outline bottom on focus
state.

Previous fixes where applied to solve this issue in commit[1]
and commit[2]. These fixes were a Catch-22:
fixing a behavior here, creating an issue there (double borders,
issue on drag..) which lead to more custom code.

In this commit, we remove the code added by the previous fixes and apply
a solution used in version 16.0 and prior. Relying on a negative margin
to hide the border of the following `kanban_record` and applying an
outline effect and a greater `z-index` on focus to make it appear on
top of the border. This z-index is set to 2 to compensate the
`z-index-1` on the kanban column when a card is focused and dragged.

[1]: odoo/odoo@d8fcc218bc
[2]: odoo/odoo@2495bfa725

task-3580229

closes odoo/odoo#148869

X-original-commit: ca388322327379e470e76f3a3c6ee2b2271e3895
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2024-01-11 10:06:38 +00:00
Claire Bretton (clbr) 493d5c3998 [FIX] account: add error when trying to update CoA with outdated module
Steps to reproduce:
1. Install a localization.
   For example l10n_ee.
2. Delete some tags to mimic an outdated module
   `DELETE FROM account_account_tag WHERE name->>'en_US' SIMILAR TO '(\+|-)1_1%';`
3. Click the reload button in accounting settings
=> Traceback

This happens because we didn't update the localization module first, thus the
tag is not yet created in the database.

We now raise a UserError telling the user he probably needs to update the module.

closes odoo/odoo#148956

X-original-commit: 3e93447ca6b464b96fa7d7eb3d671456576c0bf0
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Claire Bretton (clbr) <clbr@odoo.com>
2024-01-11 08:47:00 +00:00
Mattis Megevand (mmeg) 980e6a53b2 [FIX] sale{,_timesheet}: Generate activity on duplicated sales order
Steps to reproduce:
- Create a service product with Project & Task created on order
- Make an SO for 1 hour and confirm it
- In the task add 5 hours of timesheet
- An activity should be made in the SO
- Copy the SO and add the 5 hour of timesheet like before

Issue:
No activity is made.

opw-3660169

closes odoo/odoo#148929

X-original-commit: 1f7844f9384e3d78599923c2487ae938de9cddfc
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Signed-off-by: Mattis Megevand (mmeg) <mmeg@odoo.com>
2024-01-11 08:46:58 +00:00
David (dafr) 61ca757fd1 [FIX] mrp: 'move_finished_ids' depend on 'move_dest_ids'
During the creation of 'mrp.production'
'_compute_move_finished_ids' may be called before 'move_dest_ids' is set.
However, move_finished_ids depend on move_dest_ids (in the method _get_move_finished_values).

This may cause the move_orig_ids and move_dest_ids of the component and finished moves to not be set.

OPW-3652916

closes odoo/odoo#148922

X-original-commit: 44ed90245effa99f380b0b681dea0980f85930b7
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: David Fesquet (dafr) <dafr@odoo.com>
2024-01-11 08:46:57 +00:00
OmarAbosamaha 66b4e080e2 [FIX] repair: prevent uom comparison for non products
Issue:
When updating section line or note in a confirmed SO, the system tried to compare uom of them causing an error

Steps to reproduce:
1- Install sale and repair apps
2- Create a sale order with adding a product and a section line
3- Confirm sale order
4- Modify section line
5- Save

Solution:
We need to check if the order line is a product before performing the uom comparison

opw-3644939

closes odoo/odoo#148900

X-original-commit: e3cd490ab0e62865b5ad7516643a22c6ba3a3371
Signed-off-by: Adrien Widart (awt) <awt@odoo.com>
Signed-off-by: Omar Abosamaha (abom) <abom@odoo.com>
2024-01-11 07:27:36 +00:00
Harsh Modi 96005942f8 [FIX] l10n_in_edi: fix invoice preview taxes table
Before this commit:
The taxes column on invoice preview
were displayed  abit congested due
to inherited attributes

After this commit:
We have removed inherited attributes
which resolves the above mentioned
issue

closes odoo/odoo#148988

X-original-commit: d7d0cac8da30a15ab0d1d8695024fcb3f8b6ac3b
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Harsh Modi (hamo) <hamo@odoo.com>
2024-01-11 06:20:49 +00:00
Zeel Patel c51395687a [IMP] l10n_in_edi: correct the warning for E - Invoice having API mismatch
Before this commit:
The warning message displayed for E-Invoices with API and
tax ID mismatch was incorrect. It stated: '[0] Unable to send e-Invoice. Create
an API user in NIC portal, and set it using the top menu:
Configuration > Settings.'

After this commit:
The warning message for E-Invoices with API and tax ID mismatch has been
updated. The new warning message now reads: 'Ensure GST Number set on company
setting and API are Verified.'

closes odoo/odoo#148919

X-original-commit: bf4409253597c0feedd0cccb42140a3a878276e1
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Zeel Patel (zepa) <zepa@odoo.com>
2024-01-11 05:08:55 +00:00
mebe-odoo 2eec0b650c [FIX] l10n_sa_edi: fix qr code for ZATCA Phase 1 invoices
Currently, when we try to print a ZATCA invoice after installing the l10n_sa_edi module, the system will always default to printing the Phase 2 QR code on the invoice reports, irrespective of whether or not the invoice itself is for Phase 1 or 2. To fix this, we check if the Invoice has edi_documents, in which case it is marked as Phase 2 and runs as usual. Otherwise, we mark it as Phase 1 and call the initial function.

closes odoo/odoo#148928

X-original-commit: 3d33d18bbe5c462e0b986cb4891a67a14c63eb62
Signed-off-by: Mehdi Bendali Hacine (mebe) <mebe@odoo.com>
Signed-off-by: Josse Colpaert <jco@odoo.com>
2024-01-10 21:04:38 +00:00
Louis (loco) a5df9781be [FIX] web_editor: make the system robust when old mimetype is missing
Steps to reproduce:
- Add an image on the website.
- Save.
- With the HTML editor, change the src of the image (to
"https://odoo.com/logo.png" for example) and remove the
`mimetypeBeforeConversion` data attribute of the image. Note that it is
important to change the src of the image to ensure that the system does
not add the `mimetypeBeforeConversion` data attribute back on the image.
- Enter in edit mode and click on the image.

-> Traceback of type "Cannot read properties of undefined (reading
'split')".

This traceback appears because the `_renderCustomXML()` method of
`ImageHandlerOption` relies on the presence of formats on the list
returned by the `_computeAvailableFormats()` method. Since [1], if there
is no `mimetypeBeforeConversion` data attribute on the image, one of the
format in the list is `undefined`. As `_renderCustomXML()` tries to
perform a `split()` on this format, a traceback appears.

Although the steps to reproduce the result seem tricky, it has been
decided to create a fix for this situation. Indeed, in version prior to
16.4, the equivalent steps to reproduce (in which the `mimetype` data
attribute is removed instead of the `mimetypeBeforeConversion`) do not
lead to a traceback. In those versions, if there is no mimetype on the
image, the options such as "Filter", "Width" and "Quality" are not shown
in the editor panel. The goal of this commit is to apply the same logic
for the version 16.4; hide the "Format" option if the image does not
have the `mimetypeBeforeConversion` data attribute. To do so, the
`_computeWidgetVisibility()` method has been adapted consequently. To
avoid the traceback, the `_computeAvailableFormats()` method has been
adapted. It now returns an empty list if the image does not have the
`mimetypeBeforeConversion` data attribute. As there is no `undefined`
format in the returned list of valid formats, the traceback is avoided.

[1]: https://github.com/odoo/odoo/commit/730588b802506844e6ca54df312333bfd8df1d52

task-3631487

closes odoo/odoo#148882

X-original-commit: 485a5d74198668fa2f2240b4e31a871f36225857
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2024-01-10 21:04:36 +00:00
Antoine Vandevenne (anv) 2c79995c29 [FIX] payment: allow creating new payment methods from the provider
When browsing a payment provider's payment methods, the "New" button was
disabled because the action did not allow Kanban views.

closes odoo/odoo#148865

Signed-off-by: Valentin Chevalier <vcr@odoo.com>
2024-01-10 21:04:35 +00:00
Antoine Vandevenne (anv) ec6cc3511a [FIX] payment_custom: hide payment methods buttons on custom providers
Custom-flow payment providers should not allow assigning a different
payment method than the one that was set.

Part-of: odoo/odoo#148865
2024-01-10 21:04:35 +00:00
Antoine Vandevenne (anv) 59520da5ec [FIX] payment: show the payment methods buttons only on active providers
When the payment provider was disabled, the "Enabled Payment Buttons"
was shown, although it was not possible to enable them yet. The button
is now hidden until the provider's state is set to either 'enabled' or
'test'.

Part-of: odoo/odoo#148865
2024-01-10 21:04:35 +00:00
roen-odoo 47a07dc53d [FIX] pos_self_order: fix self order on iOS
Current behavior:
When adding a product with a variant, the variant page is not displayed
correctly, it's missing the add to cart button.

Steps to reproduce:
- Create a product with a multi checkbox variant
- Open self order menu on iOS
- Click on the product
- The "Add to cart" button is missing from the page

opw-3614337

closes odoo/odoo#148861

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2024-01-10 21:04:34 +00:00
Nicolas Bayet 5b04b4511c [FIX] web_editor: reset the collaborative selection when reset content
When the content of the editor is reset, the collaborative selection
should be reset as well. Otherwise, the selection is not reset and
the user can still see the selection of the previous content.

task-3675074

closes odoo/odoo#148826

Signed-off-by: Geelen Sébastien (sge) <sge@odoo.com>
2024-01-10 21:04:32 +00:00
Nicolas Bayet 0e22763a85 [FIX] web_editor: use setValue instead of resetEdior when restore
Before this commit, when restoring a document was made, it would reset
the content of the editor without any consideration for the mechanism
that detect stale documents and without any consideration for the
collaboration.

This commit fixes 2 problems in one shot:

1) Any change made in the editor after a restore was impossible to
save. The reason is that the restored version would reset the wysiwyg
without the id `data-last-history-steps` of the version in database in
the historyIds of the odooEditor wich subsequently would trigger the
stale document detection, preventing the save.

2) The reset would be propagated to other peers in collaboration. The
reason is the same as the 1st problem, the wysiwyg would be reseted,
not informing other peers of that reset.

task-3675074

Part-of: odoo/odoo#148826
2024-01-10 21:04:31 +00:00
Victor Piryns (pivi) 40dab4b5a3 [PERF] point_of_sale,pos_sale: better usage of the currency cache
Tune currency cache usage to enhance entry sharing by converting
date_order from datetimes to dates. This change aligns with currency
rates being queried based on dates, enabling the cache to consolidate
entries for identical currency rates on the same date. This optimization
reduces the number of entries and queries, especially for orders made on
the same date but different times.

closes odoo/odoo#148825

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2024-01-10 19:39:35 +00:00
Victor Piryns (pivi) ded660ad88 [REV] point_of_sale,pos_sale: remove usage of lru_cache
Since b6242264ea9f9f9f42cca4427e30071219ae6a70 a new caching strategy
for reducing the database queries when computing frequently the currency
conversions or rate was implemented. Therefor it isn't needed to use a
local `lru_cache` anymore. The new cache is implemented via
a `depends_context` which each have their own ORM cache lasting for the
current transaction.

Part-of: odoo/odoo#148825
2024-01-10 19:39:35 +00:00
AH-Yussef cced5ab357 [FIX] l10n_gcc_invoice: adjust messy invoice report layout saudi arabia
Steps to reproduce
- install the following modules:
        - Accounting
        - Studio
        - Saudi Arabia - Accounting (l10n_sa)
- Go to Settings > Users & Companies > Companies and create a New Company (named `SA Company` for example) with Saudi Arabia as the country in the address
- Switch to the new `SA Company`
- Go to Settings > Accounting
- Choose Saudi Arabia package as the Fiscal Localization package
- Go to Accounting and click on the studio icon (the one left of the user profile avatar)
- Click on reports
- Clear the filters
- Click on Invoices
- Click on the Company tagline box
- In the select box shown, choose `elif: o._get_name_invoice_report() == '|10n_gccarabic_english_invoice'`
- U can notice how the template is not rendered correctly

Invistigation:
- the major issue was the flex-direction: column; in https://github.com/odoo/enterprise/blob/e892bc8f022ed3962de06a61c1be181c89cdc831/web_studio/static/src/client_action/report_editor/report_iframe.scss#L170C1-L187C2 that caused the table header to be viewed as blocks
- Some xml tags / classes needed to be refined to enhance the layout

opw-3544938

closes odoo/odoo#148821

X-original-commit: db9498ccf8a6d5c51e691cbab04fc134ae310da9
Related: odoo/enterprise#54029
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Ali Hassan Youssef (alhy) <alhy@odoo.com>
2024-01-10 19:39:34 +00:00
snd 0014f2319d [FIX] mrp: correct amounts in Consumption Warning
Currently in 17.0, when adding an additional component (not present on
the BOM) on a Manufacturing Order, the Consumption Warning wizard shows:
- to consume: amount of additional component
- consumed: 0.0

Additionally, this reversal makes the 'Set Quantities & Validate' button have
the same result as the 'Confirm' button for the additional component lines.

task 3670356

closes odoo/odoo#148809

Signed-off-by: Stéphane Diez (snd) <snd@odoo.com>
2024-01-10 19:39:33 +00:00
Mattis Megevand (mmeg) aed0bab7ff [FIX] purchase: always display inactive taxes on purchase order
Steps to reproduce:

- Create a PO with a tax
- Confirm PO and bill it
- Deactivate tax

Issue:
Tax is shown on bill but not on PO

Solution:
Make sure that we display tax even if inactive.

opw-3631087

closes odoo/odoo#148778

X-original-commit: 4e424750eccff168c3cbb1a3f8411b35905717f3
Signed-off-by: Adrien Widart (awt) <awt@odoo.com>
Signed-off-by: Mattis Megevand (mmeg) <mmeg@odoo.com>
2024-01-10 19:39:32 +00:00
Aurelien van Delft (avd) 53c1295c8e [FIX] point_of_sale: skip recomputes on settings change
In v16 the configuration of a pos_config got moved from Point of Sale
to Settings, with new settings fields related to pos_config fields.
The create method got overriden in point_of_sale
to write values on the current pos_config
after the creation of the new settings.

The side-effect of doing so is that each creation of a res_config_setting,
i.e. after changing any given setting (pos-related or not), triggers a
write on ~50 fields of the current pos_config. Among those fields there are
modifying_relations fields that trigger recomputes on pos.order. Because
pos.order can grow quite big in some databases (> 200.000 pos.orders), it
makes it almost impossible to change any setting in these database. They
reach a TimeoutError on SaaS/SH.

To fix this, this commit filter pos_fields_vals to only write new
values on pos_config. If no value got changed since the last settings
creation, no write is triggered, and no recompute happens.

Because we are in the context of res.config.settings create, and all
the pos_config settings fields are related fields, everything should be
in cache and no (or very few) query should be executed when doing this
filtering.

opw-3547106
opw-3508239

closes odoo/odoo#148756

X-original-commit: 72f7c0d7d16a1b791bba61fd885261227f73d263
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Aurélien van Delft (avd) <avd@odoo.com>
2024-01-10 19:39:31 +00:00
Miku Laitinen 99bf0f2664 [FIX] microsoft_calendar: Make searching organizer by their email address case-insensitive
Before this commit Odoo was unable to match Outlook address Firstname.Lastname@example.com
to Odoo user email address firstname.lastname@example.com. This lead to events being created
in Odoo without an organizer.

closes odoo/odoo#148715

X-original-commit: c6e174f99d741b82f9e2cb0789e7ad7786879825
Signed-off-by: Arnaud Joset (arj) <arj@odoo.com>
2024-01-10 19:39:30 +00:00
Wolfgang Taferner a9a1c5d40b [FIX] l10n_ca: only show PST on reports if set
Add a missed condition to only show the label if the value is set

closes odoo/odoo#148650

X-original-commit: 4766809fdd4c04eb2258da4ff9e312dac7c09ea0
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
2024-01-10 19:39:29 +00:00
Dhrumil Shah 4a6a893212 [FIX] mail: fix line break in customer rating feedback
In this commit we have fixed the line break issue when we submit a feedback
for task and ticket.

steps:
   - Install helpdesk
   - Go to helpdesk > team
   - Activated customer rating
   - Set the rating template in the ticket stage
   - Create a ticket with the customer and move to the next  stage
   - Open the mail and submit a rating and message
   - Open ticket and check customer message

task-3268763

closes odoo/odoo#148644

X-original-commit: 185adf6fb487fa260bb6dfe985638bc545de7fa2
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2024-01-10 19:39:28 +00:00
Simon Genin (ges) 2b9717400a [FIX] web: Kanban grouped on field with readonly expression
As a reminder, the readonly expression in grouped kanban can enable or
disable the drag and drop feature. If the view is not reaonly but the
field in the arch on which the view is grouped is readonly, the drag
would be disabled.

Before this commit, there was a regression introduced in commit
ba1a5509fa that made the kanban record not
able to evaluate the readonly expression in the fields.

This commit fixes the issue by making the kanban record evaluate the
provided expression. It does not however correctly evaluate the
expression if it contains another field as the drag and drop feature
can be enabled at a view level, not at a per record level. It would then
resolve to not readonly.

Task id 3611116

closes odoo/odoo#148533

Signed-off-by: Francois Georis (fge) <fge@odoo.com>
2024-01-10 19:39:26 +00:00
smdc-odoo ce353cf810 [IMP] l10n_cz: Update the CoA and the taxes
As Czech legislation is changing its VAT structure on 1.1.2024, a new 12% tax
is added. Also some account were wrongly named, misclassified or missing. The 15%
taxe is kept in lower version for backward compatibility.

task-3609608

closes odoo/odoo#148409

X-original-commit: c0aba48f3c4fd2ebfa140fbe237ccde635e17b34
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Simon Morais Da Cunha (smdc) <smdc@odoo.com>
2024-01-10 19:39:25 +00:00
Nasreddin Boulif (bon) bccaced50d [FIX] mail: set default values for suggested_recipients
Steps to reproduce:

  - Install `CRM` module (for test purposes)
  - Create a lead and set the name, email, phone, company name and
    contact name
  - Save the lead
  - Click on `Send message` button in the chatter
  - Uncheck/Check the recipient checkbox
  - Save the partner
  - Discard the changes on the lead and open the partner created

Issue:

  - In the wizard, the `phone` value is not set with default value and
    the name is set with the company name instead of the contact name
  - On the partner created, the company and phone are not set

Cause:

  The default values (used in the partner creation wizard) retrieved
  from "/mail/thread/data" route are not set on the recipient object.

opw-3512045

closes odoo/odoo#148213

X-original-commit: 372fe2fe61e3121b27bf1305dfac8fbf0ff8e9b5
Signed-off-by: Nasreddin Boulif (bon) <bon@odoo.com>
2024-01-10 19:39:24 +00:00
vevi-odoo db858c7a13 [FIX] pos_restaurant: handle parse error if reinstall pos restaurant module
This traceback arises when the user tries to reinstall the 'pos_restaurant'
module

ParseError:
Parse error rises

When users try to reinstall the 'pos_restaurant', a traceback will be
generated. Because duplicate 'MRCSH'records exist, they raise the ParseError.

Which leads to the traceback from here

https://github.com/odoo/odoo/blob/8b4f4f2e373896fcaa50f6ee55467274f8e440d5/addons/pos_restaurant/models/pos_config.py#L134-L139

After applying this commit, it will resolve the issue by if the
pos payment methodexists, returning the values otherwise create it.

sentry-4736057055

closes odoo/odoo#147539

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2024-01-10 19:39:23 +00:00
dhda-odoo fe4385aca3 [FIX] project: correct the domain
Steps:
- install  to project_enterpise module
- Go to project >  all tasks in the Gantt view
- Group by customers
- Filter any customer

Issue:
     The wrong domain is passed in the search method so traceback occurred.
Cause:
   Currently, we don't replace `child_of ` operator with `ilike`  in _search_on_comodel method so
   child_of is passed in the search method and  orm  is not handled.

    Before this commit domain:
         `[('name', 'child_of', 'admin')]`
   After this commit domain:
     `[('name', 'ilike', 'admin')]`
Fixed:
   We correct the domain.

Issue in this commit-
  https://github.com/odoo/enterprise/pull/41257/commits/57eb5b72796e0aeff6d8368219281760acb7c307

task-3625825

closes odoo/odoo#144989

Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2024-01-10 19:39:21 +00:00
Antoine Vandevenne (anv) 8ddd6f12f2 [FIX] payment: fix date for non-deterministic test
When `test_display_name_for_empty_payment_details` was tested around
midnight, the test would fail because it compares the current date with
the token's create date, which would be the day before.

closes odoo/odoo#148781

X-original-commit: 87f94715a09b7681bcd92d1cba4f84d30918c502
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2024-01-10 18:25:13 +00:00
roen-odoo 40ee728812 [FIX] point_of_sale,pos_restaurant:save last preparation change on order
Current behavior:
Before this fix, when you sent the order to the kitchen, the preparation
changes were not saved directly. So if you refreshed the page right
after sending the order to the kitchen, the preparation changes were
lost.

Steps to reproduce:
- Open a POS restaurant session
- Add a product to the order
- Click on Order
- Refresh the page (F5)
- Go back to the table were you made the order
- The product still appears as not sent to the kitchen

opw-3614345

closes odoo/odoo#148755

X-original-commit: 8f33d6fa0261373fee276efd20dcbf75e95e1e28
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Robin Engels (roen) <roen@odoo.com>
2024-01-10 18:25:12 +00:00