Commit Graph
161755 Commits
Author SHA1 Message Date
Pratik Raval (PRRA) ea35602ff2 [FIX] survey: hide limit attempt field when survey_type is live_session
fix-up of https://github.com/odoo/odoo/commit/a0a78f807abd15cb64994aa626a48a0589e16570

Currently, When a user selects 'Live Survey' as the survey type, the
`is_attemps_limited` field is visible although it should be hidden.

This commit fixes this issue by hiding the field when the survey type
is set to 'Live survey'.

Along with that, this commit also removes the condition that hides the
`is_attemps_limited` field when there is/are conditional question(s) in the
survey.

TaskID-3326930

closes odoo/odoo#123596

X-original-commit: d5d0b97b9ada57f43b026da758a0f0044519f460
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-06-05 11:49:55 +02:00
Saurabh Choraria 5156b22072 [FIX] base_import: prevent traceback if image data contains non ASCII characters
When user tries to add non ascii characters in image field column in a file and
then when he tries to import it the error will occur.

Steps to reproduce:
1. Install contacts
2. export a contact and keep image field in fields to export.
3. Now in that file change the image data and add non ASCII characters
(for example: 'ô').
4. Now try to import this file in contacts.
5. The error will occur.

Applying this commit will fix this issue.

Currently, a ValueError is raised when we give non-ascii characters as input.
So I have reported an issue in python in which I have mentioned to edit the
documentation to note that it may raise ValueError for non-ascii content, or
to fix '_bytes_from_decode_data' function to raise binascii.Error instead of
ValueError.

To track the issue - https://github.com/python/cpython/issues/105193

sentry-4029823200

closes odoo/odoo#123572

X-original-commit: ceb67160e1747f0a886efb8ca0a60499e2b080d1
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2023-06-05 11:49:50 +02:00
dane@odoo.com a954eb3196 [FIX] mass_mailing: Fix when reply_model is Null
There exists edge case on `reply_model`. when value of
`mail_messages.model` in database is empty then `mail_messages.model`
returns False, hence `reply_model` becomes False which raises
an error because _get_id does not accept a falsy values.
(because query: `SELECT id FROM ir_model WHERE model=false` has to
be run and model is char). Because of the fact that this query never
runs and fails opportunity is lost.
task-3248489

closes odoo/odoo#123488

X-original-commit: 6c0d2d7a9d44459f3e09a38bd80ef9b018e8c946
Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
2023-06-05 11:49:47 +02:00
paso-odoo bafc5610b0 [FIX] product: fix negative rounding method for pricelist
If applied, this commit will solve the issue of the rounding method
AssertionError while configuring any negative value in pricelists.

Steps to produce:
- Open Sale > Products > Pricelists > Create/Open any Pricelist.
- Add a new line in Pricelist Rules.
- Set computation as 'Formula'.
- In the Rounding Method field configure any negative value i.e. -1.56.
- Error will be raised.

Fix this issue by preventing the user from entering the negative value in
Rounding Method.

Sentry-4208813474

closes odoo/odoo#123539

X-original-commit: f7b0eddf3124b15bb223379a513965fa2a017851
Signed-off-by: Parth Solanki (paso) <paso@odoo.com>
2023-06-05 07:04:50 +02:00
Rmi Rahir (rar) 8d551f9d32 [IMP] spreadsheet: update o_spreadsheet to latest version
### Contains the following commits:

https://github.com/odoo/o-spreadsheet/commit/059d66a1 [REL] 16.4.0-alpha.3
https://github.com/odoo/o-spreadsheet/commit/d39aaaf9 [IMP] highlight: support unbounded zone
https://github.com/odoo/o-spreadsheet/commit/98c8b592 [FIX] conditional_formatting: fix cf type checkboxes
https://github.com/odoo/o-spreadsheet/commit/b3848ec7 [FIX] XLSX: open exported .xlsx file containing images in Excel
https://github.com/odoo/o-spreadsheet/commit/a2a11450 [REF] tests: Use minimal setup for composer child components
https://github.com/odoo/o-spreadsheet/commit/dcb61744 [IMP] composer/CEH: Simplify composer flow
https://github.com/odoo/o-spreadsheet/commit/cf61a5f5 [IMP] selection: selecting row/col now add full unbounded range
https://github.com/odoo/o-spreadsheet/commit/98d40e17 [IMP] range: Fix getSelectionRangeString getter
https://github.com/odoo/o-spreadsheet/commit/88ab901f [IMP] tests: remove useless await nextTick() Task: 3344230
https://github.com/odoo/o-spreadsheet/commit/8f95190c [IMP] tests: test currency side panel in standalone Task: 3344230
https://github.com/odoo/o-spreadsheet/commit/61a2fb49 [IMP] tests: test CF side panel in standalone Task: 3344230
https://github.com/odoo/o-spreadsheet/commit/386f21cb [FIX] menu test: correctly await paste action
https://github.com/odoo/o-spreadsheet/commit/2c3fed33 [FIX] Chart Pannel: fixes updateChart process Task: 3323875

closes odoo/odoo#123462

Related: odoo/enterprise#41900
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2023-06-03 10:36:00 +02:00
FrancoisGe 90ac1f58f5 [FIX] web: aggregate monetary in list
The goal of this commit is to display the correct number of digits for
aggregates of monetary and float fields using the monetary widget in
list view. The number of digits must match that of the currency.

The master commit e96566e already solves
the problem for monetary fields, so we're going to add support for
float fields with the monetary widget.
So we're going to backport this commit.

closes odoo/odoo#123614

X-original-commit: 505155753d6e05fbb4580ce74d9f5844a1fa45a9
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Georis François (fge) <fge@odoo.com>
2023-06-02 23:39:35 +02:00
Guillaume (guva) e2500e26df [FIX] hr_expense: expense name on pdf upload
When uploading a PDF, the expense name is showing
the 1st category of expense instead of the name
of the PDF.

opw-3339756

closes odoo/odoo#123608

X-original-commit: 7ec2bb68067e49ea5ab2bbd6598264ccb78cfd70
Signed-off-by: William André (wan) <wan@odoo.com>
2023-06-02 23:39:32 +02:00
Vincent Larcin 5b7d766fc3 [FIX] hr_timesheet: fix traceback on deleting tasks
Steps to reproduce
------------------

1. Install hr_timesheet.
2. Try deleting a task.

You will get a traceback.

Explanation
-----------

In https://github.com/odoo/odoo/pull/110737, the calls to `_read_group` were adapted to the new API,
but a slight mistake was introduced when adapting the code in `_unlink_except_contains_entries`.
This commit fixes it.

closes odoo/odoo#123597

X-original-commit: 83046fb1fd00ffde7568c35c76697ecf7f4db8fa
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-06-02 23:39:29 +02:00
Hubert Van de Walle (huvw) 708f15c9b1 [FIX] web: don't use the compileButton fn for bootstrap toggles
Steps to reproduce
==================

- Use a mobile (xs) viewport
- Go to sign
- Click on "Action"

-> InvalidButtonParamsError

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

The bootstrap button should not be compiled as an action button

Solution
========

Don't call compileButton for button with the data-bs-toggle attribute
We also need to cancel the global click to let bootstrap handle the
action

opw-3278906

closes odoo/odoo#123579

X-original-commit: 5f569eedf9ed4e19b1fab1c83f7d315684097a7f
Related: odoo/enterprise#41906
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
2023-06-02 23:39:24 +02:00
Jinane Maksoud 7426b89398 [FIX] website: fix upadting menu names when many langs are active
Postgfresql functions can only take a max of 100 arguments by default,
when using 'jsonb_build_object' to update translations in jsonb menus
each lang adds 2 args as key value pairs. The languages should be added
in batches of 50.

closes odoo/odoo#123562

X-original-commit: 7dfbbcf91baf796174b171e46c182b8eeb2423a9
Signed-off-by: Wang Chong (cwg) <cwg@odoo.com>
2023-06-02 23:39:22 +02:00
Romain Estievenart 34dc70ae5a [FIX] board: use single column layout on small screen
Steps to reproduce:

- Create My dashboard on PC with two views set one next to the other
- Open My dashboard on mobile devices, and you see the desktop view
  => bug

On small screens, we don't have enough available space on the screen to
allow other layout then "1".

opw-3145706

