Commit Graph
170411 Commits
Author SHA1 Message Date
aliya 20dbaae69b [FIX] account_peppol: allow the download of UBL files w/o eas and endpoint
Currently, users are blocked from downloading the UBL file if the partner
or the company are missing Peppol EAS and Peppol Endpoint fields.
The checkbox is not visible and even if it was visible, the user would
see a UserError asking to fill those values.

Let users download these files but show a banner warning about missing
fields.

closes odoo/odoo#159553

closes odoo/odoo#160035

Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
Signed-off-by: Aliya Tastemirova (alta) <alta@odoo.com>
2024-03-30 19:10:12 +00:00
AMZIL Ayoub 197a64556d [FIX] account_edi: remove unused attachement as sudo
The issue:
A new fix has been introduced to solve the mimtype issue with creating an XML file: https://github.com/odoo/odoo/pull/124507
since the attachment create_uid now is the SUPERUSER_ID, when a user with the accounting role (not admin) tried to register a payment on any account.move type (invoice, credit note...) an access error is thrown

The fix:
remove the unused attachment as sudo

opw-3787008

closes odoo/odoo#159985

X-original-commit: 60dd56bf3f67cc944918ad4c23fa1ef5f2036e55
Signed-off-by: William André (wan) <wan@odoo.com>
2024-03-29 23:17:24 +00:00
Carsten Wolff (cawo) 79010e68c3 [FIX] account: CoA load: only update tags in existing accounts
The intended behavior to only update tags and no other fields on existing
accounts during CoA loading was originally introduced in
https://github.com/odoo/odoo/pull/125320 and has recently been broken by commit
f2861b9d8d50 (https://github.com/odoo/odoo/pull/155256). This has been
recognized because of failing requests in the upgrade platform when it tried to
update the `code` field, which lead to excessive recomputations and in turn to
MemoryErrors.

The problem is that the tests, if the current `xmlid` constitutes a record
update or a new record[^1], need to be correct, no matter if the code above[^2]
managed to update the `xmlid` pointer or not. Thus, restore the previous logic
regarding that by only assigning the alternative record to the `account` var if
it is not None.

[^1]: https://github.com/odoo/odoo/blob/35bb495d5e5a8dac563ba4dee1702d77e4b71461/addons/account/models/chart_template.py#L312
      and
      https://github.com/odoo/odoo/blob/35bb495d5e5a8dac563ba4dee1702d77e4b71461/addons/account/models/chart_template.py#L314

[^2]: https://github.com/odoo/odoo/blob/35bb495d5e5a8dac563ba4dee1702d77e4b71461/addons/account/models/chart_template.py#L303

closes odoo/odoo#159950

X-original-commit: daa3747e94a6b7000617be91c0c33569bf3bd484
Signed-off-by: William André (wan) <wan@odoo.com>
2024-03-29 23:17:23 +00:00
Sven Fuehr 01ee465e81 [FIX] l10n_it_edi: enable import of outgoing invoices
Currently we assume that all imported invoices are incoming (i.e. bills).
This was i.e. done since the tax agency only sends users bills.

But some clients import invoices from other software (i.e. onboarding/starting).

After this PR we decide whether the invoice is outgoing or ingoing and
import the invoice correctly in either case.

task-3650355

closes odoo/odoo#159889

X-original-commit: 292521ddd566cd3d49df2dd2eb4e2850dc47620a
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Sven Führ (svfu) <svfu@odoo.com>
2024-03-29 18:09:45 +00:00
Sven Fuehr c7231773cd [FIX] account: on chart reload: fix matching journals without xmlid
Currently there is the following problem when reloading the chart.
Journals without xmlid may not be matched to chart data correctly
(via code or name).
This then leads to duplicate journals being created / uniqueness
constraint issues on journal codes.
The matching happens in `_pre_reload_data`.

This should only be a problem for upgrade or user created journals
since journals created from the chart data have an xmlid.

The problem was introduced in commit d6695f2892ded178371f6c69cf594037c19ce438 :
(1) We load the chart data in en_US to be able to use the code translations
(2) We switched the language of the loading process to en_US
    (to switch the chart data to en_US for the previous point and to
     avoid inconsistencies)

When matching journals in the DB by code or name to the chart data:
- We fetch the en_US name of the journals in the DB due to (2);
  Code is not translatable.
- We compare those values (journal code / name) against the en_US term
  due to (1).
Thus the matching fails.

This commit improves the matching:
We also compare the name and code (still en_US version)
against the translated values.

closes odoo/odoo#159871

X-original-commit: 005ebd59cba6b6ca20c736c46d89259af8bd251a
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Sven Führ (svfu) <svfu@odoo.com>
2024-03-29 18:09:43 +00:00
Steven Luna 382125121c [ADD] l10n_ec: New taxes for Ecuador, March 2024
- Add new tax groups for VAT at 5%, 13%, and 15%
- Add taxes of 5% and 15%
- Archive VAT taxes of 5% in sales and 12%
- Configure tax group accounts for the new tax groups
- Add new foreign account tax position tax template at 15% VAT
- Add default company configuration for sale and purchase taxes, with new 15% tax

closes odoo/odoo#159596

Related: odoo/enterprise#59788
Signed-off-by: Josse Colpaert <jco@odoo.com>
2024-03-29 18:09:41 +00:00
Mathieu Walravens 81cac7b2d3 [FIX] stock: allow changing scrap location with done moves
Before this commit:
Modifying a location from/to a scrap location should be restricted when
there are move lines with reservation. However, starting from Odoo 17,
the quantity field indicates the reserved quantity only when the move
line's state is different from done.

After this commit:
Only check if there are reservation lines (move lines not in done)
in the location when changing from/to a scrap location to match
the behaviour before Odoo 17.

opw-3815275

closes odoo/odoo#159376

Signed-off-by: Quentin Wolfs (quwo) <quwo@odoo.com>
2024-03-29 18:09:38 +00:00
lase@odoo.com 795fe01294 [FIX] stock: show destination on report of internal transfers
Steps to reproduce:

- Activate "Storage Locations" in the settings and create a warehouse
- Inventory > Operations > Transfers > Internal
- Create a new internal transfer with a non-zero product move line
- Print the "Picking Operations"

Expected behavior:

The destination of the move should be on the document.

Current behavior:

The report (and hence the printed version) of an internal transfer does
not display the destination of the transfer.

Cause of the issue / fix:

This part of the report is displayed under a `t-elif` condition. However
for internal trasnfers the condition of the `t-if` and of the `t-elif`
are both `true` so that two `t-if` should be used for an appropriate
display of the report.

Note:

Prior to commit 567b8d6, two `t-if` were used.

opw-3797998

closes odoo/odoo#159313

X-original-commit: c59e01f1ed32563da3dd86308bf46a1f2cdb5834
Signed-off-by: Tiffany Chang (tic) <tic@odoo.com>
Signed-off-by: Lancelot Semal (lase) <lase@odoo.com>
2024-03-29 16:19:51 +00:00
lase@odoo.com e108e5854c [FIX] project: show only active users as possible task assignees
Steps to reproduce:

- Go to the project application and click on any project with a task
- Hover over the task and click on the "assign button"

> inactive users can be assigned to the task

Cause of the issue:

Clicking on the "assign button" will call of the `name_search` method on
`res.users` to determine which user can be added as a task assignee.
Since the domain of the `user_ids` field of the `project.task` model:
https://github.com/odoo/odoo/blob/331d8451d9011aff6a8290c473a52fa77b30b358/addons/project/models/project_task.py#L169-L170
is override in the view:
https://github.com/odoo/odoo/blob/fcd66ee3321649405cf21bc1d625d71abf3d5819/addons/project/views/project_task_views.xml#L649
inactive users will not be filtered out due to the domain.
On the other hand, they could still be filtered out during this call
because inactive records should automatically be filtered out, during
the call of the `_where_calc` method, unless explicitely asked for:
https://github.com/odoo/odoo/blob/9134358b579361ef5d7e4da43d4778027564adc9/odoo/models.py#L5389
https://github.com/odoo/odoo/blob/9134358b579361ef5d7e4da43d4778027564adc9/odoo/models.py#L5091-L5093
However, since the `'active_test'` is set to `False` in the
context of the the `user_ids` field:
https://github.com/odoo/odoo/blob/331d8451d9011aff6a8290c473a52fa77b30b358/addons/project/models/project_task.py#L169-L170
the inactive records will also not be filtered out by the call of this
`_where_calc` method.

Note:

Prior to version 17.0, the flow worked "as expected" since the
context set in the `user_ids` was not properly taken into account
and inactive records were therefore filtered out by the call of this
`_where_calc` method. Thanks to commit c3e497f this context is now
relevant.

opw-3796425

closes odoo/odoo#158824

Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2024-03-29 16:19:49 +00:00
Joris Makauskis 67bd5b051c [FIX] sms: added dbuuid param to iap sms send endpoint call
This commit updates the parameters passed to the IAP SMS API route
("/api/sms/3/send") to include the DB UUID.

closes odoo/odoo#159714

Task: 3829793
Signed-off-by: Louis Baudoux (lba) <lba@odoo.com>
2024-03-29 14:27:29 +00:00
Andrea Grazioso (agr-odoo) 5c682c0fb8 [FIX] stock: No backorder for tracked products
In Settings>Inventory>Operations enable "Batch Transfers"
Create a [NonTrackedProd] product:
- Product Type: Storable Product
- Tracking: No tracking
Create a [TrackedProd] product:
- Product Type: Storable Product
- Tracking: By Lots
Make two POs with:
- Prod [NonTrackedProd] qty 1
- Prod [TrackedProd] qty 1
Open Barcode Scanning app
Select "Batch Transfers"
Create a new batch with the incoming transfers from the POs
Set only the [NonTrackedProd] lines as done and validate

Issue: Error will block validation
"You need to supply a Lot/Serial number for products"
The system should let the user validate the operation and create a
backorder instead of blocking the user

opw-3777701

closes odoo/odoo#158330

Signed-off-by: Quentin Wolfs (quwo) <quwo@odoo.com>
2024-03-29 14:27:27 +00:00
ilru-odoo 0e947c38ba [FIX] website_crm_partner_assign: сorrect field access rights during search
**Issue Description:**
Due to changes in field access rights verification as seen here:
https://github.com/odoo/odoo/blob/494231e796b562162d3bfb19fc8ce7550657cf07/odoo/models.py#L5334-L5345
And the removal of sudo rights for CrmLead:
https://github.com/odoo/odoo/blob/494231e796b562162d3bfb19fc8ce7550657cf07/addons/website_crm_partner_assign/controllers/main.py#L98
Attempting to open a search by domain with the `activity_date_deadline`
field triggers a 403 error:
"You do not have enough rights to access the fields
'activity_date_deadline' on Lead/Opportunity (crm.lead). Please contact
your system administrator."

**Steps to Reproduce:**
1. Install the `website_crm_partner_assign` module.
2. Assign Joel Willis a partner level (via the partner assignment tab in
   the `Contact` app).
3. Navigate to CRM, select an opportunity, and assign it to Joel Willis
   (using the assigned partner tab in the lead form).
4. Log in to the portal as Joel Willis, navigate to Opportunities, and
   click any filter on the activities date `Overdue / today / this week
   activities`. This action results in a crash.

**Proposed Solution:**
Since we assume that the domain will always filter opportunities with
assigned to current user, we can:
- Do a first search using sudo with the original domain that might
contain the `activity_date_deadline` field.
- Then do a regular search with the opportunities IDs obtained from of
the first search.

opw-3703583

closes odoo/odoo#154653

Signed-off-by: Nasreddin Boulif (bon) <bon@odoo.com>
2024-03-29 14:27:24 +00:00
aamo-odoo 6a4808802c [FIX] resource: prevent ZeroDivision Error while adding first working hours
This error occurs when the user adds a new "Working Schedule" to the resource,
switches to the two-week calendar view, removes all the existing "Working Hours"
lines, and then attempts to add a new line under "Working Hours."

Steps to reproduce:
- Install "resource" module
- Settings -> Technical -> Resource -> Working Schedules
- New -> Switch to 2 week calendar -> Remove all "Working Hours" lines
- Click on Add a line

Traceback: ZeroDivisionError
float division by zero

This commit implements a check for the variable "number_of_days". If the value
of "number_of_days" is zero or not found, the function will return zero.
This ensures that the function behaves appropriately in cases where the number
of days is zero.

https://github.com/odoo/odoo/blob/5177e21aea68959eedc73e0034ed984992392dd7/addons/resource/models/resource_calendar.py#L185

sentry - 5108250957

closes odoo/odoo#159844

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2024-03-29 12:38:11 +00:00
Florent de Labarre 7ead7f5b66 [FIX] sale: tree view is not available
Before this commit, it is not possible to export sale.report by excel or show the lines.

closes odoo/odoo#159793

X-original-commit: 5d8830cb34f3d34ddc907ad245a4312b18c5c1cf
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2024-03-29 12:38:07 +00:00
visp-odoo 591658ea67 [FIX] web_editor: show toaster notification error on uploading folder
Steps to reproduce:

OS: Ubuntu 20.04.4 LTS with nautilus
Browser: Google Chrome Version 123.0.6312.58

- type /file command in knowledge
- select a folder and click on open
- traceback occurs

Before this commit:

When a user attempts to upload a folder using /file command, the
processing begins, but the folder is not actually uploaded because the
`getDataURLFromFile` return promise which is not fulfiled. Additionally,
there is no indication of any warnings or errors during the folder
upload process.

After this commit:

If a user attempts to upload a folder instead of a file using the /file
command, it results in a error message in toaster notification.

task-3690847

closes odoo/odoo#159755

X-original-commit: 0b27ac02e499bf15d9f011beda17ab202c1f7a42
Signed-off-by: Damien Abeloos (abd) <abd@odoo.com>
2024-03-29 12:38:06 +00:00
Antoine (ande) 6c80d93f07 [FIX] mrp: delivery slip mixing kits and non kits
Current behaviour:
When you generate a Delivery Slip for a list
of kit and non kit products with no backorder,
kit and non kit products get mixed.
ie: there are kit products in the section
"products not associated with a kit"

Steps to reproduce:
1. Create 4 products (K1,P1,P2,C1,C2)
2. Create a Bills of Materials for K1
3. Set Type as Kit
4. Add C1 and C2 as components
5. Create a sale quotation for K1, P1, P2
6. Set the quantity at 4 for all products
7. On the quotation, click on Delivery
8. In Done, put 4 for P1 and 3 for C1,C2,P2
9. Validate and select No Backorder
10. Click on Print, Delivery Slip
11. In the document:
12. P2 is in the kit section (K1)
13. C1,C2 in the "not associated with a kit" section

Expected behaviour:
Only C1 and C2 should be in the K1 section
Only P1 and P2 should be in the
"Products not associated with a kit" section

opw-3568390

closes odoo/odoo#159138

X-original-commit: 5d61d7023b3b0a5e6a47ad71bb12d548c797b5f9
Signed-off-by: Steve Van Essche <svs@odoo.com>
Signed-off-by: Antoine Demany (ande) <ande@odoo.com>
2024-03-29 12:38:05 +00:00
Victor Piryns (pivi) 41e3b1cdc3 [PERF] survey: add missing indexes
Description:
Adding missing indexes to support most of the searches on survey's
models to avoid seq.scans and non-selective index scans.
Also adding indexes that are inverse to One2many, or dependencies
of compute fields (as those if not indexes will trigger a seq.scan
when the ORM resolves the dependency tree).
If a domain had multiple criteria, only fields with the highest
selectivity were indexed. This shall also reduce the amount of tuples
returned, reducing IO access and cache trashing.

Cardinality:
survey_survey -> X (reference quantity)
survey_question -> 10X
survey_question_answer -> 50X
survey_user_input -> 330X
survey_user_input_line -> 7200X

Reference:
task-3724844

closes odoo/odoo#158136

Signed-off-by: Olivier Dony (odo) <odo@odoo.com>
2024-03-29 12:38:04 +00:00
Valentin Chevalier 2f51b84313 [FIX] payment_stripe: incorrect flow mentionned in readme
closes odoo/odoo#159788

X-original-commit: 5948e821ce87b78f74150184aa806a43429ae821
Signed-off-by: Valentin Chevalier <vcr@odoo.com>
2024-03-29 10:44:24 +00:00
Andrea Grazioso (agr-odoo) 6f3c365018 [FIX] stock: test_unpack_and_quants_history issue
Test 'test_unpack_and_quants_history' may fail with error
```
ERROR: StockQuant.test_unpack_and_quants_history
Traceback (most recent call last):
  File "/data/build/odoo/addons/stock/tests/test_quant.py", line 926, in test_unpack_and_quants_history
    dst_location = stock_location.child_ids[0]
  File "/data/build/odoo/odoo/models.py", line 6189, in __getitem__
    return self.browse((self._ids[key],))
IndexError: tuple index out of range
```

closes odoo/odoo#159779

X-original-commit: 87e53b1d8e2e3ac6b8ddb514a8311b622adac366
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Andrea Grazioso (agr) <agr@odoo.com>
2024-03-29 10:44:23 +00:00
tsm-odoo 563385d07b [FIX] {im, website}_livechat: fix chatbot redirection
Before this PR, the chat bot would stop after redirecting
a user on the same page that the current one (e.g. anchors)
because it was counting on the page reload that do not occur
in this case. This PR fixes the issue.

opw-3801598

closes odoo/odoo#159769

X-original-commit: 3d7c2b87e59b261a2d3eeceb0c6de012e8b02a2e
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
2024-03-29 10:44:22 +00:00
Tanguy Quéguineur 0509aa467e [FIX] l10n_cl: translate term in invoice
Issue
-----
A term doesn't have a translation available.
Note: no Transifex project associated.

opw-3816657

closes odoo/odoo#159757

X-original-commit: 9a50cdf115e21bf2422ae881c8a367ad8967a13e
Signed-off-by: Tanguy Quéguineur (taqu) <taqu@odoo.com>
2024-03-29 10:44:21 +00:00
Andrzej(pian) 06ec579cf7 [FIX] sms: prevent sms duplication when using additional numbers
When sending an SMS via the action from the sale order view
(specifically with sale_subscription), it is possible to specify a
number to send the SMS to. However, if the specified number
is identical to the partner's number (the number of the sale order's customer),
Odoo attempts to send the message twice, resulting in duplication.

