Commit Graph
163790 Commits
Author SHA1 Message Date
Michael (mcm) 04fddc19d4 [IMP] web: improve patch function
This commit refactors the patch function in order to simplify its code
but also and most of all remove the `this._super` bound on each patched
method call.
The patch function now supports the javascript keyword `super` to
get the parent's property.
This removes constraints we had with `this._super`. We had to create a
rather complicated intermediate function to bind `this._super` and this
function was called each time before we called a patched method.
It was annoying for debugging but necessary. Because of this
intermediate function `this._super` was also had to re-bind each time
we entered a patched method which was annoying with async method, we
had to save the parent method in the patch before awaiting its
execution. Finally, not a big issue but still, objects could not have a
`_super` property as it would be hidden in the patch.

task 3410198

Part-of: odoo/odoo#125716
2023-08-02 17:29:05 +02:00
hiroh-odoo a8bfdf8df2 [IMP] hr_timesheet,project,*: improve task analysis and list view
*=sale_timesheet.

In this commit improve following UI in task analysis and list view,

- aggregate the sum of following fields in project.task list view, hours spent
  on sub-tasks, total hours, progress.
- in project.task list view move 'id' after the 'state'.
- from task analysis remove the measure 'remaining hours percentage'
  from graph and pivot view.

task-3330295

closes odoo/odoo#124396

Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-08-02 17:29:00 +02:00
Tiffany Chang (tic) 1b2617a85e [IMP] purchase_stock: add orderpoint vendor filter
Add a new filter to the orderpoints view to allow filtering by vendor.

closes odoo/odoo#101090

Task: 2964309
Signed-off-by: Tiffany Chang <tic@odoo.com>
2023-08-02 17:28:56 +02:00
niai 150139a0ac [IMP] stock: add ability to "Order to Max" in replenishment
Before this commit, there was no functionality to trigger replenishment before
min qty is reached. This commit adds a "Order to max" button to top of list view
of replenishment when orderpoint(s) are selected. This button will trigger
replenishment for lines where Max Quantity - forecast > 0.

Taskid: 2964309
Part-of: odoo/odoo#101090
2023-08-02 17:28:56 +02:00
stefanorigano (SRI) 330ed0bfb5 [FIX] web: tagsList, enhanced edition
This commit focuses on fixing the UX for managing avatars and badges
within `tagsList` in edition mode. The changes include:

For Avatars:

- Implemented an overlay effect on :hover, making it clearer which entry
  is currently selected, providing a visual cue for users.
- The "remove" button now appears on :hover only, reducing visual
  clutter and improving visual scanning.

For Badges:

- Added visual feedback when hovering the "remove" button, making it
  more apparent and user-friendly.

task-3439555
part of task-3326263

closes odoo/odoo#130485

X-original-commit: 649a58cd88c4d74cdd62f47c1c0c354ced143481
Related: odoo/enterprise#45028
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-08-02 16:00:46 +02:00
Julien Alardot (jual) b88a846866 [IMP] l10n_ca: Add/Imp COA, taxes, reports
Complete refactor of the module,
adding the tax report

task-3098316

closes odoo/odoo#130476

X-original-commit: fd2c6dce8e5bee5ac526e7f3edeb398a992f84b1
Related: odoo/enterprise#45024
Signed-off-by: Laurent Smet (las) <las@odoo.com>
Signed-off-by: Julien Alardot (jual) <jual@odoo.com>
2023-08-02 16:00:38 +02:00
FrancoisGe 02c8a53bdc [FIX] hr_holidays: use record.resId
Since the relational model was rewritten (PR 114024), the record id
is no longer present in data. We must replace record.data.id with record.resId.

closes odoo/odoo#130466

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-08-02 16:00:28 +02:00
nni-odoo 0630caceac [IMP] l10n_tw: Chart of Accounts
Chart of Account Update with their translations

2865568

closes odoo/odoo#130463

