Commit Graph
170389 Commits
Author SHA1 Message Date
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
Victor Feyens 7cddd35acd [FIX] website_sale: non deterministic test failures
Wild try to avoid failures on runbot builds (not reproducible locally).

* simplify and split tour steps
* correctly specify check steps as isCheck: true
* make sure python setup is deterministic
  * batch template creation to avoid creation of dummy archived variant
  * target values for the variant to archive instead of its number in the
  list of variants

runbot build error 25046

closes odoo/odoo#159372

X-original-commit: 9906785faf81d3152a94942f8e25827d2234db29
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2024-03-28 12:19:08 +00:00
temo-odoo 3acb79bf2c [IMP] stock: added attrs in removal strategy field
In this commit:
==================
Invisible the 'Removal strategy' field when selecting the other
location type except Internal location.

task-3555853

closes odoo/odoo#157888

X-original-commit: f24a77d073d609b03c0ff686f843db10218ad1b7
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2024-03-28 12:19:07 +00:00
Victor Feyens dc7b75f9fb [FIX] sale: forbid pricelist changes on confirmed orders
It cannot happen through the default SO form view, but some funny guys
have found other ways to do it, even though it can be quite problematic,
especially if the new pricelist is in another currency.

closes odoo/odoo#157742

Related: odoo/enterprise#58744
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2024-03-28 12:19:05 +00:00
TSO 6f12d0ad42 [FIX] discuss: fix slider values in call settings
* Adds text values for the call settings sliders.
* Replaces `onChange` events with `onInput` events so that the values
 respect the position of the sliders.
* Debounces some functions to handle the increased amount of calls
due to the swap to the `onInput` listener.
* Changes the default value of `voiceActiveDuration` from `0` to `200`
to match the minimum value of the input.

closes odoo/odoo#151028

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2024-03-28 12:19:04 +00:00
Anna Janiszewska ba1d081d78 [FIX] website_sale_comparison: allow to compare no_variant attributes
closes odoo/odoo#159594

X-original-commit: 889fac0ea8452a5c778d98da81a91cbaff4116d4
Signed-off-by: Valentin Chevalier <vcr@odoo.com>
2024-03-28 10:19:45 +00:00
Maruan Aguerdouh (magm) c357496609 [FIX] website_slides: load animations after slide loaded
Issue: When using the Fullscreen mode of slides for articles we do run
first the website animations before loading the slide, which will make
the content to stay invisible since we will never actually perform the
animation.

Steps to reproduce:

1. Create a new course with an article content.
2. Add any block (text, image).
3. Add an animation to this piece of block.
4. Go to Fullscreen mode.

Solution:

We manually instantiate and attach the WebsiteAnimate widget to
the wpContainer element to ensure animations are properly initialized
and applied after the slide has loaded, after that we get rid of this
instance after every new slide that load so we avoid having multiple
instances.

opw-3757919

closes odoo/odoo#159445

X-original-commit: 593ca1f36a4a9da753d8361840b07e2445f2d99b
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
Signed-off-by: Maruan Aguerdouh Mohtar (magm) <magm@odoo.com>
2024-03-28 10:19:41 +00:00
Benoit Socias 469138e229 [FIX] web_editor: update all values when using up/down on multi-value
When using the up/down arrows in an `InputUserValueWidget`, only the
first value is updated but the other ones are lost.

This commit adapts the behavior so that all parts of the composite value
are updated.
When decreasing, parts that have reached zero are set to zero.

Steps to reproduce:
- Drop a "Banner" snippet.
- Select the text block.
- Set the "Border" option to "5 10".
- Press the up or down key.

=> Only the "5" was updated, the "10" was lost.

task-3800288

closes odoo/odoo#159385

Signed-off-by: Robin Lejeune (role) <role@odoo.com>
2024-03-28 10:19:39 +00:00
Benoit Socias 5a5b77de85 [FIX] web_editor: accept composite values starting with 0
When specifying a composite value in a `UnitUserValueWidget`, if the
first element is a 0, it is considered inactive and resets to its
default value.

This commit considers composite values that start with a 0 as active.

