Commit Graph
168609 Commits
Author SHA1 Message Date
Mahdi Cheikh Rouhou (macr) e05dbe37e5 [FIX] web: show the name fully in signature sign item
Issue:
======
The auto signature has hidden overflow part in y axis when having long
characters in bottom like (y, j, g)

Steps to reproduce the issue:
=============================
- Use any sign template that have at least one name_and_signature sign
  item.
- Enter a name that have at least one of the characters (y,j,g)
- Click on auto
- The signature doesn't show fully

Solution:
=========
Update the hardcoded values for the y-axis for the name and the line of
signature and the font size to make sure it fits perfectly inside the
canvas.

opw-3639171

closes odoo/odoo#148299

X-original-commit: c9653d5649a35640cc461c9baa0b73e8c6c1cace
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2024-01-05 15:14:36 +00:00
Rodolpho Lima 1dc42bc66f [FIX] web_editor: link preview on label change
Before this commit, the link preview in the Link Dialog would not be
updated after changes on the label input field, depending on other
actions to be updated (e.g. picking a different type of link/button or
changing the URL input field).

This commit makes sure the link preview reacts to changes on the label
input field.

task-3580621

closes odoo/odoo#148202

X-original-commit: c7954225e8680821a46c9628e5e05df2ae575da7
Signed-off-by: Nicolas Bayet (nby) <nby@odoo.com>
Signed-off-by: Rodolpho Cammarosano de Lima (rcdl) <rcdl@odoo.com>
2024-01-05 15:14:35 +00:00
Guillaume-gdi 3859bbe99b [FIX] web_editor, *: prevent blocked UI when original image not found
*: website

When the user uploads an image and remove the original image, some
image options continue to work thanks to a backend fallback on another
image. Unfortunately, this fallback is not available for images coming
from unsplash. This commit fixes this issue by preventing the UI to be
blocked when the original image is not found.

Steps to reproduce the bug:
- Activate the developer mode
- Configure Unsplash in the settings
- Add a Cover block on a page
- Replace the background image with an unsplash image
- Save
- Edit the page and via the media dialog, remove the original image

=> The options on the image cannot start anymore.

opw-3636499
opw-3474103

closes odoo/odoo#148197

X-original-commit: 3b0ac160a800f70ae965b60110e83e41655bca5f
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Guillaume Dieleman (gdi) <gdi@odoo.com>
2024-01-05 15:14:34 +00:00
Aaron Bohy c821460f93 [FIX] web: pager hook: allow to combine useSubView to patch config
Before this commit, the pager hook use useChildSubEnv to patch the
config with the pagerProps. We used useChlidSubEnv because this
information only targets one of its children (the ControlPanel),
not the components using the hook themselves (e.g. the controllers).

However, this has an infortunate side-effect. If a component using
the pager hook also wants to patch the env (e.g. with useSubEnv),
and does it after calling usePager, it will erase the sub env
created by the pager hook for the children by its own.

This happens with the TimesheetTimerListView:
```js
    setup() {
        super.setup(); // super will call usePager
        useSubEnv({
            config: {
		// this config doesn't contain the pagerProps
		// generated by usePager, as it's the config of
		// the component itself
                ...this.env.config,
                disableSearchBarAutofocus: true,
            },
        });
    }
```

Since using useChildSubEnv in this case isn't necessary, we simply
replace it by useSubEnv.

Note that we don't add a framework test for this issue, as it
would be totally artificial. Instead, the enterprise PR adds a
test for the TimesheetTimerListView.

opw 3636182

closes odoo/odoo#147393

X-original-commit: 8dbf8021842b94b9b067e2582f3aa92d31ef62e5
Related: odoo/enterprise#53342
Signed-off-by: Francois Georis (fge) <fge@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2024-01-05 15:14:32 +00:00
Simon Genin (ges) b5e8b8b0f7 [FIX] website: set properly the xml type to code editor
closes odoo/odoo#148290

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2024-01-05 11:53:48 +00:00
David 23f737a822 [FIX] sale_margin: update purchase_price on copy
When we copy a sales order we were taking margins from the past which
have a high probability of not being valid anymore.

Now, once we copy a sales order, no past value is copied and the
purchase price is computed as new so we get the current margin values.

TT46721

closes odoo/odoo#148244

X-original-commit: 6da8aec93f1e66feaea16b12e245a229001cec21
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2024-01-05 10:34:46 +00:00
Victor Feyens 6d99cf3eb6 [FIX] sale: access error on first pending payment
Steps to reproduce:

1) Install and enable the "Onsite" payment provider;
2) As a public user, add product(s) to your cart;
3) Try to pay with the "Onsite" provider.