closes odoo/odoo#123561

X-original-commit: 9e1f79156e9440b953e9d476a608f9ce117c0d5b
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-06-02 23:39:19 +02:00
clesgow 7f8af8a84b [FIX] mrp: allow override for operation cost in MO Overview
Since employees can be assigned directly to a workorder, their hourly
cost must be added to the operations cost in the Overview.

Those changes allow further override in odoo/enterprise#40953

closes odoo/odoo#123551

X-original-commit: 8802907637b5d862aaa98a1828d29bc7890c53e3
Related: odoo/enterprise#41893
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-06-02 23:39:17 +02:00
Hubert Van de Walle (huvw) 2d4634df5f [FIX] web: use field digits in grouped list view
Steps to reproduce
==================

- Enable debug mode
- Go to Settings / Technical / Database Structure / Decimal Accuracy
- Set the "Product Unit of Measure" to 3 digits
- Go to Inventory / Reporting / Locations
- Group by company

-> The "On Hand Quantity" is formatted with 2 digits

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

The field is declared as follows

```py
inventory_quantity_auto_apply = fields.Float(
    'Inventoried Quantity', digits='Product Unit of Measure',
    compute='_compute_inventory_quantity_auto_apply',
    inverse='_set_inventory_quantity', groups='stock.group_stock_manager'
)
```

Solution
========

We should fallback to the field digits if the digits are not set on the
arch, such as this

https://github.com/odoo/odoo/blob/1cd49304ef118e667bd14fd5fa78a0baba47bb4a/addons/web/static/src/views/utils.js#L152

opw-3328657

closes odoo/odoo#123543

X-original-commit: f4ecb7ff0c166c7e58ea99711868a30ea3a7fda7
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2023-06-02 23:39:11 +02:00
Abdelouahab (abla) b994c8c516 [FIX] analytic: avoid popup overflow
To Reproduce
============
- create many analytic plans and link them to an analytic account
- create an invoice and add couple of lines, stop when the page
becomes scrollable
- on the last line click on Analytic, the popup is positioned under
the line and we can't reach last plans