[This commit change]
This commit addresses this issue by ensuring that additional numbers
are skipped if they are the same as the partner's number.

[Reproduce]
- Install mass_mailing_sms, sale_management, and sale_subscription modules.
- Add an SMS token to the IAP account.
- Create a contact (C) with a valid phone number.
- Create a new quotation with contact (C) as the partner.
- Go to Actions > "Send an SMS Text Message" (requires the sale_subscription module).
- Do not change the contact number on the pop-up (ensure it matches C's phone number exactly).
- Bug: Odoo attempts to send two SMS messages, with the first being successful and the second resulting in an error.

opw-3596207

closes odoo/odoo#159677

X-original-commit: 131b0eccb00d24f0525a6a541221bfd2c66cb04b
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2024-03-29 10:44:19 +00:00
Levi Siuzdak (sile) dffc575725 [FIX] mail: prioritize partners with matching company in email lookup
Versions
--------
- 16.0+

Steps
-----
1. Have two companies with helpdesk teams;
2. create a contact associated with company 1;
3. create a contact associated with company 2 w/ the same email address;
4. from this address, send an email to team 2 to create a ticket.

Issue
-----
Ticket is created using company 1's contact.

Cause
-----
When searching for partners associated with an email address, it only
looks at the first one.

Solution
--------
Expanding on e1d50a404516d5b32bf01508423c5a1c880cb304 which prioritized
the current user, further prioritize based on companies matching the
records passed to `_mail_find_partner_from_email`, avoiding potential
access rights errors in multi-company environments.

Also fixes a bug in account_move where `_mail_find_partner_from_email`
was called with an `extra_domain` argument in the wrong position.

opw-3705199

closes odoo/odoo#159108

X-original-commit: 60dd5348179c9bdcc78e4ad46bd9b768a6e3ea21
Signed-off-by: Levi Siuzdak <sile@odoo.com>
2024-03-29 10:44:18 +00:00
Camila Vives cd6239f4f5 [CLA] add new members to Adhoc CLA
closes odoo/odoo#159796

X-original-commit: ba345e3d8bcb732076e3a3c9cd4203a2de9a43b9
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2024-03-29 09:12:22 +00:00
Djamel Touati e59f37999a [FIX] mrp: split the MO into the correct quantity
Steps to Reproduce the Bug:
- Create a BoM:
    - Product: P1, Quantity: 1 unit
    - Component:
        - C1, Quantity: 1 unit

- Create a MO to produce 10 units of P1:
    - This requires 10 units of C1
- In draft state, split the quantity into 10

**Problem:**
The created MOs have component quantities of 0.1 instead of 1.

When the MO is split, we update the product quantity of the original MO
to 1, which triggers the `_compute_move_raw_ids` because it depends on
the product_qty of the MO. Therefore, the move will be updated to 1.
https://github.com/odoo/odoo/blob/17.0/addons/mrp/models/mrp_production.py#L1793

Subsequently, the factor is calculated based on the `move_qty` and the
`qty_initial` of the MO.
https://github.com/odoo/odoo/blob/17.0/addons/mrp/models/mrp_production.py#L1828

Factor = 1 / 10 = 0.1

Afterwards, this quantity is set on the original move and the backorder
moves:
https://github.com/odoo/odoo/blob/17.0/addons/mrp/models/mrp_production.py#L1830
https://github.com/odoo/odoo/blob/17.0/addons/mrp/models/mrp_production.py#L1835

opw-3825708

closes odoo/odoo#159713

X-original-commit: 10554f3a3e28374c460a475a4908015aeb8a81cc
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
2024-03-29 09:12:21 +00:00
Mattis Megevand (mmeg) a04942c9aa [FIX] sale: disable locking of subscription sale order
Steps to reproduce:
- Install 'Subscriptions'
- Enable 'Lock Confirmed Sales' in the settings
- Make a new subscription
- Invoice the subscription

Issues:
The subscription is now locked, this behaviour is not intended.
As confirmed with the PO this settings should never affect the
subscriptions.

opw-3754106

closes odoo/odoo#159652

X-original-commit: b472c9e6f743aa467f7f4851ac95a367b364dfb1
Related: odoo/enterprise#59625
Signed-off-by: Mattis Megevand (mmeg) <mmeg@odoo.com>
2024-03-29 09:12:20 +00:00
Renaud Thiry 8d99f2f415 [MOV] test_website, web_editor: move test to right module
Some web_editor test was in "test_website" when it could
have simply been in web_editor.

It is moved there and modified to reuse existing imports and pass standard
web linting rules.

task-3741858

closes odoo/odoo#155704

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2024-03-29 09:12:17 +00:00
Renaud Thiry 5c7e377f77 [FIX] mail, web_editor: add attachment at file upload
When using the `/image` command in the composer, or otherwise uploading a file
the editor should add the attachment to the composer if it is the current model

During a change in js relational models [1] the code was not adapted properly.
This lead to a traceback when using the command inside the composer.

[1]: 218ad8456a

task-3741858

Part-of: odoo/odoo#155704
2024-03-29 09:12:17 +00:00
sesn-odoo b5f45c9aee [FIX] l10n_sa_edi: display correct currency rate
Currently, attempting to print an unconfirmed Saudi invoice in foreign
currency results in an error. Furthermore, even if the invoice is
confirmed,  the exchange rate displayed is not correct, the rate of the
confirmation date is used, instead of the accounting date.

Steps to reproduce
------------------
* install `l10n_sa_edi`
* switch to a Saudi company
* create an invoice in a foreign currency.
* without confirming the invoice, attempt to print it

You should be met with a traceback: `Undefined Function: operator does
not exist: date <= boolean`

* confirm the invoice, ensuring the confirmation and invoice dates have
  different currency rates.
* print the confirmed invoice.* print the invoice

You should see that the printed rate does not align with the actual
transaction amounts.

Cause
-----
The system incorrectly uses the `l10n_sa_confirmation_datetime` to
calculate and display the currency rate on the PDF. This field is only
populated upon invoice confirmation, leading to errors when printing
unconfirmed invoices. Moreover, using this date for confirmed invoices
results in displaying an incorrect rate, as it may differ from the
`invoice_date`, which should be used for accurate rate calculations.

opw-3731624

closes odoo/odoo#159698

X-original-commit: 67da9437d3606cb8a291c071214cc30914ce7fb0
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
Signed-off-by: Séna Serge Nshimiyimana (sesn) <sesn@odoo.com>
2024-03-29 07:53:02 +00:00
Mahdi Cheikh Rouhou (macr) c0a4a01915 [FIX] web_editor: spacing issue between columns of tablepicker
Issue:
======
The last column in `rtl` direction is connected to it's neighbor column.

Steps to reproduce the issue:
=============================
- Install notes and website
- Change language to arabic
- Go to notes and write `/` and opent eh table picker
- The last column (most left) is connected to it's neighbor

Origin of the issue:
====================
We forced the margin-right of the last cell in the row to have
`margin-right = 0` which is the case for `ltr` but not in `rtl`.

Solution:
=========
Use of `end` and `start` better to handle the direction
(https://developer.mozilla.org/en-US/docs/Web/CSS/margin-inline-start)

task-3825970

closes odoo/odoo#159643

X-original-commit: 0d57a30d12775d8c0ecdb6c3fab5ce191d3f2ccc
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Mahdi Cheikh Rouhou (macr) <macr@odoo.com>
2024-03-29 07:53:01 +00:00
Mahdi Cheikh Rouhou (macr) 7c59e05595 [FIX] web_editor: expand tablepicker in correct direction
Issue:
======
Table picker isn't intuitive in rlt language and doesn't expand in the
correct direction.

Steps to reproduce the issue:
=============================
- Install arabic language
- Go to notes and create a new one
- Write `/` and choose table
- Use left/right arrow keys to see how the table expand.

Solution:
=========
For rtl direction it's better to make left for increase and right for
decrease since that's the direction of the langauge. Also the table
should be fixed on the right and expand on the left. (exactly the
opposite of ltr direction).

task-3721794

X-original-commit: 9d4c937e67cb72ff7152e01cda23255bf3c4d344
Part-of: odoo/odoo#159643
2024-03-29 07:53:01 +00:00
Martin Trigaux (mat) aa84ccfa61 [ADD] test_translation_import: export source terms
Add a test for exporting the source terms of modules.
This will allow automated scripts to fetch latest terms

Backport save_test_file with a parameter on date_format to have
predictable filenames

closes odoo/odoo#159373

X-original-commit: e7246ea48828746471a2e3a485bee30687eeee80
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2024-03-29 07:53:00 +00:00
Mahamadasif Ansari bd3bccb458 [FIX] mass_mailing: handle UnidentifiedImageError while convert image to url
Currently, a logger exception is generated when the user tries to upload
any image as document in the mass mail.

This is because an UnidentifiedImageError occurs when the user uploads
an image file as a document and code [1] tries to open it with Image.

This commit adds code that handles an UnidentifiedImageError, and it adds
the message in the log for an invalid image file.

[1] - https://github.com/odoo/odoo/blob/029b84f3c061f819bacb9a4818504cced4adeb1c/addons/mass_mailing/models/mailing.py#L1405

sentry-4311184876

closes odoo/odoo#159653

X-original-commit: e4b7ec191fc81ec806736758f273e20b6260bbeb
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: ANSARI MAHAMADASIF (maan) <maan@odoo.com>
2024-03-29 04:01:13 +00:00
Florian Charlier 533a22189d [FIX] onboarding: skip test deleting a company
In 8e3283aa we solved the issue of onboarding progress records
preventing the deletion of a company. We also added a test for this
solution.
In practice, it will not always make sense nor will it be allowed to
delete a company and in some cases, the first thing that would fail
is a foreign key from another model where it wouldn't make sense to
cascade as we do for onboarding progress.

Some modules create related records when a company is created such
that it would be cumbersome to bypass that.

Therefore, we disable this test until a clean flow robust to all
sorts of installed modules configuration is implemented.

See runbot 60475
Task-3829936

closes odoo/odoo#159679

X-original-commit: ea215fe59b45a0c4ff29b4defb38f9ae91a6ca37
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2024-03-28 21:37:36 +00:00
Antoine (ande) 53885e4186 [FIX] phone_validation: brazilian phone numbers
Current behavior:
Brazilian phone numbers are not managed correctly
following the 2016 changes in Brazil.
(Adding a 9 to mobile phone numbers)

Fix:
Patched the phonenumbers library, adding a 9
at the right place for mobile phone numbers.

opw-3694150

closes odoo/odoo#159641

X-original-commit: a4f884456180769e0e7db7152d40ddcfb497b090
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2024-03-28 19:51:00 +00:00
vava-odoo 2ce67da4c2 [FIX] sale_loyalty_delivery: fix reward for multiple delivery lines
The method `_get_reward_values_free_shipping` assumes there is only one
delivery line per sale order. But it is not always the case. This commit
therefore makes sure the method does not raise an error in case of
multiple lines by taking into account only the first delivery line.

Fixes #136395

closes odoo/odoo#159584

Signed-off-by: Vallaeys Valentin (vava) <vava@odoo.com>
2024-03-28 18:06:45 +00:00
Mohammed Basioni 726d973ade [FIX] stock: convert inline templates with text to regular templates.
Strings within inline templates are not translatable, so we convert
these templates into standard templates so that they can be.

Task-3761551

closes odoo/odoo#158844

Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2024-03-28 18:06:44 +00:00
mathysPaul 64d1febc43 [FIX] sale_loyalty: prevent coupon removal on double apply
Addresses the issue where reapplying an already applied coupon
in the website shop led to the disappearance of the discount.
With this fix, the discount remains applied, and the system
continues to inform the user that the coupon has already been
used, preventing confusion and maintaining consistency in the
discount application process.

task-3621246

closes odoo/odoo#153485

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2024-03-28 18:06:43 +00:00
alsh-odoo 9cdeaf724c [FIX] payment_mercado_pago: fix traceback when the payment status is 404
This traceback arises when the payment status is 404

A comma at the end is forgotten while creating a tuple with single
record, which leads to a typeerror traceback.

Error:- "TypeError: 'in <string>' requires string as left operand, not int"

https://github.com/odoo/odoo/blob/7e3267fc69324a3c98d36983705a50420b5143f9/addons/payment_mercado_pago/const.py#L35-L39

sentry-5103720097

closes odoo/odoo#159613

X-original-commit: 9094afe724a7ee9771ae8c035fe3829b1c556c59
Signed-off-by: Altaf Shaik (alsh) <alsh@odoo.com>
2024-03-28 16:04:47 +00:00
Benjamin Vray 808780c89c [FIX] website: fix traceback with website form date(time) fields
Since commit [1], the "tempusdominus" date(time) picker has been
replaced by the OWL date(time) picker. A traceback appears when loading
a website form containing a field dependent on a date(time) field.

This traceback occurs because when checking the value of an empty
date(time) field (which happens when the user hasn't yet filled out the
form), we parse the field value into a Date(Time).

Before the changes in commit [1], we parsed this differently, which
didn't crash but returned "NaN" with an empty date(time) field.

In this commit, we now check whether a date(time) is valid and if not,
we now assign it "NaN" to maintain exactly the same behaviour as before
the commit [1]. Any value other than "NaN" would not work with the date
comparison system and would break certain conditions.

This commit also adds steps to the "website_form_editor" test tour so
that it fails without this commit.

[1]: https://github.com/odoo/odoo/commit/910897fc97d87b08f01627094ec8c159f5267628

task-3790809

closes odoo/odoo#158288

Signed-off-by: Robin Lejeune (role) <role@odoo.com>
2024-03-28 16:04:46 +00:00
Benjamin Vray d8d2199eec [FIX] website: fix conditional visibility depending on date field
Since commit [1], the "tempusdominus" date(time) picker has been
replaced by the OWL date(time) picker. This change resulted in a
modification of the HTML structure for date(time) input fields.

Consequently, a bug emerged in the visibility options for fields reliant
on a date(time) field. Specifically, the time condition selector failed
to display the time conditions because they are rendered based on the
HTML structure of the fields.

Since the code was not adjusted to fit the new structure, this
functionality stopped functioning.

[1]:  https://github.com/odoo/odoo/commit/910897fc97d87b08f01627094ec8c159f5267628

task-3790809

Part-of: odoo/odoo#158288
2024-03-28 16:04:46 +00:00
nda 6c897df473 [FIX] base: prevent ir.ui.view double display
Steps to reproduce:

- Remove all permissions to write/create/delete a view for the user "demo"
- Open a view form with "demo" user

Actual result:

- View code is displayed in plain text and with formatting

Expected result:

- View code is displayed with formatting only
- You can't edit the view or the translations

opw-3776073

closes odoo/odoo#159592

X-original-commit: a1f4e3de224d91e49d5adb2a6385d76c3282d206
Signed-off-by: Rémy Voet (ryv) <ryv@odoo.com>
Signed-off-by: Nicolas Danhier (nda) <nda@odoo.com>
2024-03-28 14:16:52 +00:00
damr 4b77afdac0 [FIX] sale_timesheet: currency displayed in project mapping
This commit's purpose is to display the correct currency for the hourly
cost of employee in the project sol mapping.
Currently, the currency displayed is the one of the sol instead of the
currency of the employee. This is due to this commit:https://github.com/odoo/odoo/commit/83760b9f10b4bfe6a83671e4426bc5596e8d5f5c
We added a monetary widget, but we are feeding it the wrong id.

After this commit, the correct currency is displayed

closes odoo/odoo#159588

X-original-commit: 8603d628bfc5c7dc620333ad674a1afb7b7123d1
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2024-03-28 14:16:51 +00:00
clesgow 9971fb02cf [FIX] {purchase_,}mrp: display routes for subcontracted boms
1. Fixes an issue where the parent product wasn't correctly set when
computing the routes of a component, leading on components from
subcontracted products displaying the wrong route (as it was trying to
resupply the selected warehouse instead of the subcontracted location).

2. If a route is found when searching for subcontracting routes but
doesn't lead to a way to resupply the stock (either buy buying or
manufacturing something), then ignore the found rules and revert to the
default of trying to resupply the stock location.
This avoids issue when using reordering rules to resupply the
subcontracted location instead, where the 'Buy' route would be hidden
even if it was selected.

closes odoo/odoo#159516

X-original-commit: c7b84a4a602f72c7a67144b7a81b38afe36e0eee
Signed-off-by: Quentin Wolfs (quwo) <quwo@odoo.com>
Signed-off-by: Steve Van Essche <svs@odoo.com>
2024-03-28 14:16:50 +00:00
Pedram (pebr) c6b1d287e7 [FIX] point_of_sale: ensure correct display of custom attributes
Before this commit, the custom attribute names were not correctly
displayed when added to an order.

opw-3795843

closes odoo/odoo#158805

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2024-03-28 14:16:49 +00:00
mjvi-odoo 3dda5576ac [FIX] project: add domain in parent_id in convert task/sub-task form
- Instead of raising an error, we simply exclude sub-tasks of the current
  task from the domain of the 'parent task' field

task-3584963

closes odoo/odoo#143282

Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2024-03-28 14:16:43 +00:00
mjvi-odoo 3219a17292 [FIX] project: resolve traceback task creation in project sharing
Steps to reproduce:
- In 'project sharing' create a task T in project A.
- Add 2 subtasks to task T in project A.
- Share project A in edit mode.
- Access the view form of task T as a portal user.
- Click on the subtask button to navigate to the tree/kanban view of subtasks.
- Select the kanban view.
- Create a new task on the fly, resulting in a traceback.

Issue:
- When a portal user creates a new task on the fly from the subtask kanban view,
  a traceback occurs, and the expected behavior of creating a new task Y in
  project A is not met. Additionally, task Y should not be a subtask of task T.

Solution:
- Resolve the traceback issue when creating a new task from the subtask kanban
  view as a portal user in project sharing.
- Ensure that the new task Y is correctly created in project A and is not
  set as a subtask of task T.

task-3584963

Part-of: odoo/odoo#143282
2024-03-28 14:16:43 +00:00
mjvi-odoo 210e93a8e2 [FIX] project: inability to save subtasks when project is added
Steps to reproduce:
- Access the 'project.task' module.
- Create a subtask.
- Attempt to save the subtask after adding a project to it.

Issue:
- Saving a subtask becomes impossible when a project is added, causing an
  obstruction in the process.

Solution:
- Rectify the functionality to enable successful saving of a subtask even after
  adding a project, ensuring a seamless process for subtask creation and
  association with projects.

task-3584963

Part-of: odoo/odoo#143282
2024-03-28 14:16:43 +00:00
Christihan Laurel [Vauxoo] ce6849548a [FIX] Payment: prevent error in rendering payment icon list with PIL incompatible icon image formats
Replace the use of 't-esc' with 't-field' for the payment icon image in
the icons list template. The latter, for an image field, provides two
options for rendering the payment icon image: use the PIL library to
obtain the image when given the option 'qweb_img_raw_data', or use a
URL. The former only considers the first option, allowing only image
formats compatible with the PIL library.

closes odoo/odoo#159586

X-original-commit: bc76cca37504b40eac73190363c452f89dca65ed
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2024-03-28 12:19:11 +00:00
Yaroslav Soroko (yaso) 23877778fd [FIX] hw_drivers: delete old files before download
When some clients are upgrading their databates and reconnect their IoT Boxes to the new version of the database, we currently can have an issue where the old iot handlers are not being overwritten, but the new ones are being deleted.

This happens in situations like where we add a new driver distinction in Windows, so its name "SomeDriver.py" becomes "SomeDriver_W.py".
Since we dont delete SomeDriver.py the IoT can have both drivers in such situations, causing conflicts and unwanted behaviors.

The goal here is to delete all the old drivers and interfaces before downloading the new ones to make sure we don't have this issus

task-3729890

closes odoo/odoo#159538

X-original-commit: 53a04406e6563d141b7b2378dc25b29b8a8086d6
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2024-03-28 12:19:09 +00:00