-> Internal Server Error

Cause of the issue:

In the log, the cause of the issue is an AccessError,
specifying that we tried to read the field `transaction_ids`
on a `sale.order` without having the necessary access rights.

This shouldn't happen, since the payment & ecommerce flows
are executed in sudo mode, after making sure that the cart
belongs to the customer.

After investigation, pending payment transactions trigger
1) the sending of a mail to the customer
2) the first mail generation will request the report assets
3) the generation of the report assets will create an
   attachment and commit the transaction
4) committing the transaction will trigger a global
   flush of the environment, forcing the computation
   of pending mail wizard fields, with a different
   environment than the sudoed one initiating the sending
   of the mail.

This will lead to security errors as we try to access
`sale.order` fields content without having the rights
for it.

Standard fields being already in the cache, it will
be noticed when trying to read the `transaction_ids`
field.

Solution:

Manually prefetch the `transaction_ids` content with
the sudoed environment, since the records cache is
shared between the environments (until a more global
fix is found and deployed).

Introduced by #121376

opw-3628753

closes odoo/odoo#148199

X-original-commit: 511fe642b9860bd9d2f6b7ed728e7d3e6af48748
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2024-01-05 10:34:45 +00:00
Ethan Hildick 5022f68a42 [IMP] product: use eval-able True
When using safe_eval on this dict, "true" raises a NameError while "True"
is interpreted properly.
At the same time, this is more consistent with the rest of the code.

closes odoo/odoo#148203

X-original-commit: 0e91bf8b3956c1403e638421a91af3275b9e6489
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2024-01-05 09:12:55 +00:00
Martin Maes 2cbfd87d49 [FIX] purchase_stock: avoid replenish onchange loop
When replenishing a product with a route buy selected on the product form but no vendor
added, we fall into an endless loop because the default_get sets the route,
which triggers the onchange that return a warning.
This will again call the default_get and the loop never ends.

The onchange is useless as it's only goal is to display the warning, and as the field is
required on the form, the user will not be able to submit it.

opw-3653714

closes odoo/odoo#148201

X-original-commit: e7fca1c849652920388526f4797397aa18247204
Signed-off-by: Tiffany Chang (tic) <tic@odoo.com>
2024-01-05 09:12:54 +00:00
maad-odoo 7460aa2c9d [FIX] web_editor: incorrect delete behaviour of star rating elements
Before this commit:
When inserting a star rating element, pressing 'Enter' would move the cursor
to the next line, and hitting 'Backspace' would delete the star rating element.

After this commit:
After inserting a star rating element and moving to the next line with 'Enter,'
pressing 'Backspace' now causes the cursor to move to the previous <p> tag
where star element is located. If 'Backspace' is pressed again, the star
element is deleted.

task-3555394

closes odoo/odoo#148198

X-original-commit: 64a1b38450e15162f89d370fbe30abda9e5f7fe7
Signed-off-by: Geelen Sébastien (sge) <sge@odoo.com>
Signed-off-by: Antoine Guenet (age) <age@odoo.com>
2024-01-05 09:12:51 +00:00
std-odoo df218ad58a [FIX] mail_plugin: do not allow to create a partner from notification email
Purpose
=======
When an email is opened and is from the default notification mechanism,
i.e: coming from something like "notifications@mail.odoo.com", we don't
want to try to match the email address to an existing contact partner.

Instead, we now display a custom message on the mail addon side
mentioning to search the contact manually.

Task-3557545

closes odoo/odoo#148073

X-original-commit: 9ff0815e258160f0eca595e0c3cce4b005e79eea
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2024-01-05 09:12:50 +00:00
asm b6ffd728fe [FIX] l10n_be: Fix the cash difference expense account used.
This fix is to solve a bug that appears in the demo data od the l10n_be specifically in the cash journal using an income tyoe account for the negative cash difference which should be en expense type.
opw-3642586

closes odoo/odoo#146936

Signed-off-by: de Wouters de Bouchout Jean-Benoît (jbw) <jbw@odoo.com>
2024-01-05 09:12:49 +00:00
German Loredo [Vauxoo] 4f8779b684 [CLA] Update Vauxoo's CLA adding xmglord
Incorporate German Loredo (xmglord) as Vauxoo's contributor.

I confirm I have signed the CLA and read the PR guidelines at http://www.odoo.com/submit-pr

closes odoo/odoo#148245

X-original-commit: c3f1be0d418b06d9dff97e44538a53f52d8ae496
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2024-01-05 08:00:44 +00:00
Martin Quinteros e191ae2399 [CLA] add new members to Adhoc CLA
closes odoo/odoo#148237