X-original-commit: efbd486e4c114cb9f6dff2bbbf9a2ff23212ca61
Related: odoo/enterprise#45016
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
2023-08-02 16:00:19 +02:00
tsm-odoo e11612afbb [FIX] mail: fix setup manager copy registry
Before this commit, an event listener was added on
several registries to copy the required registry for
mail tests. The registries should be copied once when
the test suite begin to avoid side effects in tests.

closes odoo/odoo#130461

Related: odoo/enterprise#45014
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-08-02 16:00:10 +02:00
FrancoisGe ce774f1322 [FIX] web: complete x2m activeField
The goal of this commit is to complete the list of activeFields for
an x2many in list mode when a record is opened with the fields present
in its form view. This ensures that there is always an activeField
for all the data in a record. Before this commit, when the x2many's
form view was not inline, when the form view was closed, the fields
not present in the list view no longer had an activeField, which could
cause crashes.

closes odoo/odoo#130453

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-08-02 16:00:01 +02:00
Julien Carion (juca) 7e6dd0e7c0 [FIX] mail, hr: fix avatar card popover
This commit introduces various fixes regarding the avatar card.
First one makes sure that the avatar card popover won't launch when
there is no user image associated with the many2one_avatar_user_field.
Second one prevents the card from opening when the related model is not
"res.users".
Third one allows to display the phone number of users even without hr
installed and makes sure that the work_phone and work_email are shown
in priority if available when hr is installed.

Direct fix to Task-3167110

closes odoo/odoo#129876

Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
2023-08-02 15:59:50 +02:00
Jurgen (jugj) f1e17a30f7 [IMP] fleet : Add D.E.A history view for Belgium
In this PR we add the automatic encoding of disallowed expenses rates for fleet based on tax deduction
task-3186404

closes odoo/odoo#125548

Related: odoo/enterprise#42768
Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
2023-08-02 15:59:33 +02:00
Pierre-Yves Dufays 169eaec793 [IMP] base,test_new_api,website:prevent merge of partners with more than 1 user
We prevent to merge partner linked to more than one user (by raising an
exception) to avoid having multiple user pointing to the same partner as a
consequence of a merge.