Problem
=======
- according to [getBestPosition](https://github.com/odoo/odoo/blob/16.0/addons/web/static/src/core/position_hook.js#L83), we try different options to position the popup and we take the first one to mach.
- in this use-case, the different positions tried by `getBestPosition` are overflowing because of the height of the popup.

Solution
========
limit the height of the popup to half size of page

opw-3252165

closes odoo/odoo#123542

X-original-commit: 3a7aaa36a487d101a70cb24c3c720a61f50a33ef
Signed-off-by: abla001 <abla@odoo.com>
2023-06-02 23:39:06 +02:00
Maruan Aguerdouh (magm) ba444ee90f [FIX] web: z-index of properties field popup don't go below subtask form
Steps to reproduce:

- Install Project app and activate Sub-tasks.
- Go to any project > a task > go to subtasks and add a new line.
- In the next popup, create a whole new subtask, and try to add a new
property field to this subtask.

Issue:

The z-index of the properties field popup is lower than the subtask form
popup, so it goes below it.

Solution:

Changint the current the z-index from the `o_property_field_popover` for
the $zindex-popover which will make it go above the subtask form popup.

opw-3174888

closes odoo/odoo#123541

X-original-commit: 15e22367a290903c26c8c18d85ecaa2a708d99b0
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-06-02 23:39:01 +02:00
Alvaro FuentesandChong Wang f7fca3faf9 [FIX] core: do not udpate translation terms from text to xml
Steps to reproduce the issue:
* In a clean v16 db install base_setup
* Log in into DB, switch language to French (install and activate it)
* Upgrade to saas-16.1

Issue: The main settings page under Companies settings (Sociétés in Frech) shows
```
<span class="o_form_label">Mise en page du document</span> <span class="fa fa-lg fa-building-o" title="Les valeurs définies ici sont spécifiques à l'entreprise." aria-label="Values set here are company-specific." groups="base.group_multi_company" role="img"/>
```
instead of just
```
Mise en page du document
```

The issue comes from this difference, 16.0:
https://github.com/odoo/odoo/blob/fb02720aed0b0be00df8f5d0e1932b948c300b92/addons/base_setup/views/res_config_settings_views.xml#L78-L79
vs saas-16.1:
https://github.com/odoo/odoo/blob/80bc702ecfe6f704af05f9830d272b162018f2ad/addons/base_setup/views/res_config_settings_views.xml#L79

Note that `Document Layout` is used in two different contexts. In 16.0
it comes within an xml/html block containing a `<span>` tag, and more
importantly it is the **text** part of the xml tag. In saas-16.1 the
same `Document Layout` is used as an **attribute** of the `setting` tag.
Thus we cannot blindly assign the whole term (block with tags) to the
attribute when upgrading to saas-16.1, it is only safe to update the
translation from xml to text. Updating a text entry with something that
seems to have other xml elements is unsafe and can lead to the issue
showcased here.

For more context, at the time of updating the terms here is the
situation:
* `closest_matches` is `['Document Layout']`
* `closest_term` is `Document Layout`
* `old_term` is
  ```
  <span class="o_form_label">Document Layout</span>
                                        <span class="fa fa-lg fa-building-o" title="Values set here are company-specific." aria-label="Values set here are company-specific." groups="base.group_multi_company" role="img"/>
  ```

closes odoo/odoo#123540

X-original-commit: 6cd49293fe4d0d86fbbfa2476e113deadeba7348
Signed-off-by: Wang Chong (cwg) <cwg@odoo.com>
Signed-off-by: Alvaro Fuentes Suarez (afu) <afu@odoo.com>
Co-authored-by: Chong Wang(cwg) <cwg@odoo.com>
2023-06-02 23:38:58 +02:00
Florent de Labarre 03b37ffc5c [FIX] im_livechat: countries no correctly show
Before this commit in the livechat comfiguration page the countries of rule doesn't appear correctly.

closes odoo/odoo#123511

X-original-commit: 4208da6133d583c47c2e77112dfc7c0c506ad837
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-06-02 23:38:47 +02:00
Victor Feyens 2f4d1ce58c [IMP] website_sale: populate
closes odoo/odoo#123465

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-06-02 22:29:36 +02:00
Bruno Boi bbb5e2bc47 [FIX] web: display signatures in signature fields
**Before this commit**
Since [1], the signature field only display placeholder
signatures when it has a value.

**Explanation**
The commit [1] removes the props "value" from the standard field props.
The signature field missed an adaptation.

**After this commit**
The issue is fixed and a test has been written.

[1] 688986f888
opw-3335655

closes odoo/odoo#123463

X-original-commit: 4edc5e3326cc92e9adf4f2512af1e85382108bb3
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
2023-06-02 22:29:28 +02:00
Aaron Bohy 6d9108b611 [REF] web: BasicModel: simplify evalContext logic for x2manys
Before this commit, 4 different usecases where considered when
computing the value of an x2many field to put in the evalContext:
 1) evalContext to evaluate a context used client-side
 2) evalContext to evaluate a context used server-side
 3) evalContext to evaluate a domain used client-side
 4) evalContext to evaluate a domain used server-side

For 1, 3 and 4, the value of the x2many was the list of ids in the
relation (in the case of one2manys, new, virtual, ids were filtered
out). For 2, the value was a list of commands. This doesn't make
much sense, and doesn't appear to be used. This has likely been
encoded when we developped the new views in v11, when we kind of
reverse engineered the specs.

As we are currently rewritting the BasicModel with a new version of
onchange, where the semantics of x2many commands change, this old
spec makes even less sense. Indeed, the new command semantics only
encode what has changed, whereas currently the commands encode the
whole value of an x2many, like if it was recreated from scratch.

We thus decided to simplify the evalContext logic by always
evaluating x2manys to the list of (existing) ids in the relation.

Part of task 3179751

closes odoo/odoo#123439

Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-06-02 22:29:20 +02:00
william-andre b991504dc0 [FIX] account: show settings with full accounting
When all accounting features are enabled manually (it should only be
enabled through the installation of the Accounting app), trying to
display the settings of Invoicing will raise an error.
This is because the `block` with `id` `accounting_reports` should be
displayed but has no content.

opw-3257708

closes odoo/odoo#123431