Steps to reproduce:
- Drop a "Banner" snippet in a page.
- Select the text column.
- Specify "0 10" in the Border.

=> The value was reset to 0.

task-3800288

Part-of: odoo/odoo#159385
2024-03-28 10:19:39 +00:00
Benoit Socias e321791f84 [FIX] web_editor: fix selectStyle with conflicting extraClass
Since [1] when `extraClass` was introduced, styles are wrongly applied
if an `extraClass` is defined on a `selectStyle` option, but both the
class and the option modify the same CSS property.

Typically, the "Round Corners" option sets the `border-radius` property
and uses the `rounded` extra class. But that extra class specifies
values for the `border-radius` properties.
Without the class, `applyCSS` determines that the style of some corners
is already `0px` and does therefore not need to be added to the inline
style.
But once the class is added, this is not true anymore - and the `0px`
should have been specified.

This commit avoids this issue by applying the CSS again once the
`extraClass` is added.

It also reverts [2] partially to remove the `extraClass` handling from
within the `applyCSS` function.

Steps to reproduce:
- Drop a "Text - Image" snippet.
- Select the image.
- Set the "Round Corners" to "50 0 0 0".
- Press tab to leave the field.

=> The entered field values was transformed.

[1]: https://github.com/odoo/odoo/commit/bf5b4b69330747af7b09d48e59218b78a29a4b14
[2]: https://github.com/odoo/odoo/commit/d3c3dab8950abc25b29937605091d8ce32305fa4

task-3800288

Part-of: odoo/odoo#159385
2024-03-28 10:19:39 +00:00
Thomas Lefebvre (thle) 8837302941 [FIX] website_hr_recruitment: take into account the website
Steps to reproduce:
-------------------
- create 2 websites (for one or two companies);
- create 2 jobs;
- publish job A in website 1;
- publish job B in website 2;
- as a public user go to website 1 and apply for job A;
- go to website 2 and try to apply for job B;

Issue:
------
When we encode the email address, we receive the message:
```
You already applied to another position recently. You can continue if it's not a mistake.
```

Cause:
------
We don't take into account the website linked to the job we are applying for.

Solution:
---------
Incorporate the website into the domain for application search.

opw-3798670

closes odoo/odoo#159263

Signed-off-by: Bertrand Dossogne (bedo) <bedo@odoo.com>
2024-03-28 08:41:11 +00:00
Ethan Vincent c6842f1304 [FIX] sale_management: dispense temp cache records
**Current behavior:**
If a recurring sale order has an associated sale order option
and the recurring plan of the order is changed, a trace back
occurs.

**Expected behavior:**
The recurring plan can be changed as it ordinarily would.

**Steps to reproduce:**
1. Add a recurring product to a sale order

2. Add an optional recurring product to the order

3. Try to change the recurring plan of the order to encounter
     the trace back

**Cause of the issue:**
This flow causes some 'phantom' sale order lines to have their
price recalculated (phantom because they have no price, qty,
currency, nor order_id field values). During this recalculation
a currency_id is expected either in the line itself or in the
sale order it is a part of. Because there is no value for either
of these, it fails the ensure_one() method in the sequence
(0 vals, expects 1).

The phantom lines are created in the `sale.order.option` model
in the `sale_management` module, in `_compute_price_unit()` and
`_compute_discount()`.

**Fix:**
Call `invalidate_recorset(flush=False)` on these cached records
at the end of the methods in which they are created.

opw-3754297

closes odoo/odoo#158950

X-original-commit: 16f51c93d0f9cadcdbcd9ed2d58e43ed0d550bf9
Related: odoo/enterprise#59301
Signed-off-by: Vincent Ethan <etvi@odoo.com>
Signed-off-by: Arnaud Joset (arj) <arj@odoo.com>
2024-03-28 08:41:09 +00:00
Mahamadasif Ansari 5177e21aea [FIX] website_slides: prevent exception while accessing embed external of slide
Currently, an exception is generated when the user tries to access embed view
of slides by following the steps:
 - Install "eLearning" with a demo data
 - Open external embed view of slide 1 by "/slides/embed_external/1" in url

Error:
`AttributeError: 'slide.channel' object has no attribute 'website_share_url'`