We want to avoid this situation because it generates weird behaviors. As
res.user inherits from res.partner, having multiple user pointing to the same
partner makes the fields of that partner shared with all those users. This was
decided following the tentative to improve partner merge in website_slides
(odoo/odoo#114840), where we also noticed strange behavior like completing a
lesson with one user were adding karma to all the users linked to a same
partner.

We have also adapted WebsiteVisitorTests tests in website that were failing
because they were merging partners with more than one user: simply by merging
partners with only one user.

Task-3167160

closes odoo/odoo#125322

Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
2023-08-02 15:59:24 +02:00
Hugo Carlier (Huca) ebfb7112c5 [IMP] project: modify the behavior of parent tasks deletion
Before this commit, when deleting a task with subtasks, only the parent
task was deleted. As child tasks are the required to have the same
project_id as their parent, they could end up views of another project
with no clear link to it. Generally speaking, keeping child task, when
their container (parent task) is removed does not make sense.

Therefore, this commit changes the default behavior for task
deletion. When a parent task is removed, all its child tasks are removed
as well. To avoid such a behavior in exceptional situation where child
task can make sense without their parents, the user first need to remove
this link before unlinking the parent task.

A warning is added in all the views where a task can be deleted (form,
calendar and list) to warn the user of this new behavior when he deletes
a task.

task-3044991

closes odoo/odoo#121260

Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-08-02 15:59:20 +02:00
Jurgen (jugj) a64a8b7813 [IMP] hr_contract : Rework the contract form view to make it lighter
In this PR we make several UX changes that should make the life of the user easier:
- Add the possibility to upload personal documents in the contract
- Fine tuning of some fields (control of exclusive fields, conditional appearing of certain fields to not overcharge the display)
- Improve the order of tabs and their layout

task-3069359

closes odoo/odoo#122116

Related: odoo/enterprise#39804
Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
2023-08-02 15:59:16 +02:00
Alexandre Kühn 0f6e28098e [FIX] mail: starred counter should have muted background
Before this commit, all badge color matched the messaging menu
color badge. Most badge counter in discuss show needaction counter,
so it makes sense to have a catchy color scheme (e.g. white text on
red background).

For starred counter in discuss sidebar, the counter is meant to see
at a glance how many messages are starred, without it being too
catchy.

This commit fixes the issue by introducing a `o-muted` modifier on
`o-discuss-badge`, which displays a grey background for starred
counter.

Also fixes a bug in dark mode where badge background color was
incorrect.

closes odoo/odoo#130452

X-original-commit: de232c330140fd4156e7f416fddfce88b21e71c5
Signed-off-by: Didier Debondt (did) <did@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-08-02 14:41:33 +02:00
Valentin Chevalier 8d8637453e [FIX] payment_stripe: don't show button when there is nothing to pay
When applying a coupon, the amount can be totally covered, with nothing
left to pay. Express Checkout buttons should not be shown in that case.

After this commit, Stripe's Express Checkout buttons will not be shown
if the amount is not defined.

opw-3427969

closes odoo/odoo#130450

X-original-commit: 87e24d16c3dde8ab03d7c966b532f75a8c40ac30
Signed-off-by: Valentin Chevalier <vcr@odoo.com>
2023-08-02 14:41:26 +02:00
Martin Trigaux 360915b3f0 [FIX] base: remove wrongly untranslated term
The label was already Status on the field but not in the search view.
"State" is always used for the meaning location.
Sharing the same term meant it was not possible to have two different
translations.

closes odoo/odoo#130444

X-original-commit: 70fcdf30fc842410aafa9e61d2a1903589a15311
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-08-02 14:41:18 +02:00
Alexandre Kühn 30a0c7a84a [FIX] mail: vertically align subtype description and tracking value
Follow-up of [1]

Before this commit, when a message had both subtype description and
tracking values, they were displayed horizontally instead of
vertically.

This happens because [1] set `d-flex` on `textContent`, which is
horizontal by default. This assumes there's only 1 HTML node for
actual `textContent` so that message action list could be
positioned next to 1st text content line.

However, when message has subtype description and tracking values,
there is more than 1 HTML node in `textContent` and the intended
visual is showing them in `d-block`. This `d-flex` made them display
horizontally instead of `d-block`.

This commit fixes the issue by having a single actual HTML node in
`textContent` when there's a subtype description and some tracking
values. This allows to position `textContent` parts as desired
(e.g. with `d-block`) while having position of message action list
working as intended in original template of `Message`.

[1] https://github.com/odoo/odoo/pull/128940

closes odoo/odoo#130435

X-original-commit: 469f46c602c842c7a7fae49e0af701e979ff18ba
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-08-02 14:41:13 +02:00
vlst e5500cd788 [FIX] point_of_sale: Error pos category
Impacted Version : Master only

Issue: Traceback when clicking on the `New` button
in the `POS Product category` view. 

Steps to reproduce :

	Step 1: Open POS 

	Step 2: Go to Configuration

	Step 3: Open product category

	Step 4: Click on New -> traceback appears

The cause of the issue is trying to access properties
on a record that is not yet created.
The solution is simple: we adapt the code such that it
can handle the case where the record is not yet created

closes odoo/odoo#130398

Task: 3450117
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-08-02 14:41:10 +02:00
Didier (did) 93f134d640 [FIX] im_livechat: reintroduce history command
task-3435244

closes odoo/odoo#130362

X-original-commit: 2e834a8439cc260c25d95233492df13e9b77c2de
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
2023-08-02 13:20:34 +02:00
Jorge Pinna Puissant fa5c70d61d [REF] web: RelationalModel: unity always return an object for many2one
Before this commit, in some cases (many2one invisible) unity returned
an integer as value.

Now, to be consistent, unity always return an object for many2one.

Note that, web_read_group still returns an array as value for many2one.

part-of task-id~3179751

closes odoo/odoo#130340

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-08-02 13:20:30 +02:00
Pierre Pulinckx (pipu) 09535ef5e6 [REF] website_*: Change registerTours of tour_utils
As steps are encapsuled in an arrow function from
69a5d8e3ce47238 for steps tour definition to avoid
direct Markup(_t()) interpretation, the same is done
for registerWebsitePreviewTour() of
"odoo/addons/website/static/src/js/tours/tour_utils.js"
in this commit.

This is done in anticipation of the use of
_t() (import from @web/core/l10n/translation) with
registerWebsitePreviewTour().

task-3292454

closes odoo/odoo#130248

Related: odoo/design-themes#678
Signed-off-by: Luca Vitali (luvi) <luvi@odoo.com>
2023-08-02 13:20:23 +02:00
tsm-odoo 7b88ae4760 [FIX] mail, *: start bus service lazily
*: im_livechat, web.

Since [1] the messaging service is added to the livechat embed
bundle. As a consequence, the bus service is started even when
it is not needed. This is wrong since it would lead to lots of
useless connections to be made.

This PR prevent mail services from starting the bus eagerly in
this context and adds a tour in order to prevent further errors
on this matter.

closes odoo/odoo#130059

X-original-commit: b2bcef3c3b57061ef0694a5fc3c326cc8babc818
Related: odoo/enterprise#44782
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-08-02 13:20:11 +02:00
Julien Carion (juca) 6da48dbc95 [IMP] web: add show weekends to calendar
This commit adds the "show weekends" functionality to calendar which
allows the user to choose whether weekends should be shown in the calendar
or not (defaults to false).

task-3425523

closes odoo/odoo#129107

Signed-off-by: Luca Vitali (luvi) <luvi@odoo.com>
2023-08-02 13:20:07 +02:00
Matheus Leal Viana (malv) 07cf57b2dd [FIX] account,l10n_be: Translate BE reconcile template
Versions:
---------
- saas~16.2+

Steps to reproduce:
-------------------
1. Install Belgium accounting module
2. Switch to the company with the template
2. Go to Accounting -> Bank -> Reconcile Items

Issue:
------
Translations are only being loaded in French

Cause:
------
There is no translation assigned to the other
expected language: English, German and Dutch,
and the field name of `account_reconcile_model`
did not have the parameter translate = True

Solution:
---------
To fix this issue we have to add the respective
translations using name@Lang and add the parameter
`translate = True` in the field name of
`account_reconcile_model` so that the translations
can be loaded to this field.

OPW-3316716

closes odoo/odoo#126542

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2023-08-02 13:20:03 +02:00
Ahmed Khalaf be8e6281f6 [IMP] stock: optimize move reservation
This commit improves the performance of reservation by removing
the `get_available_quantity` and `update_reserved_quantity` inside
`_action_assign` which each does a search on quants with the same domain,
both of which are done per move to assign.

Instead the quants needed by the moves to reserve are fetched first and
are then filtered in memory for each move to reserve from.

A new function is provided `get_quants_by_product` which should be used
when reserving moves to fetch the relevant quants once and then call
`_update_reserved_quantity` on them which will filter them in memory.
This avoids searching for quants for every move.

The changes in `point_of_sale` and `product_expiry` are all
due to the the method signature change and change nothing in the flow.

Performance stats:

These stats are from the Odoo profiler on the `_action_assign` called
on a specific number of moves. For each number of moves the duration was
taken multiple times and the average was taken. The 10 moves durations
were quite random since the numbers were very small and could be considered
an outlier.

Before this commit:

| No. of Moves  | SQL Queries | Duration (s) |
| ------------- | ------------- | ------------|
| 10  | 70  | 0.044440283 |
| 100  | 633  | 0.398992664 |
| 1,000  | 4,518  | 6.264924025 |
| 10,000  | 46,954  | 79.76809310 |

After this commit:

| No. of Moves  | SQL Queries | Duration (s) |
| ------------- | ------------- | ------------|
| 10  | 62  | 0.062840558 |
| 100  | 540  | 0.323033646 |
| 1,000  | 3,893  | 4.062329989 |
| 10,000  | 39,259  | 49.92596793 |

Besides 10 moves duration, there's a general performance
improvement of 20% - 35%

closes odoo/odoo#116803

Related: odoo/enterprise#40633
Signed-off-by: Tiffany Chang <tic@odoo.com>
2023-08-02 13:19:55 +02:00
adsh-odoo 40b17cee0f [FIX] crm: update the helper store
As the "Create" button is renamed to "New" so update it and remove "top left" in
helper to enhance clarity and avoid any confusion.

Task-3420529

closes odoo/odoo#130432

X-original-commit: 7a1bcb9c74eb48877731367b3da95c1eec7db19b
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-08-02 06:18:53 +02:00
Brice bib Bartoletti 44a9c61ea5 [FIX] l10n_gr: make tax data comply with constrains
The aim of this commit is to correct the tax data

Context:
The constrains linked to tax repartition line aren't triggered.
This resulted in some invalid data to be merged.

Before the commit:
l10n_gr contains invalid tax data

After the commit:
l10n_gr tax data are valid

closes odoo/odoo#130426

Task-id: None
X-original-commit: 671d8fc49e3386ab7117b46f03a6fd4118ac22b9
Signed-off-by: John Laterre (jol) <jol@odoo.com>
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
2023-08-02 06:18:50 +02:00
Guillaume (gdi) ca10ad3c2a [FIX] website: ignore carousel slides for history step
When you drop a block containing a carousel, you can change the slide.
Unfortunately, in edit mode, changing the slide creates a step in the
history (you slide in the other direction by pressing CTRL-Z). This is
not what you want.

task-3356629

closes odoo/odoo#130417

X-original-commit: 5c68489c4220fe50c26168f2fb98546626b36e78
Signed-off-by: Colin Louis (loco) <loco@odoo.com>
Signed-off-by: Guillaume Dieleman (gdi) <gdi@odoo.com>
2023-08-02 06:18:43 +02:00
Julien Alardot (jual) 029a1ab2cc [FIX] hr_expense: Fix rounding mismatch
When paid by the company in another currency
with at least one tax, there may be
a rounding difference between the move and the expense

task-3390444

closes odoo/odoo#130397

X-original-commit: c889dcc83daeaccb09b7692e430e232778fc031d
Signed-off-by: Laurent Smet (las) <las@odoo.com>
Signed-off-by: Julien Alardot (jual) <jual@odoo.com>
2023-08-02 06:18:39 +02:00
Julien Alardot (jual) a1d92ddd4a [FIX] hr_expense: Fix reports and moves accounting date
The accounting date on the report sheet and the linked
moves are always set at the current date

We want the accounting date to be the expense date,
or the most recent expense date when possible

task-3390444

X-original-commit: f1d03364230058f77f23bf0083e2757c8cd98e9a
Part-of: odoo/odoo#130397
2023-08-02 06:18:39 +02:00
MerlinGuillaume 86399fc785 [FIX] web: ignore incorrect Safari errors
Steps to reproduce: (on Safari only)
1. Install Email Marketing and Mass mailing on sale orders
2. Open Email Marketing and try to open 'Our last promotions, just for
   you!'
3. An error is thrown

Solution:
Ignore errors raised in Safari

Problem:
Error "ResizeObserver loop completed with undelivered notifications." is
raised by the ResizeObserver in
`mailing_mailing_view_form_full_width.js`. However in Safari (and
desipte the ResizeObserver flow being exactly the same than in other
browsers), the error message is "Script error." so we are not able to
correctly discard it in the error listener of `error_service.js`

opw-3339673

closes odoo/odoo#130389

X-original-commit: d00144d1198131ba7c68466b514518ca056ceef0
Signed-off-by: Francois Georis (fge) <fge@odoo.com>
Signed-off-by: Guillaume Merlin (megu) <megu@odoo.com>
2023-08-02 06:18:32 +02:00
aktr-odoo 2e35ae4194 [FIX] l10n_es_edi_facturae: handle traceback while send an invoice to partner
When the user attempts to send an invoice to a partner whose country code is not
set.

Steps to produce:
- Install sale_management,l10n_es_edi_facturae
- Open invoicing module > Create a new invoice
- Select a customer who does not have set country_id.
- Click on Add a line > Select any product
- Click on Confirm > Click on Send & Print > Click on save
- Click on Send & Print
- Error will be produced

This commit addresses a `KeyError False` while the user attempts to send an
invoice to a partner without a set country code. The function
`_l10n_es_edi_facturae_export_facturae` uses the partner's country code but
the partner doesn't have a set country code. As a result, a `KeyError` traceback
is generated.

Sentry-4330095746

closes odoo/odoo#130382

X-original-commit: 421d370ed30ff92a85bf7db0f4d6f1f3431b2b34
Signed-off-by: John Laterre (jol) <jol@odoo.com>
2023-08-02 06:18:20 +02:00
Guillaume (guva) a72299fef1 [FIX] account: tax details query
When having a cash rounding line on an invoice,
base amount is taken twice into account in the tax
report when grouping by account > tax or tax > account.

Steps:

- Activate cash rounding, and create one with
  0.05 rounding, method 'HALF_UP' and
  'biggest_tax' strategy
- Create an invoice with a product line with
  unit price 1.24$, tax 15% (included in price)
- Select the rounding method created above.
- A rounding line for tax 15.0% and 0.02$ should
  have been created
- Go to tax report and group by Account->Tax or
  Tax->Account
-> Base amount is 2.48 instead of 1.24

opw-3336398

closes odoo/odoo#130375

X-original-commit: 34721726676dbee8b13dc19f449e5307140b6086
Related: odoo/enterprise#44934
Signed-off-by: Laurent Smet (las) <las@odoo.com>
Signed-off-by: Guillaume Vanleynseele (guva) <guva@odoo.com>
2023-08-02 06:18:16 +02:00
Samuel Degueldre c4b7d65e2e [FIX] web: stop leaking event listeners on EventBus in QUnit suite
In odoo/odoo#120893, the mail team changed their test utils so that they
would always start all services. This can cause issues because services
do not have any built-in destruction/cleanup mechanism, as in a
production application they are only supposed to be started once. Some
services add event listeners on global objects, in particular, the
tour service adds an event listener on the tour registry which is
global. If this event listener is not cleaned up, every time the tour
service is started, a reference to the environment in which this tour
service is being started is leaked. Since the environment contains all
started services, it is typically a pretty heavy object, especially
since in this context, all services are started instead of a select
subset.

This commit fixes that by patching the EventBus class to automatically
remove event listeners that were added on an event bus after the test,
in a similar fashion to what we do for some global objects like window
or the document's body.

closes odoo/odoo#130373

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-08-02 06:18:09 +02:00
Maximilien (malb) 182c8b0b84 [FIX] hr_expense: Fill payment_mode
When creating a new expense sheet the payment_mode is empty by default. When adding a new expense to it, the payment mode of the expense itself should be filled with 'own_account' but if the payment mode of the expense sheet is set, the payment_mode of the expense related will be the same as the expense sheet.

closes odoo/odoo#130372

Task: 3382023
X-original-commit: 662c98fb19aeef331f110d6dc4a3d68890af7df4
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
Signed-off-by: Maximilien La Barre (malb) <malb@odoo.com>
2023-08-02 06:18:06 +02:00
Gauthier Wala (gawa) c83b7e80a4 [FIX] account: frequent tax undeterministic result
- Create a db with account installed (and a random loca)
- Run the test "test_quick_edit_total_amount"
=> The test may fail (undeterministically), especially the first time

The reason is that we don't have an order in "_get_frequent_account_and_taxes"
So, if we have the same number of lines with the same account and with a tax or without one,
we can not guarantee which tax is considered the most frequent.

We now define the order by saying that we should take the taxes into account,
so lines with taxes take precedence on lines without

Linked to runbot error 23385

closes odoo/odoo#130326

X-original-commit: bdb21983371fb62b01275471e8ca7099219e1053
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
2023-08-02 05:11:10 +02:00
Guillaume (gdi) 952c9b4c73 [FIX] website: fix theme previews in right to left languages
Since Odoo 16.0, the configurator is translated in the user language.
Unfortunately, the theme previews are not yet translated in the user
language, so the user sees the theme previews in the default language
(English) but on a rtl page which causes alignment issues on the themes
previews. This commit fixes this issue by forcing the SVG containers
to be in ltr.

Steps to reproduce the issue fixed by this commit:
- Set the Arabic (Syria) language for an internal user
- With the internal user, create a new website
- Follow the configurator (in Arabic) until the theme selection step

=> Some text in the theme previews are not aligned correctly.

task-3398707

closes odoo/odoo#130325

X-original-commit: 1d0671a22582f423e55aad2907340700697c966e
Signed-off-by: Benjamin Vray (bvr) <bvr@odoo.com>
Signed-off-by: Guillaume Dieleman (gdi) <gdi@odoo.com>
2023-08-02 05:11:03 +02:00
Laurent Smet dfd38a6a5a [FIX] account: Take care of res.partner.bank owned by another company.
We need to take care of the `unique(sanitized_acc_number, partner_id)` constraint
and avoid to create a new bank account if already exists in another company.

closes odoo/odoo#130324

Task: 3432443
X-original-commit: bc4cbd0e129d7f9d417752e162397ece5e1bfc0f
Related: odoo/enterprise#44903
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
Signed-off-by: Laurent Smet (las) <las@odoo.com>
2023-08-02 05:10:55 +02:00
Laurent Smet ec44d4596e [FIX] account: Take care of archived res.partner.bank in _find_or_create_bank_account
We need to take care of the `unique(sanitized_acc_number, partner_id)` constraint.

Task: 3432443
X-original-commit: 687bc145c8889d05ee816b0cd8ed0378c301b4e7
Part-of: odoo/odoo#130324
2023-08-02 05:10:55 +02:00
mehjabinfarsana bb167d60e3 [FIX] l10n_sa_edi: make user error message translatable
before this commit, the user error message
on changing ZATKA submission mode
was not translatable
to user language

after this commit, user error message
will be shown in user's language

closes odoo/odoo#130323

X-original-commit: e00e253658cb0eefa8ea0f726f0a3bec6eaca7e6
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
2023-08-02 05:10:51 +02:00
Benoit Socias cd46857b15 [FIX] web_editor, website: use dataset mimetype when modifying images
Since [1] the mimetype used when calling `modify_image` was obtained
from the data URL contained in the `src` attribute instead of the
dataset. This is wrong for background images because they do not have an
`src` attribute.
Thanks to [2] which repaired the value contained in `dataset.mimetype`,
this value can be used as it was before [1].

[1]: https://github.com/odoo/odoo/commit/0449fe85cb0e1d639a4e1aeba26e90906f79254d
[2]: https://github.com/odoo/odoo/commit/40811e72c50faf146ccdf9f26c332db9ebc69fa9

task-3446438

closes odoo/odoo#130322

X-original-commit: e3221fe5d5efa824365210f040e93654e0a30309
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
2023-08-02 05:10:48 +02:00
Victor Feyens 14acd8599e [FIX] website_sale: make test more reliable
The test test_update_cart_zero_qty was checking the total amount
of the cart, but depending on installed localizations, the taxes
vary and the test can fail.

This commit changes the check to the untaxed amount to make sure
the test only depends on the sales price of the product defined in
the test setup.

closes odoo/odoo#130319

X-original-commit: a2c693795081953ed0ba07bfad210701fcf6f1f0
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-08-02 05:10:44 +02:00
Prakash Prajapati 6be8aeb376 [FIX] project: set correct company in project
steps:
   - install account module
   - Create company Odoo IN
   - Got to account > Configuration > analytic Plan
   - Open Project and set company as Odoo IN
   - install project module

issue-
   Analytical plan and project both have different company so traceback come up.
Fix:
   We have set company of analytic plan in project company.

task-3138082

closes odoo/odoo#130318

X-original-commit: d6171eb1c0e94cb1a22241dd250bc23247de3481
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-08-02 05:10:41 +02:00
Victor Piryns (pivi) ed77febae6 [FIX] sale_timesheet: don't include expenses when printing Timesheets
Issue:
Follow up on #128432, but this time it's removing expense lines from
the pdf report when we print the Sales Order that has both
timesheets, and posted expenses.

Steps to reproduce:
- Install Sales, Timesheets, Expense
- Create an SO and sell a service that creates a Task > Confirm
- Log some timesheet on the task (3h for ex.)
- Create an expense related to the SO, approve it and generate the
  journal entries.
- Print > Timesheets on the SO
- In the pdf, we have table row entries for the expense lines.

Cause:
The report is basing itself on `timesheet_ids` to print the report,
those might include expense lines.

Fix:
Add a domain on `timesheet_ids` to exclude lines that don't have a
`project_id` set, those are not timesheet, so can be expenses. We
want to exclude those.

Affected versions:
16.0 up to master

Reference:
opw-3342274

closes odoo/odoo#130315

X-original-commit: c55f01cff7e415c48f823201ace63074bf9a9146
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Signed-off-by: Piryns Victor (pivi) <pivi@odoo.com>
2023-08-02 05:10:37 +02:00
Loukas Wets (lowe) 442a79eeb0 [FIX] point_of_sale: order name handling in order setup
The setup function was not correctly handeling Order.name when given in
options. It was regenerating it instead of using the one given in option.
For self orders it was changing the prefix from Self-Order to Order.

closes odoo/odoo#130310

X-original-commit: 11a4beea5cbcd817cca02d81b772a5e8b3d097b6
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-08-02 05:10:29 +02:00
Ahmed Mohamed 2c9bb123ba [CLA] 0xSaltyHash Signature
closes odoo/odoo#130309

X-original-commit: f3db39880e4d72d821b48d6e2532bfe1fe6af8e8
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-08-02 05:10:21 +02:00
Adrien Widart (awt) ce24bd66c1 [FIX] sale_stock,stock_account,point_of_sale: post anglo saxon inv
There will be some access errors if an accountman tries to post an
invoice

To reproduce the issue:
1. Create a product category FIFO-AUTO
2. Receive a product of that category at $10
3. Sale, deliver and create the invoice for that product
4. Create a user with basic access to account app only
5. Switch into that user
6. Confirm the invoice

Error: An error access is raised, he can not post the invoice

In the invoice posting process, we try to read some other models
(pos order, SVL, and so on) but the user has not any access to them

OPW-3302458

closes odoo/odoo#130301

X-original-commit: fbd8c96d0ea097a23fc1e283721f8219fe7ebcd0
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: Adrien Widart (awt) <awt@odoo.com>
2023-08-02 05:10:14 +02:00
Didier (did) a1c079bbf1 [FIX] mail: fix nextMentionRpcFunction
Before this PR, the `nextMentionRpcFunction` was always undefined and therefor
never used. This could lead to some RPC being lost if the previous one was too
slow.
This PR fix the issue by directly using the `rpcFunction` that is already assigned.

closes odoo/odoo#130292

X-original-commit: fff3323cb82fb51dbbe8ac6790479530bbc51ba9
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-08-02 05:10:10 +02:00