Commit Graph
170575 Commits
Author SHA1 Message Date
Atul Patel ac8c7febd3 [FIX] account: fixed tax name unique constraint error
due to the absence of IR model data entries for certain
account taxes, but with identical tax names, tax types,
and scopes, attempts to create standard taxes with the
same names alongside IR model data result in a constraint
violation, specifically, "tax name must be unique." To address
this constraint, we append "old" to the tax name for existing
taxes lacking IR model data entries.

see:
https://github.com/odoo/odoo/blob/740fb9ac8c8e121820feeac0e1f25a304e47da9d/addons/account/models/account_tax.py#L202

```
 File "/home/odoo/src/odoo/17.0/odoo/models.py", line 4864, in _create
    records._validate_fields(name for data in data_list for name in data['stored'])
  File "/home/odoo/src/odoo/17.0/odoo/models.py", line 1456, in _validate_fields
    check(self)
  File "/home/odoo/src/odoo/17.0/addons/account/models/account_tax.py", line 201, in _constrains_name
    raise ValidationError(
odoo.exceptions.ValidationError: Tax names must be unique!
```

closes odoo/odoo#161146

X-original-commit: 87e13a0f29ace57f1fd591d7180a64bb085a3bca
Signed-off-by: William André (wan) <wan@odoo.com>
2024-04-10 08:17:54 +00:00
Louis (loco) 9f2a920f2f [FIX] website_blog: display the total number of filtered elements
Steps to reproduce:
- Add the same tag to 13 different blog posts.
- On the "Blog" page, click on this tag to filter the blogs.

-> Problem: the result displays "12 Articles" but they are actually 13.

In this case, the result displays "12 Articles" as they are 12 articles
on the current page. When going on the second page of the results,
"1 Article" is displayed. This problem is solved by displaying the total
number of articles found after the filtering operation rather than the
number of articles on the page.

opw-3802729

closes odoo/odoo#161137