This error is because commit [1] added code that tries to access the
'website_share_url' field in the 'slide.channel' model in template
'embed_slide' , but it actually belongs to 'slide.slide'.

This commit resolved the above issue by accessing "website_share_url"
with "slide" instead of "slide.channel".

[1]-https://github.com/odoo/odoo/commit/db63c03af9932ae4d9b786620e88e62ce938589a

sentry-5095823727

closes odoo/odoo#159513

X-original-commit: e2e868cca86f09e4e71d47837432884e886a42c6
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: ANSARI MAHAMADASIF (maan) <maan@odoo.com>
2024-03-28 04:45:20 +00:00
Jeremy Kersten aa09df2584 [IMP] website_sale: avoid pollute urls with #attrs if no variant
closes odoo/odoo#159474

Signed-off-by: Valentin Chevalier <vcr@odoo.com>
2024-03-27 17:45:01 +00:00
Victor Piryns (pivi) 6101700868 [FIX] bus: split large NOTIFY payloads
Description:
On a database with heavy activity, it is possible for the payload
size we pass for the `NOTIFY` query on the bus to be larger than what
PostgreSQL allows by default, 8000 B. This limit is defined as:
https://github.com/postgres/postgres/blob/6686e9676c8faff4ee04c1574e117ae38f117efa/src/backend/commands/async.c#L158-L166
and it is used to compare the size of the payload before processing:
https://github.com/postgres/postgres/blob/6686e9676c8faff4ee04c1574e117ae38f117efa/src/backend/commands/async.c#L654-L657

Fix:
- Binary split the payload into multiple chunks if it's exceeding
  the above-mentioned limit. The unit of splitting is a channel, so
  if the content of one channel itself is larger than said limit, it
  is not handled, but shouldn't occur under normal circumstances.
- Introduce also a new ENV variable `ODOO_NOTIFY_PAYLOAD_MAX_LENGTH`
  to allow tweaking of the limit if they are running a handrolled
  custom PostgreSQL cluster.

Reference:
opw-3650618

closes odoo/odoo#159469

X-original-commit: 61c7bba44990522d853bae25aa7899cb03c72e31
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Signed-off-by: Piryns Victor (pivi) <pivi@odoo.com>
2024-03-27 17:45:00 +00:00
Guillaume-gdi a911014cd3 [FIX] website, test_website: clear menu cache correctly
[This commit] fixed an issue with the menu cache. Unfortunately, during
the forward port, we missed updating the cache key according to what has
been done in [this other commit]. This commit updates the cache key and
improves the test.

Steps to reproduce the bug fixed by this commit:
- Render a website without a record URL in the menu (to the cache)
- Edit the website's menu
- Add a link to a product page (e.g., customizable-desk)
- Add a link to another product (e.g., chair-floor-protection)
- Save the menu
- Click on the menu link to go to customizable-desk
=> At this point, the active menu element is correct
- Click on the menu link to go to chair-floor-protection
=> The active menu element does not update

This issue does not occur if there is a record like URL in the menu
before the first render.

[This commit]: https://github.com/odoo/odoo/commit/970c173530e5523d0e3242ad84dae6fe5e332d68
[this other commit]:https://github.com/odoo/odoo/commit/595aa248433246959a5fa9288e477091701c6a35

opw-3694651
opw-3750925
opw-3781668

closes odoo/odoo#159464

X-original-commit: 9b5647f2951cdd7bde214f860b5ea95d42d2a501
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Guillaume Dieleman (gdi) <gdi@odoo.com>
2024-03-27 17:44:59 +00:00
sesn-odoo 81e265cda9 [FIX] sale: allow access to parent branch fiscal positions on sale order
Currently, on sale orders, you cannot access parent's fiscal positions
from a branch.

Steps to reproduce
-----------------
* install `sale_management`
* set up a company hierarchy. Let's say we have two companies P and C
  such that C is a branch of P.
* let's say that P has a fiscal position F
* switch to company C
* attempt to set fiscal position F on a sale order

You will see that F does not appear on the list.

opw-3773335

closes odoo/odoo#159386