X-original-commit: 9c090fafa1939136d23e7154d768db5a9f20eeef
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2024-01-05 08:00:43 +00:00
Sunarc Technologies 267e495d5c [CLA] Sunarc Technologies
closes odoo/odoo#148230

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2024-01-05 08:00:42 +00:00
FrancoisGe e0109a99f8 [FIX] web: header button with display="always" and invisible
Since the commit odoo/odoo@0d99f4b9d9, the header buttons with display="always"
can't be invisible. The invisible attribute is ignored for this type of
button in list view and kanban view.

This commit fixes this issue by adding t-if that will evaluate the invisible attribute.

closes odoo/odoo#148092

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2024-01-05 08:00:41 +00:00
Julien Carion (juca) c5b19f1765 [FIX] mail: replace overlapping shortcut in activity dialog
This commit simply replaces the shortcut for the action_done_schedule_next
buttons from alt+q to alt+z in the activity view dialog because the
alt+q shortcut is already used for the Save/Schedule buttons. This was
already done in https://github.com/odoo/odoo/pull/145738 but the wizard
which appeared in 17.0 hadn't been corrected.

opw-3565747

closes odoo/odoo#148160

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2024-01-05 06:47:14 +00:00
Anthony Chan 66a94b27ed [IMP] l10n_cn: Add COA for large business
Adds a new COA for large businesses in China to better support their needs out of the box. Also implements new taxes for the same large businesses.

3202831

closes odoo/odoo#145879

Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
2024-01-05 04:29:57 +00:00
Andrea Grazioso (agr-odoo) 735f75073b [FIX] account: branch user cannot add products
Create a branch under the main company
Select an internal user and keep only this branch on the fields
"Allowed companies" and "Default Company"
Access with the user
Create an invoice
Add a product

Issue: user will be blocked by error
"""
Access Error

Due to security restrictions, you are not allowed to access 'Companies' (res.company) records.

Records: YourCompany (id=1)
User: Marc Demo (id=6)

This restriction is due to the following rules:
- company rule employee

Note: this might be a multi-company issue.

Contact your administrator to request access if necessary.
"""

This occurs because the accounting info is taken from the parent company,
but the branch user has no access to the parent company records

opw-3627439

closes odoo/odoo#148028

X-original-commit: fab2dc3ded2b638c8160bbc84ec14669c4e8546c
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Andrea Grazioso (agr) <agr@odoo.com>
2024-01-04 23:55:58 +00:00
qsm-odoo c96760a76b [FIX] *: avoid translating CSS classes values
*: project, survey, test_website, website_event, website_sale

This commit fixes all found occurrences of such a case:
```
<t t-set="classes">some_classes</t>
```
=> CSS classes being marked for translation by mistake.

A breaking case was found via task-3636009, where the arabic language
has a translated class on some element which makes some JS crash
because of it.
Steps to reproduce (only for 17.0):
- Create a website with the "Arabic" language as the default language
- Go to the shop page in Arabic
- If you are in grid view, click on the "switch to list view" button and
  if you are in list view, click on the "switch to grid view" button
=> Crash

Note that commit [1] already did something similar a while ago (but
more generically than this commit). In this commit here, broken
occurrences were found using this regex:
```
<t\s+t-set=["']\w+lass(es)?["']\s*>
```

[1]: https://github.com/odoo/odoo/commit/98678199a32b3ba9af999f76980a6110546ec0fc

task-3636009

closes odoo/odoo#147688

X-original-commit: 01b223e3043a3d847fd7dbf8997edcee62c3254a
Related: odoo/enterprise#53463
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2024-01-04 22:03:50 +00:00
Ibrahima Gueye 0f0d2baa18 [CLA] update signature for optesis
closes odoo/odoo#147473

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2024-01-04 22:03:49 +00:00
Laurent Smet 5ab9f68693 [IMP] point_of_sale: Allow to create tax base lines for some pos order lines
This is needed for a specific global invoice flow in l10n_mx_edi.

closes odoo/odoo#146313

Task: 3638126
Related: odoo/enterprise#52787
Signed-off-by: Josse Colpaert <jco@odoo.com>
2024-01-04 19:58:13 +00:00
Paulo Gomes 900cc6ca30 [CLA] add cla for user paulogomes
closes odoo/odoo#145451

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2024-01-04 19:58:12 +00:00
Damien Bouvy 897296208f [FIX] base_automation: avoid key error when trying to return a warning
Before the refactoring introduced at 0a744ac, it was possible to return
a warning from a `code`-type base automation with the `action` variable:
```py
if len(record.name) > 20:
    action = {
        "warning": {
            "title": "Name too long",
	    "message": "The name of the record is too long",
	}
    }
```