X-original-commit: 4e90dc9096cbcf9f2fe7f251b247c8d62bc0bc5d
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Colin Louis (loco) <loco@odoo.com>
2024-04-10 08:17:54 +00:00
Djamel Touati 4ff88bc7be [FIX] sale_crm: avoid displaying archived records in quotation
Before this commit, when the user created a new quotation from
Contact->Opportunity-> ("New Quotation" or "Quotations/orders widget
button", archived records could be added to the quotation
(e.g. ,product, taxes...) because the context was set to
active_test = false. After this commit, the context is configured back
to active_test = true when creating a quotation from opportunity.

opw-3802796

closes odoo/odoo#161087

X-original-commit: 3085c3b24bef719c3cf63ec9d3b5a7d7b2a34037
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2024-04-10 08:17:53 +00:00
reka-odoo 736ad5956a [FIX] web_editor: prevent typeerror at write of qweb fields
When user tries to empty start date or end date in website using editor,
a traceback will appear.

Steps to reproduce the error:
- Install "website_event"
- Go to Website > Events > Open any Event > Register > Edit
- Now try to empty start date or end date > Save

Error: A traceback appears:
"TypeError:'<' not supported between instances of 'bool' and
'datetime.datetime'"

https://github.com/odoo/odoo/blob/4759c6d1ee09c32381dc56c59c95949fd0e2807c/addons/event/models/event_event.py#L507
Here, When user tries to empty start date or end date,
start date or end date will become "False",
So it will lead to the above traceback.

solution:
A try-catch is used to catch typeerror at write of qweb fields.

sentry-5038057541

closes odoo/odoo#161083

X-original-commit: c893ff16e277b46796a943c5532e01e8edf8958f
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Renilkumar Kajavadra (reka) <reka@odoo.com>
2024-04-10 08:17:52 +00:00
nda 0f0b471c4c [FIX] pos_sale: open sale.report form view
7bbec42 removes the 'pos_done' state without providing a substitute.
A discrepancy arises between the states defined in pos.order and sale.report.

While pos.order can have a 'done' state, this state is not defined in
sale.report. Consequently, it is possible to encounter a situation where a
state exists in 'sale.report' without being defined in its state field.
This inconsistency leads to an error in the web client when attempting to
display the state 'done' from 'pos.order', as the system cannot locate a
corresponding label for it.

Since we can't add a new state in stable, we'll re-use the sale.order 'sale'
state which is the sale.order counterpart of pos.order 'done'.
steps to reproduce:
- go to sales / reporting / sales and go to pivot view
- remove all filters
- on the pivot view, select 'product category'
- click on a cell corresponding to POS (ex: all/saleable/pos)
- click on a line in the list view

before this commit:

Caused by: TypeError: Cannot read properties of undefined (reading '1')
    at get string (https://60795873-17-0-all.runbot129.odoo.com/web/assets/af70128/web.assets_web.min.js:8393:281)
    at SelectionField.template (eval at compile (https://60795873-17-0-all.runbot129.odoo.com/web/assets/af70128/web.assets_web.min.js:1500:374), <anonymous>:15:21)
    at Fiber._render (https://60795873-17-0-all.runbot129.odoo.com/web/assets/af70128/web.assets_web.min.js:940:96)
    at Fiber.render (https://60795873-17-0-all.runbot129.odoo.com/web/assets/af70128/web.assets_web.min.js:939:6)
    at ComponentNode.initiateRender (https://60795873-17-0-all.runbot129.odoo.com/web/assets/af70128/web.assets_web.min.js:1007:47)

after this commit:

the form view is rendered

opw-3816652

closes odoo/odoo#161065

X-original-commit: 483c49ba1fd2ef3a6986f77fbc622d19c93cc55c
Signed-off-by: Adrien Guilliams (adgu) <adgu@odoo.com>
2024-04-10 08:17:51 +00:00
damr 2cfb25c033 [FIX] hr_timesheet: make portal view readonly for ts
Currently, there is an access right problem concerning timesheet. The
module mrp gives write access to portal user on analytic line, but it is not
something we want for the project app.

step to reproduce:
- install hr_timesheet on a saas-16.3 db
- go to project app, open office design
- select any task, and add a subtask to it
- go the the view form of the subtask
- create a new timesheet for this subtask
- go back to the view form of the parent task
a button 'subtask timesheet' is now visible
- share the project in edit mode with a portal user
- connect with that portal user
- open the office design project
- go to the view form of the parent task and click on the button
- the user is redirected to a view tree with the timesheet of the
subtask
this view tree is editable

Source of the problem:
in the mrp module, the access rights of the analytic line is overwritten
to give write access to it to portal user.
Soluce:
We have to make the view in readonly mode for timesheet when the
connected user is a portal one. Unfortunately, it is not 100% possible
because setting the field to readonly still gives the user the
opportunity to click on those fields (which triggers access errors). So
we have to create new views and specifically open those views when the
user is a portal one.

affected version: saas-16.3 - master
task - 3751315

closes odoo/odoo#160959

X-original-commit: 7b733f118f60ff98d9f82c69453187d70e6bece0
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2024-04-10 08:17:49 +00:00
Bastien (bvdn) 079cc8b10a [FIX] product,purchase,sale_* : add product type to catalog product props
The sale_stock module patches the ProductCatalogKanbanRecord updateQuantity method
to prevent the quantity to go under the delivered quantity of the product

The issue is that we are also using the ProductCatalogKanbanRecord in the industry_fsm_stock module
in which the services product added to the sale order are considered by default but we would like to be
able to dimish their quantity in the catalog (in case of a missclick for exemple)

Since the service product can't be considered delivered in sale modules, the condition in updateQuantity
shouldn't change anything

Task-3689939

closes odoo/odoo#155157

Related: odoo/enterprise#55455
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2024-04-10 08:17:47 +00:00
Achraf b4d70e34f2 [FIX] web: Make datetime options help text clearer
Steps:

Install web_studio
Change language to French
Open any form view and enable Studio
Add a datetime field and click on it
In french we have the following message:
"Première date acceptée": Date formatée ISO ou "aujourd'hui" He says that we can use the string "aujourd'hui"
when we only expect "today" in English.

This commit changes the help text to display "today" in every language

opw-3829954

closes odoo/odoo#160904

Forward-port-of: #160144
Forward-port-of: #159654
Signed-off-by: Achraf Ben Azzouz (abz) <abz@odoo.com>
2024-04-10 06:46:43 +00:00
kcv-odoo 821ee43327 [FIX] web: fix binary field in settings form
Steps:
- Install sales app.
- Go to settings of sales.
- See header field there is no download button.

Issue:
- Binary field should have download button and
user should be able to download file with out
issue.

Cause:
- Since Settings is abstact model so it does not
contains id field in it and download button visibility
depends on id field.

Fix:
- Extend binary field for setting view to get proper
file from related field where actual file is stored.

task-3620555

closes odoo/odoo#160070

Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2024-04-10 06:46:42 +00:00
Joren Van Onder bea603f865 [FIX] l10n_br_sales: show price_total on lines
This module was introduced in saas-16.4. In that version the sale
order report and portal template displayed both price_subtotal and
price_total for each sale order
line. 655d375af8 removed price_total.

Because this module removes price_subtotal we end up with no line
total at all on the default Brazilian quotation PDF and portal
view (just 3 columns: description, quantity and unit price).

Loosely inspired by l10n_cl [1], this commit changes our approach to
turn the two places where we use price_subtotal into price_total. The
aforementioned commit also changed the heading of this column from
"Subtotal" to a more generic "Amount", so there's no inconsistency
there. Although this is a bit of a mess, I can't think of a better
solution.

[1] https://github.com/odoo/odoo/blob/655d375af83dd49bbbd5f5818e319c3b0e9778c1/addons/l10n_cl/views/report_invoice.xml#L173-L175

closes odoo/odoo#159794

Related: odoo/enterprise#59703
Signed-off-by: Josse Colpaert <jco@odoo.com>
2024-04-09 23:14:46 +00:00
Christophe Monniez 66d2e285d6 [FIX] *: fix missed E0601
Fix various "Using variable xxx before assignment". It was not detected
by pylint <= 2.5.0 which was the version enforced on runbot.

closes odoo/odoo#160886

closes odoo/odoo#161166

X-original-commit: 328a0ce2fa619376672c591d8b4f8892aaa2da1a
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2024-04-09 19:35:41 +00:00
Serge Bayet (seba) de33556926 [FIX] website: fix metadata open graph site name
This commit fixes the 'og:site_name' metadata, which previously
defaulted to the company name (see [1]), causing issues for multi-site
setups. Now, the metadata actually uses the site name.

Steps to reproduce:

- Navigate to any page
- Right-click and select "View Page Source"
- In the <head> section, observe the meta property "og:site_name" set to
  "MyCompany".

[1]: https://github.com/odoo/odoo/commit/156955de6b4e6288ac606d29b843081842154eff

opw-3791082

closes odoo/odoo#161123

X-original-commit: 24ea3ca4b12f8dd4103a650436a144e776b81d83
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2024-04-09 19:35:40 +00:00
Rahil Ghanchi 1dbfd086f8 [FIX] mass_mailing, website: fix the weird spaces in rating snippet
To reproduce the issue:

-Drag and drop the rating snippet.
-Change the score from options.
-Notice that spaces between icons disappear.

In the release notes[1] of jQuery 3.5.0, it's stated that security
fixes related to the HTML parser were implemented. Consequently,
self-closing e.g. `<i/>` tags inside function arguments were replaced
with e.g. `<i></i>`. As a result, trailing spaces lost significance,
causing icons to stick together.

Before the commit:

Prior to Odoo 16.2, jQuery 3.3.1 was utilized, which allowed the use
of self-closing tags in the append function. This behavior was as
expected.However, starting from Odoo 16.2, jQuery version 3.6.3 was
adopted.

After the commit:

Instead of using self-closing `<i/>` tags, `<i></i> ` with a trailing
space was used. This trailing space gained significance due to the
prefilter no longer ignoring it. Consequently, icons no longer stick
together after changing the score.

task-3576760

[1] https://blog.jquery.com/2020/04/10/jquery-3-5-0-released/

closes odoo/odoo#161076

X-original-commit: b897e836697a288bbd58a8efc340d9f7b2e76e30
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2024-04-09 19:35:40 +00:00
Ahmed Mohamed 565a5b1d4a [FIX] hr_holidays: hide confirm button during create
This ensures that the user will not click on the confirm button before the record is saved which will prevent unnecessary UserError if the Timeof type requires no validation

closes odoo/odoo#160839

Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
2024-04-09 16:43:46 +00:00
zel-odoo ec0ba10cea [FIX] mail: read from db when send notif in write
When writing in a discuss channel, the updated value sent to the client
should be read from the database, not directly from the values passed to
the write method.

Partially backport of https://github.com/odoo/odoo/pull/139563

closes odoo/odoo#158860

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2024-04-09 16:43:45 +00:00
qsm-odoo ce3b096de7 [FIX] website: make 'edit_menus' tour work without website_sale
The tour mentioned the "Shop" menu item since [1]. This is obviously
a mistake: the tour should work when only the website app is installed.

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

runbot-60696

closes odoo/odoo#161073

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2024-04-09 15:06:52 +00:00
aktr-odoo 7a7d6d0353 [FIX] phone_validation: update phone number parsing for mauritius
When the user adds a valid Mauritius phone number, it is not correctly parsed by
the phonenumbers library, resulting in a user error while sending a WhatsApp
message to that number.

Steps to produce:

- Create a new contact with the Mauritius country selected.
- Add a phone number (e.g., '+23057654321').
- Try to send WhatsApp messages using this phone number.
- This will throw an Invalid number error.

Problem:

`phonenumbers==8.12.1` python library is used in odoo for parsing phone numbers.
The `8.12.1` version is too old and cannot parse Mauritius phone numbers
correctly.

Solution:

The `8.12.13` version accurately parses Mauritius phone numbers. Currently, The
latest version of the phonenumbers library is `8.13.31`. Hence, the latest code
from the latest version of the phonenumbers library is monkey-patched into the
system.

Task - 3799632

closes odoo/odoo#161039

X-original-commit: c3743b5fcfb5d67c442e5eee9f084b684e4baac3
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2024-04-09 15:06:51 +00:00
Logan Staelens (lost) f7688eb47e [FIX] hr_expense: Unmatched journal entries date with expenses
Before when we create an expense report paid by company with multiple expenses of different dates then we posted the expense report. The journal entries had all the same date.

Now journal entries will match the date of the expense when it is an expense paid by company.

closes odoo/odoo#160990

X-original-commit: 77d53dd3d62016f97c19645b42c772204babdd45
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Signed-off-by: Logan Staelens (lost) <lost@odoo.com>
2024-04-09 15:06:50 +00:00
Demesmaeker dc9f3680c5 [FIX] sale_pdf_quote_builder: ensure only pdf inside quote
When creating a product document, it was still possible to save
something that wasn't a pdf. The check only happened when modifying it.

opw-3802795

closes odoo/odoo#160879

Signed-off-by: Morgane Demesmaeker <edm@odoo.com>
2024-04-09 15:06:49 +00:00
Thomas Lefebvre (thle) 47030fd605 [FIX] hr_holidays: ensure consistency with cap accrued time
Steps to reproduce:
-------------------
- create a time off accrual plan with:
    - cap accrued time equals to `True`
    - maximum leave equals to `0 days`
- create an allocation with this accrual plan
- run the scheduled action "Accrual Time Off: Updates the number of time off"
    (make sure you have the right "lastcall" and "nextcall")

Issue:
------
The number of days of the allocation is set to zero.
This scenario makes no sense from a business point of view.
In effect, we are blocking the accumulation of allocations at zero.
The result is that there will never be any days allocated to these allocations.

Solution:
---------
Add a constraint to force a maximum leave number
when cap accrued time is set.

opw-3847408

closes odoo/odoo#160626

Signed-off-by: Bertrand Dossogne (bedo) <bedo@odoo.com>
2024-04-09 15:06:48 +00:00
Laurent Smet bc0e9b3804 [IMP] account: Payment register wizard - writeoff to exchange diff
When a register payment is made with a writeoff in foreign currency
and when the user set manually an exchange difference account,
don't create a write-off. Instead, 2 cases to consider:
- When the payment is expressed in a foreign currency different than
the invoice's one, play with the rate between amount_currency and
balance and let odoo making an exchange difference accordingly.
That way, the payment has no write-off and the invoice is fully paid.
- When the payment is expressed in company currency but the invoice
has a foreign currency, force the exchange difference to use a rate
that will fully paid the invoice without creating any write-off line
on the payment.

task_id: 3717436

closes odoo/odoo#157398

Related: odoo/enterprise#58511
Signed-off-by: Claire Bretton (clbr) <clbr@odoo.com>
2024-04-09 15:06:45 +00:00
Soncrits 4e094189f9 [FIX] mail: call rpc before remove attachment or message
* Current Status

- when remove attachment or message, The system will perform deletion on
the interface before performing deletion in the DB. However, in some
situations, exceptions will occur during the deletion process. So it
will happen that the attachment or message has been deleted on the
interface but still exists under the database. From a function that
helps optimize user experience, it will cause a worse situation with
user experience

* Solution
- Make rpc calls before deleting messages or attachments on the
interface

closes odoo/odoo#161023

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2024-04-09 13:04:14 +00:00
tsm-odoo 52f4e26076 [FIX] mail: improve public page error wording
Before this PR, the error displayed in the public page was quite
cryptic. It was hard for the user to understand that error and even
harder to report it if needed. This PR makes the error more user
friendly.

task-3850559

closes odoo/odoo#160947

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2024-04-09 13:04:13 +00:00
Anh Thao Pham (pta) 15cb8f58d3 [FIX] l10n_it_edi: fix support of customers from San Marino
Steps to reproduce:
- Install Accounting, l10n_it_edi and Contacts
- Switch to an Italian company (e.g. IT Company)
- Go to Contacts and create a contact from San Marino:
  * Name: SM customer
  * Country: San Marino
  * Street, City, ZIP: [any]
  * Destination Code: [any]
- Create an invoice:
  * Customer: [the created contact from San Marino]
  * Product: [any]
- Confirm the invoice
- Generate E-invoice XML via "Send & Print" button

Issue:
In the XML, the destination code (i.e. CodiceDestinatario) is the
default one for non-Italian customer (i.e. XXXXXXX).
Also, the VAT number (i.e. IdFiscaleIVA) is the default value for
countries that are not in the European Union (i.e. OO99999999999).
However, since October 2021, San Marino should be handled differently
for Italian electronic invoices.
A specific destination code (i.e. 2R4GTO8) should be used for all
customers from San Marino.

Source: https://www.credemtel.it/fattura-elettronica/fattura-elettronica-san-marino/

Solution:
For customers from San Marino:
- Keep VAT number
- Set "2R4GTO8" as destination code

opw-3819054

closes odoo/odoo#160494

Signed-off-by: Quentin De Paoli <qdp@odoo.com>
2024-04-09 13:04:12 +00:00
Dylan Kiss (dyki) ecee62ccd5 [IMP] l10n_es: add CoA for Cooperativas
In Spain, "Cooperativas" have their own variant of the Spanish chart of
accounts. In order to support these businesses, we add two extra CoA
templates: Cooperatives - SMEs and Cooperatives - Complete.

task-3803050

closes odoo/odoo#159357

Signed-off-by: Josse Colpaert <jco@odoo.com>
2024-04-09 13:04:11 +00:00
Anh Thao Pham (pta) 457fbed386 [FIX] stock, mrp_subcontracting_purchase: fix subcontract location after dest. update
Steps to reproduce:
- Install mrp and purchase
- Go to "Inventory / Configuration / Settings"
- Activate "Storage Locations"
- Go to "Inventory / Configuration / Warehouse Management / Operations Types"
- Edit "Receipts" type by activating "Show Detailed Operations"
- Go to "Manufactoring / Configuration / Settings"
- Activate "Subcontracting"
- Create product: (e.g. Product XYZ)
  * Product Type: Storable Product
- Create a BoM for Product XYZ:
  * BoM Type: Subcontracting
  * Subcontractors: [any] (e.g. Azure Interior)
- Create a PO:
  * Vendor: Azure Interior
  * Products: 2 x Product XYZ
- Confirm the PO
- Open the picking from PO via the Receipt smart button
- In "Operations" tab, set done to 1
- On the picking form, change the destination location (e.g. WH/Stock/Shelf1)
- Save
- In "Detailed Operations" tab, a line should have appeared
- Select the same destination location on that line (i.e. WH/Stock/Shelf1)
- Validate the picking and create a backorder for the remaining quantity to produce
- Go to "Inventory / Reporting / Locations"
- Check the locations of Product XYZ (Search Product: XYZ - Group by: Location)
  => The "On Hand Quantity" for Product XYZ is as followed:
     * Virtual Locations/Production: -1.00 (correct)
     * WH/Stock/Shelf1: 1.00 (correct)
- Open the backorder picking from PO via the Receipt smart button
- Record the production of the remaining unit
- Validate the picking
- Go to "Inventory / Reporting / Locations"
- Check the locations of Product XYZ

Issue:
The "On Hand Quantity" for Product XYZ is as followed:
* Partners/Vendors: -1.00 (incorrect, it should be empty)
* Physical Locations/Subcontracting Location: 1.00 (incorrect, it should be 0.00)
* Virtual Locations/Production: -2.00 (correct)
* WH/Stock/Shelf1: 2.00 (correct)

Cause:
When the PO is confirmed, the stock picking and the stock move are created, they both
have the same source and destination locations.
However, in an overridden method from "mrp_subcontracting" module, a check is performed
on the move to determine if it is a subcontract.
If it is the case, its source location is set to the subcontractor location and so, the
source location of the picking and the move is not the same anymore.
When the destination location is changed on the picking, an onchange is triggering an
update of the destination location AND the source location of the move to the values
coming from the picking, erasing the subcontractor location set on the move.
The issue only happens for the backorder, because the source location update is not
propagated to the stock move lines.
In the case of the original picking, the move lines were already created with the
subcontractor location as source location.
But when the backorder is created, the move lines are created with the values coming
from a move without the subcontractor location.

Solution:
Do not propagate "location_id" from the picking to the subcontracting moves.

opw-3777379

closes odoo/odoo#161011

X-original-commit: e0f7577da1a42512d2fdc5ee316f27a1ce040522
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Anh Thao Pham (pta) <pta@odoo.com>
2024-04-09 11:19:48 +00:00
Nguyễn Đại Dương 0e85d5a25c [IMP] website_hr_recruiment: avoid redirect 301 in 'apply now' button
-Same behaviour as [1] we should use slug(job) instead of job.id

1: a2c6ddf8158bf40f13b5c5a8b89deb3d2ae8af6b

closes odoo/odoo#160972

X-original-commit: 721a8bd4b06668dac9fad0ba08a95b7943331918
Signed-off-by: Jérémy Kersten <jke@odoo.com>
2024-04-09 11:19:47 +00:00
kdeb@odoo.com c5cefea2dc [FIX] iap: add generic email domains to _MAIL_DOMAIN_BLACKLIST
Issue:
    When we have open tickets from anyone with
    the email domain @proton.me, they are linked
    together even though this domain is generic,
    not a private one.
    same issue with @cegetel.net and @dbmail.com

Steps To Reproduce:
    - Create three tickets with "@proton.me"
    domain but different addresses.
    - See that in the smart button, the tickets
    are linked to each other even though the
    customers are different.

Solution:
    - in `_compute_partner_ticket_count` we check
    if the email domain of the partner is in
    `iap_tools._MAIL_DOMAIN_BLACKLIST `, if not,
    we consider the email to be a company email
    which tickets can be grouped by.

    - the _MAIL_DOMAIN_BLACKLIST is a list of generic
    email providers on which IAP services should not run.
    Retrieving company information from them makes no sense.

    - To fix this issue I added `proton.me`,
    `cegetel.net`  and `dbmail.com`
    to _MAIL_DOMAIN_BLACKLIST

opw-3786308

closes odoo/odoo#160804

X-original-commit: 0258fccc217142e66873c1dbb99efbfdd70a3887
Signed-off-by: Louis Baudoux (lba) <lba@odoo.com>
Signed-off-by: Kawtar Drissi El Bouzaidi (kdeb) <kdeb@odoo.com>
2024-04-09 11:19:46 +00:00
yosa-odoo 4a1ae0e58e [FIX] hr_expense: prevent unnecessary quantity assignment
Steps to reproduce:
- with demo data
- go on expense report
- open the report from marc demo
- refresh

Issue:
New log note on each refresh

Note:
Issue happening only in 17

commit introducing the bug: https://github.com/odoo/odoo/commit/f261c83b0dbc27dacc9cd0e0d935d52626723dac
opw-3817367

closes odoo/odoo#160327

Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
2024-04-09 11:19:44 +00:00
Mahdi Cheikh Rouhou (macr) b3fbbb5713 [FIX] project_todo: display only one scrollbar in todo
Issue:
=====
double scrollbar appears in notes.

Steps to reproduce the issue:
=============================
- Go to notes
- Insert a table
- Add some columns and try to stretch the last one to the right until it
  goes outside the width of the editable.
- Click on the last cell to the right in the table and scroll left
- Another scrollbar will appear.

Origin of the issue:
====================
The part of the table that is invisible in the editor is considered as
overflow for the `html_field` so it will show a scrollbar which is not
needed since we already have a scrollbar in the edtibale.

Solution:
=========
We mark hide the overflow in `html_field` and let the editable takes
care of the overflow.

task-3721794

closes odoo/odoo#160953

X-original-commit: c98c58301da82ad896e296b9bbbdf6bbb0bc2a8e
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Signed-off-by: Mahdi Cheikh Rouhou (macr) <macr@odoo.com>
2024-04-09 09:37:54 +00:00
Paul Stroobant 433ce62a6a [FIX] mass_mailing: set html lang attribute in unsubscribe page
Steps to reproduce issue:

1. Download two languages, set one as the user's language, the other as the website's
2. Make sure MailHog is running
3. Create a Mailing Contact with two different Mailing Lists
4. Create a mail with a link to unsubscribe
5. Send mail to one of the Contact's Mailing lists
6. Through MailHog, click on the subscription cancelling link
7. The first line is in the user's language and the others in the website's language

Explanation:

While most of the webpage originates from an XML file, translated using the language of the website.
https://github.com/odoo/odoo/blob/2ad911dab1f34b1b6dda1016cc189f0fea64b12c/addons/mass_mailing/views/mass_mailing_templates_portal.xml#L118
The first line is passed through javascript and translated on the fly.
https://github.com/odoo/odoo/blob/efd178daee689192d4e930a075475587038b3e0d/addons/mass_mailing/static/src/js/unsubscribe.js#L50-L55
The line is translated thanks to an object fetched at the load of the page. The url where the object is located can receive parameters including the language, but defaults to the user's and is not set in our case.
https://github.com/odoo/odoo/blob/0ca2ca9e8914dda77166b62dc8c2e9dc1ca1d3a4/addons/web/static/src/legacy/js/core/translation.js#L73-L78

Suggested fix:

The language can be passed through the attribute `lang` of the document.
https://github.com/odoo/odoo/blob/658bc65b22dba86a35f6bba0f892427e1be4aed1/addons/web/static/src/legacy/js/core/session.js#L205-L211
https://github.com/odoo/odoo/blob/e251354ce4b7df1763247385413e98f975981479/addons/web/views/webclient_templates.xml#L10
This option is already used in `website` and, [since 16.0](https://github.com/odoo/odoo/commit/5136ac7e4daaadda396c45c8538a81f8d6c44c0e), is inherited once `website` is installed.
https://github.com/odoo/odoo/blob/c3c8003c6d1c4d694531c93e803e7e9cd7ebaa83/addons/website/views/website_templates.xml#L39-L50

opw-3748027

closes odoo/odoo#160921

X-original-commit: 2e1d11dd5a5609e43be6f1a36bc7f4e2ca20849d
Signed-off-by: Stroobant Paul (stpa) <stpa@odoo.com>
2024-04-09 09:37:53 +00:00
Nguyễn Đại Dương 0a7f6cffd6 [FIX] *: remove unnecessary t-key
-Since [1] we have add t-key for some template, but some aren't
necessary because they not load via Owl, therefore remove it to avoid
warning : "Unknown directives or unused attributes"

[1]: https://github.com/odoo/odoo/pull/130467/commits/a9b577dfcbd6c01abdc649a3ea61f80e9018832d#diff-0ba40f64ee7d28c08bdbb7273985adc0d2d2b63d8c3233aa2630e6ba4bde4df9

closes odoo/odoo#160863

Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2024-04-09 07:22:44 +00:00
Loan (LSE) 76a9c4d0c0 [IMP] hw_drivers: IoT log file download error and better name
Small improvements on the download logs button in the Iot App:
 - Log file contains the IoT name and date of generation
 - Internal server error araise if the logfile config is missing
 - Internal server error aised if the log file is missin

Was meant to be part of:
https://github.com/odoo/odoo/pull/159186

opw-3827121

closes odoo/odoo#160755

X-original-commit: a6bcfce6714c4a804fe84d81d8b9ee29c1440046
Signed-off-by: Loan Sens (lse) <lse@odoo.com>
2024-04-09 07:22:43 +00:00
Paul Stroobant 88437a0865 [FIX] web: reduce size of boxed layout header
Steps to reproduce issue:

1. Select a boxed layout document
2. Create an invoice and add lines until the pdf version is on two pages
3. Print the pdf
4. On every page except the first one, the body of the document is cropped by the header

Explanation:

The PDF consists of three parts: the header, the footer and the body, and they are added separately. The body is delimited by the paper format and margins. Those do not depend on the size of the header and the footer.
In the boxed layout, the height of the header is bigger than the default size of the top margin of the body. Because of that, it covers a part of the body.

Suggested fix:

By removing some whitespace, the header size has been reduced to a size smaller than the default margins of the document while keeping every information readable.

opw-3768511

closes odoo/odoo#160925

X-original-commit: 08ec6a850b1959f71833d1ea7b39f50ab7ff4ed8
Signed-off-by: Bastien Fafchamps (bafa) <bafa@odoo.com>
Signed-off-by: Stroobant Paul (stpa) <stpa@odoo.com>
2024-04-09 05:47:44 +00:00
Walid d17290425e [FIX] mrp: prevent kit product quant update
Steps to reproduce:
- Create a storable kit product
- Update on hand quantity:
only the components are displayed(correct behavior)
- In Inventory tab open Inventory Adjustement
- Possible to edit kit quantity

Bug:
In the product tab when trying to update qty the kit product is
replaced with its components instead but it is still Possible to
edit kit quantity directly in the inventory app

Fix:
introduced python constraint to prevent user from directly editing
the kit product qty in master
in standard just display a warning

opw-3681703

closes odoo/odoo#160978

X-original-commit: ba81d4ef64933dc025c7a473456c5c056ed69aac
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Walid Hanniche (waha) <waha@odoo.com>
2024-04-08 18:42:48 +00:00
Andrea Grazioso (agr-odoo) 9a7377d613 [FIX] sale,sale_project: downpayment rounding issue with multiple so lines
Create a SO with the following lines:
1. Price Unit 10000, tax 20%
2. Price Unit 10000, tax 20%
3. Price Unit 10000, tax 20%
4. Price Unit    50, tax 20%
Confirm, Create a downpayment of 840.0
Check the downpayment

Issue: Amount will be 840.01
This occurs because we compute the downpayment values aggregating
so line amounts line by line, each time multiplying for the downpayment
percentage and rounding the result.
Over multiple lines this mechanism may accumulate a rounding error.

opw-3812925

closes odoo/odoo#160781

X-original-commit: 1a21f40274d7d7c3c5029c3bb83214618cc2384f
Signed-off-by: de Wouters de Bouchout Jean-Benoît (jbw) <jbw@odoo.com>
Signed-off-by: Andrea Grazioso (agr) <agr@odoo.com>
2024-04-08 17:25:42 +00:00
Aaron Bohy cdd4fc68f2 [FIX] web: fix formatting of url field href
Before this commit, we didn't correctly detect when to prefix the
value of an url field for the href of its link.

closes odoo/odoo#160916

X-original-commit: 27458e3bdb545f550e60f1bd39addf188151c38b
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2024-04-08 14:37:54 +00:00
Antoine (ande) b49d5b7454 [FIX] phone_validation: panamas phone numbers
Current behavior:
Cannot send SMS to a partner that has
a mobile phone number from Panama.

Steps to reproduce:
parsed = phonenumbers.parse('6198 5462', region='PA')
is_valid = phonenumbers.is_valid_number(parsed)
is_valid == False

Cause of the issue:
Old versions of phonenumbers (external library) are not
updated to Panamas mobile phone numbers system change.

Fix:
Monkey patched the library
Similar as: https://github.com/odoo/odoo/commit/b21df8797141dac9f2cf0315658a08a238849f5b

opw-3682631

closes odoo/odoo#160885

X-original-commit: 1b6611f5d2d381ec53de8fce103759d6a5717d79
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2024-04-08 14:37:53 +00:00
Walid eb4f5fc929 [FIX] stock_barcode: set procurement group on new moves
Steps to reproduce:
- Confirm an SO with a storable product
- in barcode app open the created picking
- Scan a different product confirm the picking and create a backorder

Bug:
the new product is not added to the SO and the original picking isn't
linked the SO anymore

Root cause:
when new moves are created in the inventory app default_picking_id
is set in the context and is used in _default_group_id to set the group

Fix:
explicitly set the group_id when creating the move instead of relying
on the defaults from the context when possible
test: https://github.com/odoo/enterprise/pull/57408

opw-3644773

closes odoo/odoo#160812

X-original-commit: adb072ce198454801d306df90f30a14a79e3dd3d
Related: odoo/enterprise#60200
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Walid Hanniche (waha) <waha@odoo.com>
2024-04-08 14:37:53 +00:00
Sarah Bellefroid 82bf645341 [FIX] purchase: compute order line name with supplierinfo
Currently, when creating a purchase order, if the product has multiple vendor lines (with the vendor selected on the PO), the product description uses information from all the vendor lines; instead of using information from the vendor line that is used for the price.

Steps to reproduce:
-------------------
* Go to the **Purchase** App
* Go to **Products**
* Select any product
* Select the **Purchase** tab
* Add `Vendor Product Name` and `Vendor Product Code` in additional line fields
* Add two vendor lines
  * Line 1:
    `Vendor`: Vendor1
    `Vendor Product Name`: P1
    `Vendor Product Code`: A
    `Price`: 1
  * Line 2: <br>
    `Vendor`: Vendor 1
    `Vendor Product Name`: P1 bis
    `Vendor Product Code`: B
    `Price`: 5
* Select **Orders** > **Request for quotation**
* Create a new quotation
* Select Vendor 1, add the product for which we just added the two vendor lines
> **Observation**: The description of the product shows information from both vendor lines added.

Why the fix:
------------
This behavior was introduced when `name_get` was removed to use `dispay_name` instead.
* https://github.com/odoo/odoo/pull/122085/commits/a8b15c7ab5e2d850d0551a6eb4213bb20a30b210

When adding a product to the purchase order, the onchange on `product_id` is called. The onchange calls the function `_product_id_change`, which itself calls `_get_product_purchase_description`.
https://github.com/odoo/odoo/blob/7e9b9494a8d6c4bb8b3800cc0e25fcd3596db75d/addons/purchase/models/purchase.py#L1224
https://github.com/odoo/odoo/blob/7e9b9494a8d6c4bb8b3800cc0e25fcd3596db75d/addons/purchase/models/purchase.py#L1401-L1407

The line `name = product_lang.display_name` calls the function `_compute_display_name`.
* We do have a parnter_id in the context as we have selected a vendor on the purchase order.
  https://github.com/odoo/odoo/blob/7e9b9494a8d6c4bb8b3800cc0e25fcd3596db75d/addons/product/models/product_product.py#L434
* We don't have a supplierinfo in the context yet but we have multiple supplierinfo with the same partner_id.
  https://github.com/odoo/odoo/blob/7e9b9494a8d6c4bb8b3800cc0e25fcd3596db75d/addons/product/models/product_product.py#L466-L467
  Here we thus have 2 sellers.
* Ultimately, the display name joins the different display names computer for each seller.
  https://github.com/odoo/odoo/blob/7e9b9494a8d6c4bb8b3800cc0e25fcd3596db75d/addons/product/models/product_product.py#L473-L483

Coming back to the line `self.name = self._get_product_purchase_description(product_lang)`, we now have the name of the purchase order line set as the concatenation of display names from the supplierinfo, i.e `'[A] P1, [B] P1 bis'`.

Once the onchange is called, the function `_compute_price_unit_and_date_planned_and_name` is being called.
https://github.com/odoo/odoo/blob/7e9b9494a8d6c4bb8b3800cc0e25fcd3596db75d/addons/purchase/models/purchase.py#L1295
In the current state, we do not meet the if condition. Indeed, the line has a name (`'[A] P1, [B] P1 bis'`) but it isn't in the default_names (`['[A] P1', '[B] P1 bis']`). It somehow corresponds to a setting where the name of the purchase order line was setup by the user.

With this current fix, the call to `_product_id_change` will set the name of the line with the product information from the company; and not the partner. We also need to add this name to the `default_names` in `_compute_price_unit_and_date_planned_and_name` so that the description get recomputed with regards to the seller, if any.

opw-3802182

closes odoo/odoo#160778

X-original-commit: 6974f5303badbc5f5db104270f9492c12a52f220
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: Sarah Bellefroid (sbel) <sbel@odoo.com>
2024-04-08 14:37:50 +00:00
Romain Derie 8b5e912137 [FIX] website: fix the only linter error in the website.py file
Introduced with https://github.com/odoo/odoo/commit/d2fc67eef0b ...

closes odoo/odoo#160588

X-original-commit: 28b6736bd6c58a232e4a27224f0cadfac0c1e32c
Signed-off-by: Guillaume Dieleman (gdi) <gdi@odoo.com>
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2024-04-08 12:49:48 +00:00
Romain Derie 632e6bf5f9 [FIX] website: prevent crash if no url on menu
It should not be common, but through custo or in debug mode, one can
create a menu without an URL since it's not required on the model.
Through regular flows, it won't be possible since our UI won't let you
go through when creating a menu if you don't set a URL.

Followup of https://github.com/odoo/odoo/commit/948235079f002794f9837d3cf91e2d20e3254e20

X-original-commit: f2ac2ab72a190375c8116a11109191c0b7b970dc
Part-of: odoo/odoo#160588
2024-04-08 12:49:48 +00:00
Jeremy Kersten 2af6f0989c [FIX] l10n_in_sale: conditionnal hsn visibility
Don't show HSN value for sale.order not linked to this localization.

Before this commit, if you have multi company with multi localization,
you see this field whatever the current localization.
It uses the same condition than other report: purchase/invoice/...

closes odoo/odoo#160833

X-original-commit: e2a684018d7f92994aa5d30ded8f64703254f0fb
Signed-off-by: Olivier Dony (odo) <odo@odoo.com>
Signed-off-by: Jérémy Kersten <jke@odoo.com>
2024-04-08 11:13:51 +00:00
lase@odoo.com 1160d80da4 [FIX] website_sale: hide unpublished product to portal subcontractor
Steps to reproduce:

- Activate Subcontracting in the settings.
- Create a storable product
- Create a BOM of type "subcontracting" where the subcontractor is a
  Portal user (e.g. Joel Willis) for that product.
- Log out and connect as your portal user.
- Go to the website shop and search your product.

Expected behavior:

The portal user should only be able to see the published products.

Current behavior:

The portal user sees unpublished products for which he is subcontractor.

Cause of the issue:

The commit 99b56ec has introduced a subcontracting portal. In order for
portal users to be able to interact with product templates, the
following rule was added to the "base.group_portal":
https://github.com/odoo/odoo/blame/f0a0d596ab716c96de38a5c0f837da2924338d7b/addons/mrp_subcontracting/security/mrp_subcontracting_security.xml#L120-L131
When you go to the website shop, the records displayed in the shop will
be computed here:
https://github.com/odoo/odoo/blob/1c321cd1fe0aabd9cd92c13cd1eae604e5817ae0/addons/website_sale/controllers/main.py#L348
https://github.com/odoo/odoo/blob/f0a0d596ab716c96de38a5c0f837da2924338d7b/addons/website/models/mixins.py#L353-L357
However, during this call, the "ir.rule" added for portal users will be
added to the SQL query here:
https://github.com/odoo/odoo/blob/1c321cd1fe0aabd9cd92c13cd1eae604e5817ae0/odoo/models.py#L4682
As such, products (enven if unpublished) for which the portal user is a
subcontractor will be fetched and displayed in the shop.

Fix:

Since the "ir.rule" can not be changed only for flows involving the
`website_sale` application, we propose to make a change similar to
commit b1f6171 whose purpose is to hide unpublished products for non
internal users:
https://github.com/odoo/odoo/blob/1c321cd1fe0aabd9cd92c13cd1eae604e5817ae0/addons/website_sale/models/product_template.py#L105-L108

opw-3768845

closes odoo/odoo#160703

X-original-commit: d57db5b6a7ca4579145723139223cab3d8a7dd24
Signed-off-by: Valentin Chevalier <vcr@odoo.com>
Signed-off-by: Lancelot Semal (lase) <lase@odoo.com>
2024-04-08 11:13:49 +00:00
Florent de Labarre 7cb9e96f86 [FIX] stock: in multi company env the product type can be changed.
Without sudo, an user in a company can change the type even if somes not done stock.move.line exists.

closes odoo/odoo#160856

Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2024-04-08 09:27:29 +00:00
Julien Castiaux 851133ff06 [FIX] core: NotFound error without warning
The conditionnal `isinstance(exc, NotFound)` is shadowed by the
conditionnal `isinstance(exc, HTTPException)` two lines above. Nobody
ever complained that the warning for NotFound error was gone. Since
werkzeug 1.0.0, the status code in the response log is colored, 404 is
colored yellow which should catch the eye. The explicit warning line
isn't really necessary.

closes odoo/odoo#159895

X-original-commit: 851b91f19b87446662421cb8d801a9472725bc72
Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
2024-04-08 09:27:27 +00:00
ruja-odoo 439ad27b9f [FIX] web_editor: unable to add space in link label
Before this commit:

The cursor kept on flickering when attempting to enter a space at the end
of label text field of a link resulting in not being able to add space at all.

After this commit:

Now, it's possible to add  spaces at the end of a link label.

task-3820250

closes odoo/odoo#160780

X-original-commit: 1af59ba5054dae5272506aead8b2c8dd0e5616fb
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2024-04-08 07:35:59 +00:00
Pierre-Yves Dufays 1c81de987a [FIX] website_slides, website_event{_exhibitor,_meet}: fix "Go to website"
How to reproduce:
- Install website_slides with demo data
- Log in from localhost
- Log in from dev.localhost
- Switch to localhost
- (The system property web.base.url is http://dev.localhost:8069 but we are
on localhost)
- Go to a course in the back end and click on “Go to website” button

You are redirected to the frontend website home page instead of the course
home page.

This fix solves the problem.

Afer correcting this error for the courses (slide.channel), we have found the
same problem for:
- event.sponsor
- event.meeting.room
- slide.slide
So we apply the same correction for them.

Technical note: the button "Go to website" uses the open_website_url method of
WebsitePublishedMultiMixin that relies on website_url. That method expects a
relative URL in the computed field website_url and not an absolute one
(actually, the method already handle adding the website domain, so it expect
the relative part). The problem is that the compute method for the field
website_url of channel compute an absolute URL. The consequence is that the
user is redirected to the home page instead of the course page (by
WebsitePreview, see get path method). In stable, we cannot change easily
website_url to make it relative as it is used in other of places (ex.: if we
make it relative the share link in the sidebar on the frontend is relative
which is not correct and in mail template, the URL might not be correct as the
mail system append the default domain for relative URLs). So instead, we
override open_website_url to use a relative URL when the website is not
defined. If the website is defined on the course, we call the super
implementation because a domain change might be required. Note that by doing
that, we duplicate the code of _compute_website_url in open_website_url but
making the URL relative instead of absolute. So we should clean that in master.

Task-3635856

closes odoo/odoo#160763

X-original-commit: 1f798428fc0f403755512a45f67b5f70aae0c808
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
Signed-off-by: Pierre-Yves Dufays (pydu) <pydu@odoo.com>
2024-04-08 07:35:58 +00:00
Damien Bouvy ed60ac7cea [FIX] website_sale: wrap shop card's bottom content
In mobile, having a somewhat 'large price' (like a few thousands
currency units) can cause the bottom of the card to overflow (esp.
if buttons like 'add to card' or 'add to wishlist' are present).

This commit modifies the card template so that content is normally
spaced and can wrap to a new line if need be.

opw-3706637

closes odoo/odoo#160628

Signed-off-by: Bouvy Damien (dbo) <dbo@odoo.com>
2024-04-08 07:35:57 +00:00
mathysPaul d9b6faea4d [FIX] payment_stripe: Correct Afterpay shipping info
Resolves an issue with Afterpay via Stripe not receiving correct
shipping address details, causing transaction failures. Now,
ensures shipping address from the order or invoice is accurately
sent to Stripe if we have it.

opw-3419984

closes odoo/odoo#160300

Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2024-04-08 07:35:54 +00:00