X-original-commit: fa419e550497b1291930f9fb8215a719de331024
Signed-off-by: Séna Serge Nshimiyimana (sesn) <sesn@odoo.com>
2024-03-27 17:44:57 +00:00
Mathieu Duckerts-Antoine 7ac5dcce09 [FIX] web: WithSearch: filtering search defaults
Before that commit, the search defaults would not be filtered when the
WithSearch is started with a search model state or updated by its parent.

closes odoo/odoo#159406

X-original-commit: dac527b7baa699cef0828a9d87a4c814ff3f7f05
Signed-off-by: Francois Georis (fge) <fge@odoo.com>
Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
2024-03-27 16:11:00 +00:00
kdeb@odoo.com 03743a714f [FIX] crm: resolve NewId error on SO-Linked tasks
Issue:
    - When adding opportunity/lead to a contact using Studio
     and attempt to add a line, we encounter the following error:
     "TypeError: 'NewId' object is not iterable."

Steps To Reproduce (in 17.0):
    - In a contact form open Studio and add a O2M field
     Customer (Lead/Opportunity)
    - Try to add a line
    - Notice Traceback Error "TypeError: 'NewId' object is not iterable"

Solution:
    - The issue arises in the search domain of
    `return_if_relevant` , exactly in
    ("partner_id", "child_of", lead.partner_id.commercial_partner_id.id)
    where the type of `lead.partner_id.commercial_partner_id.id`
    is NewId since the partner is being edited to add a task.
    This action triggers the `parse` and `to_ids` methods with
    a value type of NewId. thus the error.

    - The operator child_of expects a list of IDs, and the ids
    property refer to the record's origin ids. to resolve this,
    replace `commercial_partner_id.id` with `commercial_partner_id.ids`.

opw-3760372

closes odoo/odoo#159296

Signed-off-by: Kawtar Drissi El Bouzaidi (kdeb) <kdeb@odoo.com>
2024-03-27 16:10:59 +00:00
Arjun Panchal 5df277fbc5 [FIX] base_import_module: activate from form view and upgrade
Before this commit
==================
Unable to activate the industry from the form view in the industry section.
Additionally, the button in the form for upgrading would be called the
button_immediate_upgrade method, resulting in errors.

After this commit
=================
Activation of the industry from the form view in the industry section is now
possible. Furthermore, the issue with upgrading the industry from the form view
has been resolved.

task-3775729

closes odoo/odoo#157008

Signed-off-by: Pierre Masereel (pim) <pim@odoo.com>
2024-03-27 16:10:58 +00:00
Jitendra Prajapat 929b92076d [FIX] point_of_sale: total show Nan in coins pop-up
Before this commit:
===================
In coins/bills pop pup, if user adds some coin and removes quantity from any of
the fields (blank space) then it's showing `NAN` and not calculating the other
inputted value which is completely annoying.

After this commit:
==================
If user removes quantity from any of the fields (blank space) then the input
will count `0` in the backend and calculate accordingly.

task - 3728728

closes odoo/odoo#153770

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2024-03-27 16:10:57 +00:00
Pedram (pebr) 91b31d105d [FIX] pos_loyalty: Check gift card prefix from nomenclature
The barcode nomenclature allows to define custom prefix for gift cards.
e.g. the default nomenclature in demo data allows both 043 or 044 as
prefix for rule of type coupon.

Therefore the hardcoded string with 044 doesn't allow to sell a gift
card whose barcode does not start with this.

Instead of hardcoding the value, fetch it from the configuration and
the nomenclature that is defined in the settings.

OPW-3499787

closes odoo/odoo#159349

Signed-off-by: David Monnom (moda) <moda@odoo.com>
2024-03-27 14:09:50 +00:00
Florian Charlier 8846ad9545 [FIX] survey: fix test_survey_invite_action for session_code
In c983f8a5 we updated the `test_survey_invite_action` test
to create surveys in batch instead of one by one.
This is problematic because `session_code` (given by utility
method) must be unique for all surveys.

Technically, using 6-digit codes makes it very unlikely that
a collision occurs with existing records (see
Survey._get_default_session_code's iterative process).

Task-3829536

closes odoo/odoo#159295

Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
2024-03-27 14:09:49 +00:00