X-original-commit: 74fa5d5418e14e35dec68caa3c5de875c12bd4ce
Signed-off-by: John Laterre (jol) <jol@odoo.com>
2023-06-02 22:29:17 +02:00
Pulinckx Pierre (PIPU) 679796dbf5 [ADD] base: Add Client Actions technical view
Adding a new view with Client Actions in settings
available by the technical menu

taskId : 3339472

closes odoo/odoo#123419

Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-06-02 22:29:15 +02:00
niyasraphy 37a7a05c67 [FIX] base: improve logger message
before this commit, if the translation import is failed,
 in the log it shows "unsuccessfully imported"

after this commit, the logger message is improved and
 show file import failed

closes odoo/odoo#123364

X-original-commit: a7680426edfe7a8980a997c2947e05331254897b
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2023-06-02 22:29:11 +02:00
Om Rabara 4705df6797 [FIX] purchase: fix assertionerror when 'Order Deadline' is removed
AssertionError: convert amount from unknown date
The problem occurred when removing the default value of 'Order Deadline' and
selecting a product before saving the record.

After applying this commit will fix this issue.

sentry-4175826548

closes odoo/odoo#123224

X-original-commit: 0314edf028acf7365804028f0f3ef6123b6ae321
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-06-02 22:29:09 +02:00
tsm-odoo 20c1772d35 [REF] im_livechat, *: refactor livechat
This PR refactors the public livechat in order for it to use
owl and to rely on the discuss components as much as possible.

task-2212347

closes odoo/odoo#122834

Related: odoo/enterprise#41636
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-02 22:29:06 +02:00
tsm-odoo 347c3ade69 [IMP] web_tour: make tour service work with shadow DOM
This commit updates the tour service so that triggers/actions can
be run in a shadow DOM.

In order to configure the tour to use the shadow DOM, the following
configurations options are added:
- `shadow_dom` on the tour configuration. This key must be
a valid selector matching the target shadow host element. All triggers/
actions of the tour will then be performed in its `ShadowRoot`.

- `shadow_dom` on any step of the tour. This value could either be
a valid selector matching the target shadow host element or false.
The behavior is the following:
  - undefined: the step inherit the `shadowDOM` configuration from its
  tour.
  - string: the step triggers/actions will be performed in the
  `ShadowRoot`related to the host matching the given selector.
  - false: the step triggers/actions will be performed in the light
  DOM.

part of task-2212347

Part-of: odoo/odoo#122834
2023-06-02 22:29:06 +02:00
Tommy (tong) 685cb96ec2 [IMP] base: add support to company_dependent for html fields
Issue:

 Html fields cannot add company_dependent

Cause:

 Neven have html type for company property

Solution:

 Add html type inside ir.property

closes odoo/odoo#121243

Signed-off-by: Rémy Voet <ryv@odoo.com>
2023-06-02 22:28:52 +02:00
Demesmaeker 64937078cd [FIX] sale_loyalty: wrong discount amount computation with negative amount product
Currently, when using a promotion with a reward available only on specific products and having a
maximum amount allowed, when adding another product with a negative amount, the discount could go
above the maximum discount allowed.

This was caused by the calculated discount amount that was overridden by the total amount of the
order. This new amount was then used to calculate the discounted factor. So, instead of having:
discount_amount = product_price * min(1, (max_discount / discountable))
When the total_amount of the order was under this discountable, we had:
discount_amount = product_price * min(1, (max_discount / total_amount))

Instead, we should calculate the discount amount normally but limit it to the amount_total.

opw-3217369

closes odoo/odoo#123361

X-original-commit: 977f726b67f48d4b858b1a5fe1d558a64186d332
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Signed-off-by: Morgane Demesmaeker <edm@odoo.com>
2023-06-02 17:00:18 +02:00
Guillaume (gdi) 6b10a5430d [FIX] website: prevent remove model required fields
When you create a new website, the contactus page have default action
("Send an Email"). For each action, there are mandatory fields that
cannot be deleted by the user. Unfortunately, the template for the
`/contactus` form didn't have the right fields marked as mandatory.
This led to the following bug:
- Go to `/contactus`
- Edit the page