This would trigger a visual dialog with the title and message in the
client.

Due to a louche `+=` operator change in the refacto, this kind of
automation raises a key error on the server, as the additive part of
the operator will try to access the 'warning' key in the result dict,
which may not (and usually will not) exist.

I assume this was done in an attempt to 'accumulate' warnings, but the
warnings in questions are dict that are not really additive anyway.
Better to support the *last* returned warning rather than none at all.

This commit basically returns to the previous situation for onchange
warnings.

closes odoo/odoo#148140

Signed-off-by: Bouvy Damien (dbo) <dbo@odoo.com>
2024-01-04 18:17:34 +00:00
Victor Piryns (pivi) 01e09bb2c2 [PERF] pos_sale: memoize _compute_currency_rate of pos.order
Description:
Saving a new `res.config.settings` (for ex: checking "Use QR code on
ticket") can be extremely slow on database with a large number
of `pos.order`.

Analysis:
Saving a new `res.config.settings` creates a new instance of the config.
This will invoke a check on the python constraints calling
eventually `_check_currencies` of `pos.config`, which will invoke the
compute of `currency_id` setting the field as dirty.
The `_compute_currency_rate` of `pos.order` depends on the `currency_id`
of the current `pos.config` (via a related).
This means the compute will be called with *all* `pos.order` ever made.
As the compute itself makes a few calls to `_get_conversion_rate`, which
makes a query, it can become slow when the method is called frequently.

Solution:
Memoize the call to `_get_conversion_rate`, as similarly done
in `account.move.line` from d8d47f9ff8
to reduce the number queries necessary.

Benchmark:
The `create` request to `res.config.settings` on a database with over
240k `pos.order` took

|             | Before    | After    |
|-------------|-----------|----------|
| Timing      | 36.9 secs | 4.3 secs |
| Query count | 47k       | 627      |

Reference:
opw-3632273

closes odoo/odoo#148136

X-original-commit: 1c6f7f23b2c0dbd009d8d56689c7a98792990f7f
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Piryns Victor (pivi) <pivi@odoo.com>
2024-01-04 18:17:33 +00:00
Rémi Rahir (rar) a6d24df028 [FIX] spreadsheet: update o_spreadsheet to latest version
### Contains the following commits:

https://github.com/odoo/o-spreadsheet/commit/310ca5796 [REL] 17.0.6
https://github.com/odoo/o-spreadsheet/commit/06b4a7e33 [FIX] evaluation: `evaluateFormula` no longer throws Task: 3576149
https://github.com/odoo/o-spreadsheet/commit/4f8cd15f4 [FIX] evaluation: track dependencies with R-tree Task: 3646902
https://github.com/odoo/o-spreadsheet/commit/d06a1a475 [FIX] Autofill: Automatic fill based on spreaded formula cells Task: 3626607
https://github.com/odoo/o-spreadsheet/commit/c404e22cc [IMP] index: export isMatrix
https://github.com/odoo/o-spreadsheet/commit/503d6bff5 [FIX] chart: time axis broken for days scale Task: 3619195
https://github.com/odoo/o-spreadsheet/commit/e5a902238 [IMP] scorecard: handling CF font style on chart
https://github.com/odoo/o-spreadsheet/commit/8ba492c75 [FIX] Components: rename private method arguments
https://github.com/odoo/o-spreadsheet/commit/078b86662 [FIX] *: Support metaKey modifier in event handlers Task: 3606161
https://github.com/odoo/o-spreadsheet/commit/63af9b38e [IMP] demo: don't double crash on launch error
https://github.com/odoo/o-spreadsheet/commit/cee016397 [FIX] export: faster border and style export
https://github.com/odoo/o-spreadsheet/commit/53e20ac4a [IMP] tests: pre-compile owl templates

closes odoo/odoo#148115

Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2024-01-04 18:17:32 +00:00
william-andre c98e5490dd [IMP] account: add test for matching loops
Although it is not a common case, it could happen that some loops are
created in reconciliation.
This test is added to make sure all implementations still work in that
case. It was added after an optimization on the code was attempted to
use `UNION ALL` instead of `UNION` in `_update_matching_number`

closes odoo/odoo#148093

Signed-off-by: Laurent Smet (las) <las@odoo.com>
2024-01-04 18:17:31 +00:00
Roy Le c589c894bb [FIX] hr: cannot select Working Hour if it doesn't have a company to set
up default Working Hour for a company

Setps:
1. `Standard 38 hours/week` data doesn't have a company
2. Employees menu > Configuration > Settings
3. cannot select `Standard 38 hours/week` to set

closes odoo/odoo#147995

X-original-commit: 352843ff8a8d204007f021153765d093aeb11fb5
Signed-off-by: Bertrand Dossogne (bedo) <bedo@odoo.com>
2024-01-04 17:02:28 +00:00
kdeb@odoo.com f1d6919642 [FIX] hr: change user on employee Access Error
Issue

    Admin unable to change related user on employee profile due to
    restricted access to bank account.

Steps to reproduce

    1- In the Employee app, go to the HR settings tab of an employee.
    2- Remove the related user from this profile.
    3- Set that removed user as the related user on a different employee
        profile and save (expect no error).
    4- Attempt to revert back to the original user.
    5- Encounter an access error.

resolution

    - Added sudo() in the browse operation to prevent access errors.

opw-3578412

closes odoo/odoo#147993

X-original-commit: 2b27b740ec3cff2fc088f4d01d7347668f6eb441
Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
Signed-off-by: Kawtar Drissi El Bouzaidi (kdeb) <kdeb@odoo.com>
2024-01-04 17:02:27 +00:00
Romain Derie 891162574e [FIX] website: allow restricted editor to optimize SEO
Originally, restricted editors don't have the rights to edit the SEO of
a record.

It was probably a bad idea as they can already edit the record itself
and can change the name / description of the record in the page.
Changing the SEO seems to be very similar.

Also, for our internal needs, we need our HR people (which are
restricted editor with rights on jobs position) to be able to edit the
SEO of their jobs. And we don't want to grant them the full editor
right.

Note:
- We already have a `data-can-optimize-seo` attribute set on the HTML
  tag if one is logged in, but this is just about knowing if the record
  has SEO-mixin capability, it does not check the rights for a given
  record.
- In master, one day, we would like to have the "Edit" button shown only
  when something can be edited for restricted editor (to not be able to
  enter edit mode to then not be able to edit anything). The same would
  be nice here: optimize seo menu could only be shown if you have the
  right, but we don't want to do an extra RPC each time for now.
- We keep the info shown in readonly mode so the restricted user can see
  it and ask for a change to someone else if needed

Related commits:
- https://github.com/odoo/odoo/commit/94e2eefca28196efc0ac38f155a3b85acbbdeaae
- https://github.com/odoo/odoo/commit/21464edf7ce858c065e113e32d857dfa4ace1788

closes odoo/odoo#147981

Signed-off-by: Jérémy Kersten <jke@odoo.com>
2024-01-04 17:02:26 +00:00
Alexandre Kühn c755f1763e [FIX] mail: no quick action on attachment on small device
When a message had more than 1 attachment, it was not possible
to preview the attachment on a mobile device.

This happens because the hover buttons for delete/download the
file took the whole clickable area of attachment to see the preview.

To enable quick actions in mobile, this require non-trivial UI
tweaking. To match behaviour of version 16.0, these quick-actions
have been disabled in mobile.

opw-3664795

closes odoo/odoo#148091

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2024-01-04 13:54:53 +00:00
vava-odoo fda4dc11c0 [FIX] base: correct typos in res.country.state.csv
Fixes #131211

closes odoo/odoo#148082

X-original-commit: d7576dff8abce0d7586d06b9dc7eb380e6696974
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2024-01-04 13:54:52 +00:00
Ahmed Khalaf 57d8590028 [FIX] {sale_}stock: Fix forecast widget
To reproduce:
- Create a product with 1 on hand quant;
- Enable 3 steps delivery;
- Create a SO with product and 1 quant the SO;
- The forecast widget shows that there is qty available in stock;
- Create 2nd SO with product and 1 quant;
- Unreserve the 1st SO pick and reserve pick of 2nd SO.

Current Behavior:
Forecast widget on 2nd SO says no stock available despite being reserved
and shows available stock for 1st SO.

Expected Behavior:
Forecast widget on 2nd SO says available stock and no stock for the 1st
SO. Basically the reserved SO should have qty in stock on the widget.

opw-3590385

closes odoo/odoo#148019

X-original-commit: 012c8ee44c059c578d11ca6ff79b767f233a01e1
Signed-off-by: Steve Van Essche <svs@odoo.com>
2024-01-04 13:54:50 +00:00
David Monnom (moda) 54e84851ab [FIX] point_of_sale: fix pos_restaurant in free trial
When you install point_of_sale and then pos_restaurant, you end up with
a pos_config with an archived journal.

Then, if you change the chart of account via demo data, it doesn't
delete the archived log and crashes.

To correct this problem, we add `with_context(active_test=False)` to
the pos.config search.

closes odoo/odoo#147889

Signed-off-by: Pierre Masereel (pim) <pim@odoo.com>
2024-01-04 13:54:49 +00:00
Mahdi Cheikh Rouhou (macr) 8a892da746 [FIX] hr_attendance: kiosk mode phone display
Issue:
======
the display of kiosk mode in phone is broken

Steps to reproduce the issue:
=============================
- Install hr_attendance
- Activate Employee Pin Identification in the settings
- Change to phone view
- Go to attendances/kiosk mode
- Identify Manually
- You can't search for employee , scroll employees and see the name of
  the employees.
- Click on any employee, the button back isn't fully shown and clicking
  on it does nothing.

Solution:
=========
Display:
- Added some css for `md` size devices.

Back button:
- There click function was missing.

opw-3645708

closes odoo/odoo#147830

Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
2024-01-04 13:54:48 +00:00
Astik Singh dee14636ca [FIX] website_forum: fix the invalid URL link
How to reproduce:
- Login as a portal user, create a new post by adding a URL link
- Post Your Question
- Login as admin to validate the post
- Click on 'To Validate' from the moderation tool
- Click on the mentioned URL

Throws a Traceback and redirects to the about:blank#blocked
page.

Technical Reason:
The '_update_content' method performs a regular expression
on the link by using the escape method, which is later convert
the backslash '\' into '%5C' while html_sanitize.

After this commit:
Clicking on the mentioned link redirects to the correct URL

Task-3472776

closes odoo/odoo#148064

X-original-commit: dedfb9a42e7bade98756e73a3d6c54c581e99547
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2024-01-04 12:02:10 +00:00
Martin Quinteros 2f6b3a0ee0 [FIX] payment_mercado_pago: sanitarize tx reference in webhook url
Description of the issue/feature this PR addresses:
The webhook URLs used by MercadoPago are not sanitized and cause the payment to fail when the URL contains spaces or other non-ASCII characters.

Steps to reproduce the bug:
1. Instal the Argentine localization and configure "payment_mercado_pago" as the payment method (test or production).
2. Create an invoice and generate a payment link (the reference will be something like "FA-C 0001-000133444").
3. Initiate the payment process and it will generate an error in the last stage of payment (on the MercadoPago website).

- Mercadopago tests credentials TEST-4811719641145832-020115-c5caffc149634e3e9d72fde2b74544d8__LD_LA__-172837665
- Used payment methods: https://www.mercadopago.com.ar/developers/es/docs/checkout-api/additional-content/your-integrations/test/cards

- Credencial de test usada TEST-4811719641145832-020115-c5caffc149634e3e9d72fde2b74544d8__LD_LA__-172837665
- Metodo de pago usados: https://www.mercadopago.com.ar/developers/es/docs/checkout-api/additional-content/your-integrations/test/cards

Current behavior before PR:
Payment in MercadoPago cannot be confirmed when the reference contains spaces.

Desired behavior after PR is merged:
Payment in MercadoPago is confirmed even when the reference contains spaces.

Adhoc Ticket: 68591

closes odoo/odoo#148027

X-original-commit: 320b316df0a2c7df183f80db4a561ff5d1517e70
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2024-01-04 12:02:08 +00:00
Soukéina Bojabza f1a2fe43a4 [FIX] web_editor, website: consider images with a link as grid images
The "grid images" are grid items that only contain an image (i.e. the
image is alone in its column). This distinction with other images in
grid mode allows to set the `object-fit` CSS property to `cover` so they
take the whole space of the grid item (see commits [1] and [2]). In
commit [3], the "Position" option has been added, allowing to switch
between the `cover` and `contain` values for this property, to have the
possibility to still choose to display the entire image, so it can keep
its ratio.

However, only the images that are direct children of the column have
been considered when checking if it was a grid image and in the related
CSS rules. This means that an image with a link cannot be one, since
the image is the child of an anchor element `<a>` in that case. It can
therefore not be set as "cover" or have the "Position" option.

This commit adds the support for images with a link set on them, so they
can be considered as grid images too.

Steps to reproduce:
- Drop the "Masonry" snippet.
- Click on the image and set a link on it.
=> The image is now "contain" and the "Position" option disappeared from
the right panel so we cannot change it.

[1]: https://github.com/odoo/odoo/commit/e9c7e020daf88022d6e02de0a5620074e8417b5a
[2]: https://github.com/odoo/odoo/commit/d8c374e3e6b31bf88aa42952aadf3379936f7600
[3]: https://github.com/odoo/odoo/commit/faf19ef7f87fc043fb9a814516e01b8eeafd9b61

opw-3580128

closes odoo/odoo#148022

X-original-commit: 085d70cea571ea80c141ac6005e8bd8333bd269f
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Soukéina Bojabza (sobo) <sobo@odoo.com>
2024-01-04 12:02:07 +00:00
Simon Genin (ges) 9c16842038 [FIX] website_cf_turnstile: better error message for turnstile errors
Right now, when a turnstile error occurs, the user is displayed a
CORS error, which is incorrect. This commit fixes that by displaying a
more accurate error message.

The fix requires the addition of a small trick which is to use the
turnstile error handler system to catch and rethrow the error. It seems
useless, but it is actually required as errors thrown by files coming
from external domains will be set by the browser as "Script error" and
stripped of any further info. So for better error handling, these few
lines are worth it.

The error is most likely to happen when duplicating a database as
turnstile requires a specific domain name in its cloudflare settings.
This improved message will hopefully help support manage better this
situation.

Hopefully, we can make something in the DB duplication tool to avoid
the issue entirely and have this error message displayed only for "real"
but rare errors.

closes odoo/odoo#148016

X-original-commit: 112508dbc57bfbc3e8145bf4c8ed260e17071a91
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
2024-01-04 12:02:06 +00:00
Mayurrajsinh Rathod b83049487f [FIX] website_crm_partner_assign: align priority on portal view
Steps to reproduce 
==================
Make sure your resolution is around '1368 x 768'.
1. Open/create an opportunity and assign a partner (Joel wills).
2. Go to Joel's portal view.
3. Click on the Opportunity and go to the priority.
The priority's alignment is distorted.

After this commit
=================
Align priority correctly on the portal view of opportunities.

Task-3607070

closes odoo/odoo#147983

X-original-commit: dfff592bea9cd393913b703e512dc56b83928849
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2024-01-04 12:02:04 +00:00
FrancoisGe da358cfc1f [FIX] web: add autocomplete attribute to the email input in login view
Before:

In chrome, you can see the message "[DOM] Input elements should have
autocomplete attributes (suggested: "username"):
(More info: https://goo.gl/9p2vKq)".

After:

The message does not appear.

Also, This maintains consistency with the password input which has the
attribute autocomplete.

closes odoo/odoo#147971

X-original-commit: df53b6a842f6eecc699ea9d8625c918279bb22c6
Signed-off-by: Francois Georis (fge) <fge@odoo.com>
2024-01-04 12:02:03 +00:00
FrancoisGe d61829f9a2 [FIX] web: close dialogs on navigation command
Before this PR:
Previously, when the command palette was opened and a navigation command
("/") was being executed with single or multiple dialog boxes behind it,
only the command palette would close. This left the dialog boxes open.

After this PR:
Now, when a navigation command ("/") is being executed from the command palette,
all the dialog boxes and the command palette close simultaneously.

Task-3441132

closes odoo/odoo#147956

X-original-commit: 7b32b235ec488d347285a9f47aa9d4b04b0b186c
Signed-off-by: Francois Georis (fge) <fge@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2024-01-04 12:02:02 +00:00
Guillaume (gdi) f2d3a193c2 [FIX] website: show form dynamic recipient email in edit mode
Since [this other commit], the recipient email option of the form on the
`/contactus` page is not filled correctly with the company email.
By chance, the form signature task fixed the bug but introduced another
one. The previous commit fixed the bug introduced by the form signature
task but reintroduced the inital bug. This commit fixes the initial bug
and adds a test.

By default, the form on the `/contactus` page sends emails to the email
address of the company. Unfortunately, before this commit, when a user
entered edit mode, the Recipient E-mail option always displayed
"info@yourcompany.example.com" even when the company's e-mail address
was different. This commit corrects this by displaying the dynamic value
of `company.email` in the Recipient E-mail option coming from the
data-for.

Steps to reproduce the issue fixed by this commit:
- Go to Settings > General Settings
- Update the company's email address
- Go to /contactus and edit
- Click on the form

=> The recipient email value is still "info@yourcompany.example.com"
   instead of the company's email address.

This commit fixes the issue, adds a test to ensure the recipient email
option is correct and adds a utility to parse the data-for data.

Bonus: this commit also fixes the following issue catched by sentry:
- Go to /contactus
- Click on Edit
- In the Form option, remove the content of the 'Recipient Email' field.
- Save
- Fill and submit the form

=> An error is generated in the log.

[this other commit]: https://github.com/odoo/odoo/commit/043e1fdf923d2037dd8da128ab99388f0c92e544

task-3382195
sentry-4633940473

closes odoo/odoo#147933

X-original-commit: 56f6b8dccec5cebc9a93454538b39886d4d3f63c
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Guillaume Dieleman (gdi) <gdi@odoo.com>
2024-01-04 12:02:01 +00:00
Guillaume-gdi f9154bb6db [FIX] website: make email_to of contactus form dynamic again
The email_to field of the contactus form have to be dynamic except if
the user manually set it via the form options. Unfortunately, the
website signature task broke this feature. This commit fixes it and adds
a test to prevent this regression in the future.

Steps to reproduce the bug:
- Go to the contactus page
- Edit the page
- Add a field on the form
- Save the page
- Change the company email address via the settings

=> The contactus form still send the email to the old email address.

Related to task-3382195

X-original-commit: 10b4db60fbd077936b5c9586485fa40c3c890d3f
Part-of: odoo/odoo#147933
2024-01-04 12:02:01 +00:00
Julien Castiaux 2a8dd60118 [FIX] core: HTTP 413 when restoring large backups
In #126914 a limit on the request size has been enforced, that limit is
by default 128MiB and can be configured via an ir.config_parameter. When
restoring a backup larger than 128MiB via the database manager, the
default limit was used and the request was cancelled with a Request
Entity Too Large (code 413) HTTP error.

It is now possible to define a default max content length per route,
that per-route limit takes over the `web.max_file_upload_size` ICP.

Moved the code from `get_http_params` to `pre_dispatch` to better align
with the httpocalypse new http stack.

Fixes: #144144
opw-3643475

closes odoo/odoo#147506

Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2024-01-04 12:01:59 +00:00
kdeb@odoo.com e88f8ad89f [FIX] website_event: Add style to the quantity of selected tickets
Issue:
- In mobile when we have multiple tickets, the quantity of
      selected tickets is not visible

Steps to reproduce the issue:
- Go to events
- Select any event with multiple tickets
- Go to website
- Click on register now
- Notice in mobile the quantity of selected tickets is not visible

Solution:
- Add style to the quantity of selected tickets

this it was introduced by: 469d94a
opw-3602057

closes odoo/odoo#146904

Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2024-01-04 12:01:58 +00:00
Antoine Boonen 26a2e94528 [FIX] l10n_in: Update India default tax.
Problem
---------
Before, the default tax for sale and purchase was: GST 5%. Commit
084408a9bb, modfied by accident the
default tax to IGST 18%.

Objective
---------
Revert the deault taxes back to GST 5%.

Solution
---------
Update the default taxes in the l10n_in template file.

task-3634577

closes odoo/odoo#146809

Signed-off-by: Josse Colpaert <jco@odoo.com>
2024-01-04 12:01:57 +00:00
Nishit Prajapati 4120e46fdc [FIX] mass_mailing: fix template content visibility in email
How to reproduce:
 - Create an SMS and send it
 - go to the sent option and select a contact
 - Click on add to list
 - Select a mailing list
 - then click on add and sent mailing (you will be redirected to email marketing)
 - Select a template and send it
 - The recipient will not be able to see the template (The email is blank)

Issue:
Template value is not stored in the body_html field

Technical reason:
When the record is saved the changes in `body_html` are discarded from _getchanges() https://github.com/odoo/odoo/blob/c2b160fe50c24e9f01d0d5b350f2422cfdbc72d4/addons/web/static/src/model/relational_model/record.js#L574-L581
because, field is set to readonly = 'true' after this commit https://github.com/odoo/odoo/pull/132247

After this commit:
The recipient will be able to see the template

Task-3556020

closes odoo/odoo#143293

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2024-01-04 12:01:54 +00:00
Dossogne Bertrand 58dec20ccf [FIX] hr, hr_contract: fix employee attendance data fetch
Before this commit, _get_calendar_attendances was calling
the calendar method get_work_duration_data without specifying
the company in the domain, ending up in wrong data if global
leaves that don't concern the employee are concerning the calendar.

This commit adds a domain for that method call so that only
relevent global leaves are taken into account.

closes odoo/odoo#148043
2024-01-04 10:46:39 +00:00
Robin Lejeune (role) b0bb196dce [FIX] web_editor: unobserve background grid z-index
Minor fix: the background grid is not observed in the first place,
setting a z-index on it should not be observed either.
Noticed when fixing `automaticStep(Un)active()` at [1].

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

Related to task-3576046

closes odoo/odoo#147970

X-original-commit: 901ed6d8c6c6bdb8aff8e9366d63bba59051019a
Signed-off-by: Guillaume Dieleman (gdi) <gdi@odoo.com>
2024-01-03 18:06:02 +00:00