=> The Email and Subject fields can be deleted. However, when you drop a
form and set the action to "Send an Email", these fields are mandatory
and cannot be deleted. This commit fixes this bug by ensuring that these
fields are marked as mandatory on `/contactus`.

task-3302433

closes odoo/odoo#123360

X-original-commit: 09a9cff6af44157c760c4f3d95d478f10d5c2411
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Dieleman Guillaume (gdi) <gdi@odoo.com>
2023-06-02 17:00:15 +02:00
stefanorigano (SRI) 181a618da2 [FIX] mail: o-mail-Message and ChatWindow, adjust overall spacing
task-3338419

closes odoo/odoo#123356

Part-of: task-3326263
X-original-commit: b5c035a454780a1e5e997c683cec536efa780ec6
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-02 17:00:12 +02:00
Ivan Yelizariev 101acf3773 [FIX] core: fix infinite loops with child_of/parent_of
1.

Infinite loop may happen on using `parent_of`\`child_of` when there is a
recursion in the tree (e.g. a record is marked as a parent of itself). Fix it by
excluding seen records from the next iteration.

2.

Another problem with `child_of` is `parent_id` that references to another model.
For example, the `parent_id` may come from inherited model. It's the case with
`res.users` and `res.partner` models. It may lead to a random search results.
Avoid that by raising exception in case of wrong usage of the `child_of`
operator.

STEPS:

In demo data, there is a partner called "Wood Corner" that is `res.partner(9,)`
that has 3 sub-contacts. If we give Portal access to two of them, we end up with
a database, where we have a `res.users(9,)` record that has a partner, which has a
`parent_id` to "Wood corner". So this way, the user id is the same as the user's
partner's parent contact id.

After that open a shell and type:

```
env['res.partner'].search([["user_ids", "child_of", 9]])
```

BEFORE: infinite loop (without change n.1) or random search results (when change
n.1 is applied)
AFTER: ValueError exception

---

opw-2729740

closes odoo/odoo#123353

X-original-commit: 2e1adc0c3e33fcf7989d27bb4d1c2e3c019faf2b
Signed-off-by: Ivan Elizaryev (iel) <iel@odoo.com>
Signed-off-by: Raphael Collet <rco@odoo.com>
2023-06-02 17:00:10 +02:00
Sébastien Theys afbf556a6a [REF] mail: move discuss core files to core folder
This prevents from having files floating in the root folder and making
the navigation between subfolders more complex.

Part of task-3265211

closes odoo/odoo#123344

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-02 14:30:14 +02:00
ferdymercury 4b8a3fe484 [IMP] sale: allow grouping report by customer zipcode
closes odoo/odoo#123146

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-06-02 14:30:11 +02:00
ferdymercury 68983675cf [CLA] add signature for ferdymercury
Part-of: odoo/odoo#123146
2023-06-02 14:30:10 +02:00
Prakash Prajapati deb93f3373 [IMP] hr: make translate department name
task-3339414

closes odoo/odoo#122479

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-06-02 14:30:07 +02:00
Jurgen (jugj) bf9a745735 [IMP] hr_recruitment(_extract): Add a new CV for each applicant and disable auto OCR
task-3254698

closes odoo/odoo#122307

Related: odoo/enterprise#41422
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-06-02 14:30:00 +02:00
Stanislas Gueniffey c46ee8f4c0 [IMP] web_editor: create links with (Shift+) Enter
Typing a valid URL and pressing Space creates a clickable link with that
URL. Users expect the same to happen when pressing Enter instead (with
or without holding Shift), but that was not the case previously.

This commit enables link creation with both Enter and Shift+Enter. It
factorises the code that creates the link into a function
`_handleAutomaticLinkInsertion`.

While this feature is part of the `keydown` event for Space and
Shift+Enter, it is part of the later `input` event for Enter (without
Shift). This is due to a required call to historyRollback(), which would
undo the just-created link, forcing its creation to be delayed.

Two tests have been added for these new use cases. For the Space use
case, an existing test has been adapted to account for the change of
handling (from `input` to `keydown` event). That test is also simplified
to avoid modifying the DOM content (which was meant to replicate the
exact behavior of the browser for regular users, deemed not necessary
for tests).

Task-3094666

closes odoo/odoo#122001

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-06-02 14:29:57 +02:00
damr 6082d4b3fd [IMP] sale_project: compute the amount invoiced from the down payments for the project profitability
This commit's purpose is to take into account the down payments for the
project profitability of the project update window.
Currently, if an SO has a total of 300$, and a down payment is created for 100$, the project
profitability will not compute the 100$ into the 'amount_invoiced'
column. After this commit, it will. A negative value of -100 is also
added in the 'amount_to_invoice' column in order to keep the total of
that column, and the total of the 'expected' column of the project
update consistent with the total of the SO.

task-3204827

closes odoo/odoo#116293

Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-06-02 14:29:52 +02:00
Xavier Luyckx (xlu) ba87691460 [IMP] website_event, * : empty states
*: website_event_booth, website_event_exhibitor, website_event_track

Before this commit, when no events (or exhibitors, tracks,..) were
displayed for the user, only a title (eg. "No events found.") was shown
to them.

Now, it will display an illustration (color adapts to theme's color)
alongside more information:
- title
- call-out
- call-to-action for editors (add event, tracks, exhibitors..)

task-2489681

closes odoo/odoo#107638

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-06-02 14:29:49 +02:00
MerlinGuillaume de2bdc87a7 [FIX] web: mark integer fields as invalid if the value exceeds 32 bits
When we enter an integer in a field and the value cannot be encoded in
32 bits, an error is thrown but the field is not marked as invalid

Steps to reproduce:
1. Install Employee Referral
2. Go to Referrals > Configuration > Levels and create a new level
3. Add a name and an image and set the requirements to 9,999,999,999
   points
4. Try to save the level, an error is thrown (in v15, a notification
   would inform the user the field is invalid)

Solution:
Throw an error in parseInteger when the value exceeds the 32 bits
encoding limit

Problem:
PostgreSQL uses 32 bits for integers

opw-3300851

closes odoo/odoo#123401

X-original-commit: c662a54606799cf3348aed84584e75d2ab6f20e5
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-06-02 12:04:21 +02:00
Aaron Bohy 48082dcfa7 [FIX] mass_mailing: HtmlField: do not crash if destroyed
Go to Email Marketing, open a record with status "draft". Directly
when the record opens, and before the html field is loaded, click
on another menu or on the breadcrumb to leave the view. Before this
commit, it crashed because the HtmlField tried to perform an RPC
after being destroyed.

opw~3297859

closes odoo/odoo#123381

X-original-commit: 3e8d2c7006b16738cdab7442a7135ae7f1c60da9
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-06-02 12:04:18 +02:00
Joray 854153a68c [CLA] signature for Joray
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

closes odoo/odoo#123372

X-original-commit: 031cd0e37a156dc776c858fa9e868fd4dda74416
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-06-02 12:04:15 +02:00
Hubert Van de Walle (huvw) ea8e42cdba [FIX] web: parseMonetary of decimal value without leading 0
Steps to reproduce
==================

- Open a product form view
- Enter .5 in the Cost field

It is parsed as 5 but it should be 0.5

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

When trying to strip the currency symbol from the input, the leading
decimal separator was also removed

Solution
========

The decimalPoint can have multiple characters.
This means that we can't simply add the decimal separator inside the negated
character class.

Instead, what we can do is skip everything until we find a interesting
substring. (more details in the comment)

We then remove everything that is not a digit at the end.

Finally, we can pass that to `parseFloat`

closes odoo/odoo#123358

X-original-commit: fa466d75da3b30ac1e512a95436075ef1461a95c
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2023-06-02 12:04:13 +02:00
hupo-odoo 78b674d8d4 [IMP] web: invoice layout preview
When invoicing the first time to a customer, the user can choose a style layout for the invoice.
The 'Striped' laoyout is a little bit different when we configure it and preview the pdf than when using it in an actual invoice.
This commit make the layout preview more accurate in relation to the real invoices.

Comment that led to the task : https://www.odoo.com/web#id=3232301&menu_id=4720&cids=1&action=333&active_id=809&model=project.task&view_type=form

closes odoo/odoo#123354

Task: 3236310
X-original-commit: 1852143a9cc56ec1ac9b8cfec5835fdc010fe7ab
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: hupo-odoo <hupo@odoo.com>
2023-06-02 10:45:11 +02:00
Saurabh Mishra 0184788ebd [FIX] website: redirect only when url_to given
While creating redirects/rewrite if the user does not enter any url in the
'Url to' field of the website module under 'Configuartion/Redirects' then during
redirection, the error  'NotFound: 404 Not Found: The requested URL was not
found on  the server' will be produced.

Applying this commit will solve the issue.

sentry-4206504892

closes odoo/odoo#123391

X-original-commit: 14a850976711431f36b7f889ea9cf31b1114513d
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Saurabh Mishra (sami) <sami@odoo.com>
2023-06-02 07:56:59 +02:00
Thomas Lefebvre (thle) 395d74aa11 [FIX] google_calendar: prevent blocking synchronisation
Issue:
------
Since commit 3f145af00307383e2d0a0891d05b8db59b13662a

Some events that belong to a recurrence and
have been modified are not detected as existing.
The `full_recurring_event_id` method blocks these events.

Solution:
---------
Test regex expressions before using them.

opw-3344408

closes odoo/odoo#123333

X-original-commit: f34fa6e905b9426be8040d4e021f1849b3373184
Signed-off-by: Arnaud Joset (arj) <arj@odoo.com>
Signed-off-by: Lefebvre Thomas (thle) <thle@odoo.com>
2023-06-02 07:56:56 +02:00
Mahamadasif Ansari 6e1f24100d [FIX] account_edi_ubl_cii: prevent ZeroDivisionError log error
A float division by zero error is generated on the log, and nothing
is imported from the file when the user uploads an XML file like
https://drive.google.com/file/d/1_eZYfqMk2kLtPsEjv-13DRHnmoXkWYeE.
This is because here in LineID 1, there is a value billed quantity is 0.0,
a charge amount is 0.0, and a total amount is 100.0. This is wrong;
the total amount is always 0.0 when the billed quantity is 0.0
(billed quantity * charge amount).

This commit solves the above issue by dividing a price subtotal
by one when the billed quantity is zero.

sentry-4157357719

closes odoo/odoo#122142

X-original-commit: 3a6e84d6733145f38184c473de4a1aa41464b1fa
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Signed-off-by: Ansari Mahamadasif (maan) <maan@odoo.com>
2023-06-02 06:51:38 +02:00
Pierre Masereel 934fb4ccea [FIX] mail: encode url for pdf viewer
When the route to your file contains more than one argument, the
arguments following the first one are not taken into account. The
arguments that are after '&' symbol are considered as a arguments of the
route 'viewer.html' and not of the 'file' route.

To avoid this issue, we are encod the file route in URI, as documented
in https://github.com/mozilla/pdf.js/wiki/Viewer-options

closes odoo/odoo#123355

X-original-commit: 86a4fcf4647c9c6006b69c35d76bf80d87204114
Related: odoo/enterprise#41815
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Masereel Pierre <pim@odoo.com>
2023-06-02 00:35:51 +02:00
Julien Alardot (jual) 4bf3eb999e [FIX] l10n_es_edi_facturae: fix error when generating document
Due to an unexpected positional parameter given in the
function call, no document could be generated

closes odoo/odoo#123376

X-original-commit: 2c5a2ca48d855ddbe89da770d97c52416818040d
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Julien Alardot (jual) <jual@odoo.com>
2023-06-01 23:22:46 +02:00
Lucas Lefèvre 7415f9bbbd [FIX] spreadsheet: force light theme
Currenlyt, when using dark theme, spreadsheet is a mess. It's mostly
light theme, with some dark theme elements (mostly coming from odoo
components). There's even inputs where the text is white on a white
background.

o-spreadsheet code isn't prepared to handle dark theme. At all.
There are hardcoded colors everywhere.

Until we have a proper way to handle dark theme (use overridable scss
variables, rely on bootstrap), we force light theme for all elements
inside o-spreadsheet, including odoo components.

The css rules aren't pretty, but at least the spreadsheet is usable.

opw-3329765

closes odoo/odoo#123359

X-original-commit: 37a5f6a5b4b8ecbacf7a8ce4be822c6f348eb5da
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2023-06-01 22:12:18 +02:00