Commit Graph
165431 Commits
Author SHA1 Message Date
Robin Lejeune (role) f9816ad99c [FIX] website_crm: fix access error for users without CRM rights
1. Backport of [1].
2. Steps to reproduce:
- Install website_crm
- Connect as Admin and remove the sales rights for Demo
- Check the website on a private window (to create an anonymous visit)
- Connect as Demo on the normal window
- Go to Website > Reporting > Visitors
=> It triggers an access error due to lead_ids being restricted to
sales_team.group_sale_salesman.
(Note: the error sometimes isn't triggered at that point. In that case,
click on the visitor: the same error will trigger.)

Considering the computed field doesn't do anything critical as it just
retrieves the email and phone number, the restriction is overridden on
the field.

[1]: https://github.com/odoo/odoo/commit/7de453477d7c23e607a15e0d60613080857e3371

opw-3475301

closes odoo/odoo#136362

X-original-commit: 70faf9bb07c9d801b3b06b325fc33de66c8406f3
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-09-25 17:11:31 +00:00
Maximilien (malb) 87b067adfe [FIX] l10n_de: din5008
In the din5008, there has been problem in the display of the paper format either
in the pdf or the preview.

In the preview we had a part of the page on the right that wasn't used caused by
the negative margin and the width of 180mm. But by removing that the pdf is
broken, the header is hiding some information.

To deal with that, we will add the width and negative margin only for the pdf
by adding a conditional css classes.

Also,it seems the footer with the company details can go out of page, by adding
a text-wrap on it, it solves this issue.

(In this commit, we override part of those commit:
https://github.com/odoo/odoo/commit/481f442f4ef176072edf3261415dbb06f8a3bc6f
https://github.com/odoo/odoo/commit/f7812ae848e0a79adcd11f936f6cd7890da00112)

closes odoo/odoo#136500

X-original-commit: 6512069880407e5c48b0a07c0b5a74fc74633c9c
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
Signed-off-by: Maximilien La Barre (malb) <malb@odoo.com>
2023-09-25 15:20:27 +00:00
abd-msyukyu-odoo 74013202c6 [FIX] web_editor: ctrl+a container should be an element
If somehow there is no selection but the `_handleShortcuts` handler still gets
called with `CTRL+A`, `container` would be a JQUERY object instead of an
element leading to a crash in `selectNodeContents` which expects a `Node`.

task-3506666

closes odoo/odoo#136499

X-original-commit: e6fac045282465960c0e4a7ecbbbb5e5ac8dff92
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Damien Abeloos (abd) <abd@odoo.com>
2023-09-25 15:20:26 +00:00
Hussain Hammad 2cf112abbf [CLA] signature for hussain
closes odoo/odoo#136482

X-original-commit: 637fe5c7084f0530e4efd2708aff64b034d14a9d
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-09-25 15:20:25 +00:00
Brieuc-brd f5d1669ea8 [FIX] web: adapt the form view to large screens
Prior to this commit, there was a spacing issue in large screens (eg. 4K
screen), the form view wasn't large enough and this created a big gap
between the form view and the chatter.

This commit adapts the form view to large screens.

task-3453381
Part of task-3326263

closes odoo/odoo#136454

X-original-commit: 1a995cad898283f6909506ba43d1692381b3d6ef
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-09-25 15:20:23 +00:00
FrancoisGe ef77dbee98 [FIX] web: x2m causes an onchange on the parent which fails
When the onchange triggered by an x2m fails on the parent record,
we want to reuse a valid value (the one before the onchange).

How to reproduce:
- Go to a form view with an x2m (onchange=true) that contains at least one record
- Edit the record in the x2m
- onchange on parent record fails

Before this commit:
    The value is unchanged.

After this commit:
    The value of the edited field is replaced by its old value.

closes odoo/odoo#136450

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-09-25 15:20:22 +00:00
Mayurrajsinh Rathod 7daff81041 [FIX] event: prevent scheduled communication for inactive events
Prior this commit:
The mail scheduler of the event notifies the attendees even when the event is
no longer active.

After this commit:
Inactive events no longer notify attendees.

Task-3381876

closes odoo/odoo#136429

X-original-commit: b61ece38a29e63f77daa638472228caa063d26e6
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-09-25 15:20:21 +00:00
Astik Singh d670662897 [FIX] survey: resolved the popover issue stuck in a live session
Before this commit:
In the survey, when you start a live session and click on the URL the `copied`
popover appears but doesn't go away.

After this commit:
Now that popover will close automatically.

Reason:
There was already a `tooltip` instance on the element and we try to add the
`popover` on that element which causes an issue.

Task- 3458901

closes odoo/odoo#136424

X-original-commit: 01dabbd207b230a3348aad0e48a208ba2f49d162
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-09-25 15:20:20 +00:00
pash-odoo 6f9e561783 [FIX] hr_skills: fix resume end date wrong selection
before this commit, in resume we are able to put end date less than start date
which is not possible in real life.
make change in constraint to check selected end date is greater than start date.
make changes in demo data of end date which are according to new changes.

task-3397726

closes odoo/odoo#136326

X-original-commit: 1cf56688126d3f0a1d27f4ed5ee995c4dcd956bc
Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
2023-09-25 15:20:19 +00:00
Aaron Bohy a9b4cba56e [IMP] web,purchase: views: explicit "context" key in evalContext
This commit removes a loophole in the evalContext used in form,
list and kanban views to evaluate python expressions (modifiers,
domains and contexts). Before this commit, the evalContext was a
mix of different things:
 - keys of the current context (which also contained keys from the
   user context);
 - a key for each field in the view (allowing to use field values);
 - a "parent" key in the case of x2many records (allowing to go up
   to the parent record values).
 - "active_id", "active_ids", "active_model", "current_company_id".

All those keys were mixed in the evalContext, and they could
obviously conflict (e.g. if there was in the context a key which
was also the name of a field).

Even though the evalContext didn't contain an explicit "context"
key, expressions like `context.get("x")` worked. This was because
the python evaluator automatically adds the whole evalContext as
value for the "context" key if this one doesn't exist. This allowed
people to also access field values with `context.get("fieldName")`
and thus bypassing the view validation, which ensures that
everything used in those expressions is either a py builtin
supported by pyjs, a field name which is in the view or some other
whitelisted keys ("uid", "allowed_company_ids"...). Fun fact:
people did it, in a form view that is used on two different models
(product.product and product.template).

With this commit, the context (and user context) keys are no longer
spread into the evalContext. Instead, a "context" key is added.
Two special user context keys can still be accessed directly though,
without doing `context.get("...")`: "uid" and "allowed_company_ids".
The reason why we keep them is simple: those were the two only keys
that could be used directly as they were whitelisted by the view
validation. The client also evaluates domains and contexts coming
from actions and from search view filters. In those cases, the
evalContext is simply the context, and those two keys are widely
used. So it's easier if we know that, e.g. "uid" can be always
directly accessed, whether we're in an action domain, in a search
view or in a form/list/kanban view.

To summarize, accessing a context key must always be done through
`context.get("...")` except for "uid" and "allowed_company_ids",
which can still be accessed directly. This doesn't change from
before. What changes is that a record field can no longer be
accessed with `context.get("...")` (which kind of allowed to bypass
the view validation).

closes odoo/odoo#135782

Related: odoo/enterprise#47522
Signed-off-by: Francois Georis (fge) <fge@odoo.com>
2023-09-25 15:20:17 +00:00
Lucas Lefèvre (lul) f43f0c407c [REF] spreadsheet_dashboard: use web_search_read to load dashboards
Previously, the dashboard action needed two RPC calls to be ready:
1. load the dashboard groups (with the dashboards ids in the groups)
2. load the dashboard display names

Now, with the new `web_sear_read` we can load both at the same time,
saving one http request.

closes odoo/odoo#134984

Signed-off-by: Vincent Schippefilt (vsc) <vsc@odoo.com>
2023-09-25 15:20:16 +00:00
Paolo Gatti (pgi) 5c62e0871e [FIX] l10n_it_edi: Reset to draft / Request cancel fix
In the odoo/odoo#122194 PR I incorrectly used the `need_cancel_request`
flag instead of the `show_reset_to_draft_button` one.

Italian EDI doesn't allow any sort of cancellation
(in case of error you have to a full refund credit note).

closes odoo/odoo#136436

Signed-off-by: Josse Colpaert <jco@odoo.com>
2023-09-25 13:09:10 +00:00
David Monnom (moda) 391ac741c2 [IMP] pos_self_order: merging mobile and kiosk
Previously, the self-order code and parameters were split into two parts
mobile and kiosk.

Now kiosk and mobile have been merged with each other to simplify
maintainability.

closes odoo/odoo#136051

Related: odoo/upgrade#5174
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-09-25 13:09:08 +00:00
Bastien PIERRE 38460e3039 [FIX] project: Fix portal view conditional assets tests
The iframe doesn't need assets tests because they are loaded outside of the iframe.
The tour didn't crash because the content of the iframe was present (below the traceback message)

closes odoo/odoo#135492

Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-09-25 13:09:02 +00:00
Lucas Lefèvre (lul) 72392426ec [FIX] spreadsheet: cast currency rate date
This commit fixes two issues with the ´date´ argument for
the ODOO.CURRENCY.RATE function.

First, the helper to cast the date is `toJsDate`, not `toJSDate`. Using
the wrong function name obviously crashes.

Second, the date was actually given to the server as a full ISO datetime
string, including timezone (UTC).

For function `ODOO.CURRENCY.RATE("EUR","USD", "12-31-2020 00:00:00")`, we
actually sent to the server "2020-12-30T23:00:00.000Z" (Brussels local time)
Notice that it's the previous day!

The field of `res.currency.date` is a date field, so it doesn't make sense
to send a datetime.

Now, only the date is sent ("2020-12-31")

opw-3498115

closes odoo/odoo#136411

X-original-commit: 6a4b7e7f216dc9a6372f5cc382262ff09cb317f3
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2023-09-25 11:30:16 +00:00
Antoine Boonen ae74f25120 [FIX] base_setup: Preview document external layout traceback
Problem
---------
When you go in the settings -> layout (debug mode) -> select external
layout --> preview document a traceback appears due to infinite looping
in the view definitions.

Solution
---------
This field is highly technical and should not be fiddled with by users.
For such reason, we set it as `readonly`.

task-3479152

closes odoo/odoo#136399

X-original-commit: 03cffc460e620639db6dbe132aa0be073a6396f5
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Signed-off-by: Antoine Boonen (aboo) <aboo@odoo.com>
2023-09-25 11:30:15 +00:00
Rodolpho Lima a7d9c07816 [FIX] website: add missing flow to LinkTools tour
Before this commit, some actions related to link creation and edition
were not tested by the LinkTools tour.

This commit adds steps to the mentioned tour in order to avoid
regressions of the issues fixed in the referred task.

task-3284649

closes odoo/odoo#136278

X-original-commit: b2a79ed9960d88d1bdf6465389f4ef720f6bc235
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-09-25 11:30:13 +00:00
Rodolpho Lima 196cf4a7ce [FIX] web_editor: update UI on link content change
When changing a link's content, its URL (href attribute) might change
(if the new label is a valid URL), due to a mechanism in OdooEditor.

Before this commit, when a change in the link's content leads to a href
change:
- if the LinkTools is opened, the URL input field would become outdated
and display an incorrect URL.
- likewise, if the popover is shown, its content and position would be
outdated (possibly covering the link's new content).

This commit makes sure both the LinkTools URL input field and the
popover stay up-to-date if a link's content or href changes.

task-3284649

X-original-commit: 1b0952f3635f5677ba3ab221a28ceb26920a1862
Part-of: odoo/odoo#136278
2023-09-25 11:30:13 +00:00
Rodolpho Lima e881bc6284 [FIX] web_editor: Link(Dialog/Tools) label input field
Before this commit, any changes made to label input field were lost when
the LinkDialog or LinkTools component was re-rendered.

This commit fixes it without leveraging OWL's reactivity/declarative
approach, because most of the code in these components is imperative and
not yet converted to the OWL paradigm, leaving such refactor to be done
in the master branch.

Part-of: odoo/odoo#136278
2023-09-25 11:30:13 +00:00
Rodolpho Lima 7fe1731c66 [FIX] web_editor: update link content on URL change
If a link's content is equivalent to its URL, two problems can arise
when its URL is changed via the LinkTools:
- The link's content becomes outdated, showing a different URL;
- On LinkTools destroy, the OdooEditor mechanism that updates a link's
href on label(content) change will update the href according to the old
label, effectively reverting the changes in the URL.

This commit avoids such issues by syncing the label with the URL input
field in such cases.

task-3284649

X-original-commit: 8ddcc08c1700151e697ecb3c0c1daec2db9f8fd2
Part-of: odoo/odoo#136278
2023-09-25 11:30:13 +00:00
Rodolpho Lima b622dba6db [FIX] web_editor: 'mailto' to 'http' link conversion
Before this commit:
- URLs like "domain.com/@/page" were incorrectly detected as an email
URL by Link(Dialog/Tools),
- switching from an email URL to a http URL with the Link(Dialog/Tools)
was not possible (URL remained prepended with "mailto:").

This commit improves email detection from simply looking for a "@" to
something slightly more robust, and makes switching between 'http'
and 'mailto' links possible.

task-3284649
opw-3245501

X-original-commit: e849ff4333355386dfb79bc574c93c76ed3e2d3b
Part-of: odoo/odoo#136278
2023-09-25 11:30:13 +00:00
Rodolpho Lima 02add8e5de [FIX] web_editor: auto transforming email URL
Typing a URL + SPACE transforms the URL into a link.

Before this commit, email URLs were incorrectly prepended with
'https://'.

Because it is not desirable to automatically transform email URLs, this
commit disables link transformation for email URLs, leaving it only
active for http URLs.

task-3284649

X-original-commit: ad0e7845fceb578398e42e4b35820c415734452a
Part-of: odoo/odoo#136278
2023-09-25 11:30:13 +00:00
Rodolpho Lima 832b945837 [FIX] web_editor: link update on label change
OdooEditor has a mechanism to update a link's href on label change, if
the new label is a valid URL.

Before this commit, there were two issues:
1. it did not work for email links. In fact, because this mechanism was
incorrectly prepending email URLS with 'https://', [1] disabled it for
'mailto:' links.
2. when a link had a 'http' href but its label did not contain the protocol,
upon label change (into a valid URL) the link had its href changed to 'https'.

This commit:
1. re-enables the auto update mechanism for email links and fixes it, so
that it can correctly update both http and mailto links.
2. fixes the 'http' to 'https' coercion issue, making sure the current
protocol is kept when updating http(s) links.

task-3284649

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

X-original-commit: 6740e2821c51897baa110e9e4129b40c403e000c
Part-of: odoo/odoo#136278
2023-09-25 11:30:13 +00:00
Rodolpho Lima 5f7c4dda1d [FIX] web_editor: persist URL-like text transformation to link
Commit [1] separated the two responsabilites of _onURLInput: making
changes to the DOM and updating the UI, taking care that only the second
one is done at start.

But this broke the following functionality:

- Have a URL-like text (ex: odoo.com), select it and click the link icon
on the sidebar.
- The URL is deduced from the link's label.
- Click anywhere to close the sidebar.

Before [1], the link transformation would be kept. After it, it is not.
This happens because this is a particular case in which we want to apply
changes to the DOM at start time, as if a URL input event had happened.

This commit fixes it.

task-3284649

[1]: 54746012d3

X-original-commit: da0a3f34401547478107945626034d7932855f02
Part-of: odoo/odoo#136278
2023-09-25 11:30:13 +00:00
Rodolpho Lima 37ac0ba83d [FIX] web_editor: toolbar setup in website
Before this commit, the setup actions performed by _configureToolbar
were missing for the website toolbar. This resulted, among other things,
in non-responsive buttons like create link or insert media.

Part-of: odoo/odoo#136278
2023-09-25 11:30:13 +00:00
Julien Carion (juca) bbc4de86d9 [IMP] web: list many2oneAvatar should not be a link
This commit changes the canOpen prop of the many2oneAvatar field to be
set to true only when in form view. The field will therefore stop being
a link in readonly when outside of form view.

closes odoo/odoo#136118

Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
2023-09-25 11:30:11 +00:00
Saurabh Mishra 53c6d8e0bc [FIX] pos_restaurant: load only shop demo products when no restaurant
When the user using `point_of_sale` deletes pos restaurant and tries
to load demo products in pos shop then user will face error.

Note: Use db without demo data

steps to produce:
- Install `point_of_sale`.
- Point Of Sale > Configuration > Point Of Sales, delete pos restaurant.
- Point Of Sale > Shop > New Session, click on `our demo products`.

Error: `KeyError: 'name'`

After applying our commit, if the user clicks on `our demo products`
after deleting pos restaurant then the user would be atleast able to see
shop demo products and other demo products which are not part of
pos restaurant.

sentry-4399441443

closes odoo/odoo#135633

X-original-commit: feaf26db77fde9afae23c8b3c3ea2f0f441b4dae
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-09-25 11:30:10 +00:00
Theo VINCENT (thvi) 572ac8a01f [FIX] pos_restaurant: onboarding data loading
The onboarding demo data cannot be loaded since f96ea753f3.

Steps to reproduce:
 - Start a database without demo data (--without-demo=True)
 - Open a POS session for the default shop
 - Click to load demo (onboarding) data

An error is raised.
The error is due to a mistake in the XML, the food category logo is not assigned to the right record.

closes odoo/odoo#136392

Task-id: 3519677
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-09-25 09:38:43 +00:00
Theo VINCENT (thvi) 6ad564cd49 [FIX] point_of_sale: close session when no cash pm
Since a869ee87f2, the cashier can no longer close a session from the frontend UI if the POS config has not a cash payment method.

Steps to reproduce:
 - Remove any cash payment method from the POS config you want to use
 - Open a POS session for the previous POS config
 - Make an order
 - Try to close the session

A (silent) error is raised, the user cannot close the session.
This error is particularly noticeable when we don't use demo data (--without-demo=True).

The fix consists in correctly checking if there is a cash payment method or not.

closes odoo/odoo#136387

Task-id: 3519547
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-09-25 09:38:42 +00:00
Ali Esapzai b70608c5e3 [CLA] signature for Espzai
closes odoo/odoo#136384

X-original-commit: 3008bd06d06b4d89bfc6df1e7f4e5dadf7992ab4
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-09-25 09:38:41 +00:00
yhu-odoo 7a6d722f59 [FIX] mrp: call correct action in action_view_mos
In 6698406b92a598f24fa0a778a28b6ef727adc008, we removed action
mrp.mrp_production_report. action_view_mos still using this action, we
change it to use mrp.mrp_production_action instead.

closes odoo/odoo#136382

Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2023-09-25 09:38:40 +00:00
Djamel Touati d87c0919a1 [FIX] purchase_mrp: fix MO overview
Steps to reproduce the bug:
- Create a storable product “P1” with BoM:
   - Component C1:
        - Quantity: 2
        - supplier:
            - add any vendor, min quantity: 3
- Create a MO to produce 1 unit
- Click on the manufacture overview

Problem:
A user error is triggered:

`“The unit of measure Units defined on the order line doesn't belong
to the same category as the unit of measure False defined on the
product. Please correct the unit of measure defined on the order line
or on the product, they should belong to the same category.”`

The _compute_quantity function is called with supplier.product_uom even
though no supplier with the requested quantity is available.

opw-3495770

closes odoo/odoo#136340

X-original-commit: 17e5323e292a7b29ee6d30711cf3f083e05dd008
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
2023-09-25 09:38:39 +00:00
Tom De Caluwé 3de3a1903a [FIX] web: avoid undefined format in parseDate
The safeConvert function in the useDateTimePicker hook will call parseDate with
an undefined format when no format option was provided to the hook. Before this
commit, since the options object passed to parseDate still contained the format
property, the undefined format will also be passed on to the parseDateTime
function. This is problematic, because now the parser will use the default
datetime format, and it will fail because of the absence of a time value in the
input string.

For some input formats, parseDateTime will still yield the correct result using
one of its backup parsing methods. However, a wrong result will be returned for
date formats containing some textual parts (for example MMM/dd/yyyy).

Making sure no undefined format values are passed on in the parseDate function
resolves the problem.

opw-3478797

closes odoo/odoo#136221

X-original-commit: b04482ed87db05b3fc2523a08ce7ca5818af578b
Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
Signed-off-by: Tom De Caluwé (tdc) <tdc@odoo.com>
2023-09-25 09:38:38 +00:00
Mathias Mathy (MAMA) f63055b772 [FIX] repair: restrict service consumption in Sale Orders
When calling action_repair_done on a Repair Order that has been created
from a Sale Order (which is done by adding a product.template with field
'create_repair' set to True), we should update the delivered quantity of
the product responsible of the creation of the Repair Order if and only
if this product Invoicing Policy is in ['Ordered Quantities',
'Delivered Quantities', 'Prepaid/Fixed Price'].

closes odoo/odoo#136195

X-original-commit: fcbc689dc37cafd5a0cba7b57a2f40ad6acf4e26
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Mathias Mathy (mama) <mama@odoo.com>
2023-09-25 09:38:37 +00:00
Touati Djamel (otd) 3f496c3b30 [FIX] purchase: correctly calculate average price
cherry-pick of a4904fb4889c16322494981f5a1be586683704bd

Steps to reproduce the bug:
- Create a storable product “P1”
    - costing method: avco
- Create a PO:
    - Add the product “P1”:
        - Line 1: Qty= 10, price= $50
        - Line 2: Qty=1, price= $10
    - Confirm the PO and receive the product

- Go to purchase → Reporting → Purchase Analysis

Problem:
The average price is incorrect, the current calculation is:

(50 + 10) / 2 = 30

The average should take into account the quantities purchased in each
line, And not simply the number of line, so the correct calculation
should be:

((10 * 50) + (10 * 1)) / 11 = 46.36

The SQL query is correct, it is when applying the read_group that the
calculation is incorrect, we should override it to make a personalized
calculation of the average.

opw-3136406

closes odoo/odoo#136097

X-original-commit: cd84549a3e5ea09d230dc1d02e05456a2372fd34
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
2023-09-25 09:38:36 +00:00
Paolo Gatti (pgi) 17b2597482 [IMP] l10n_it_edi_pa: merging in l10n_it_edi
Module `l10n_it_edi_pa` was created for Split Payment
because stored fields couldn't be added to an existing module.
We are amending this by merging it into module `l10n_it_edi`.

Task link: https://www.odoo.com/web#id=3513075&model=project.task
task-3513075

closes odoo/odoo#135934

Related: odoo/upgrade#5169
Signed-off-by: Josse Colpaert <jco@odoo.com>
2023-09-25 09:38:35 +00:00
std-odoo 91979b0fcf [IMP] http_routing, website_slides: redirect the user on /slides on AccessError
Purpose
=======
When a user tries to reach a course, an AccessError can occur when we
unslug the URL. Instead of the traditional error page, we want to
redirect the users to /slides, and the error will be displayed there.

Task-3477630

closes odoo/odoo#135926

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-09-25 09:38:33 +00:00
Adnan Saiyed 859714e5f6 [FIX] web_editor: traceback when clicking button in table
Current behaviour before commit:

In table, when clicking table menu icon it throws
traceback.

Desired behaviour after commit:

Now, clicking table menu icon opens table menu
without any traceback.

task-3503806

closes odoo/odoo#135324

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-09-25 09:38:32 +00:00
Pratik Awasthi fc2cc3174b [FIX] portal: set right color on text ellipsis when a tag is used in td
Before this commit, when `a` tag is in a td, the color of text ellipsis
(3 dots) is different than the text because the text-ellipsis is set on
the parent element, that is `td` element and the color is set on the `a`.

This commit sets the right color on td element when that element has `a`
element.

Limitation (only for td inside element with `o_portal_my_doc_table` class):
if the `td` element contains `a` tag and another element
then the color has to be set to that other html element otherwise,
the color will be the one of the a tag.

task-3251721

closes odoo/odoo#134993

X-original-commit: b28459ddee3bf76630e2968baecd1dd4bc7cba93
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-09-25 09:38:31 +00:00
hmai 8dfe8a8c6c [FIX] web editor: color of whole cell should change
This commit fixes the issue of partial coloring of table cells.

Before this commit, if one colors part of the text in the cell
and then seeks to color the whole cell, the last coloring
would not apply on the previously colored text.

We do that by preventing the cell coloring to be done differently
than other elements except if we want to change the
background color.

Task-3454903

closes odoo/odoo#130646

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-09-25 09:38:31 +00:00
Hugo Carlier (Huca) 260577dde0 [IMP] website_blog: improve help center
This commit adapts website_blog tests to change in website_helpdesk. The
method _compute_visible of model website.menu is modified to display
help team menus to backend user, even if they are unpublished. This
potentially add extra requests when rendering a website page. Therefore,
the performance tests are adapted accordingly.

task-3186564

closes odoo/odoo#134976

Related: odoo/enterprise#45115
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-09-25 09:38:29 +00:00
roen-odoo 7e01385ed4 [FIX] point_of_sale: make sure FP is not applied twice on refund
current behavior:
When a product with tax included is sold with a fiscal position that
match the tax to a tax of 0%, then when you refund this order the
fiscal is applied a second time. This result in the 15% tax removed 2
times and the price of the product is incorrect.

steps to reproduce:
- Create a product with 15% tax included
- Create a fiscal position that match the tax to a tax of 0%
- Create a POS with this fiscal position
- Open PoS, and make an order with the product
- Applyy the fiscal position
- Refund the order
- The price of the product is not the same as the one of the original
  order.

opw-3371028

closes odoo/odoo#136348

X-original-commit: 58406515233234ac0ed342d81a5c55886c3b5712
Signed-off-by: Robin Heinz (rhe) <rhe@odoo.com>
Signed-off-by: Robin Engels (roen) <roen@odoo.com>
2023-09-25 07:54:01 +00:00
Loukas Wets (lowe) 0c99b74ca1 [IMP] point_of_sale: custom combo choices order
Prior to this commit the combo choices were displayed in their ID order. This
commit add a sequence field that allows the user to choose the order of
the combo choices.

closes odoo/odoo#136331

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-09-25 07:53:59 +00:00
Mathieu Duckerts-Antoine 1995f21d42 [FIX] web: field service: protect async methods
The async methods of field service were not declared in its key async.
This would allow destroyed components to process the results of those
methods (despite an initial call to useService). We fix that.

closes odoo/odoo#135950

X-original-commit: 7955def19c7d4a8c49be472413423bbf3beec2e5
Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-09-25 07:53:58 +00:00
jorv 16179c9399 [FIX] core: assert _get_func_code code argument
closes odoo/odoo#33682

Signed-off-by: bve-odoo <bve@odoo.com>
2023-08-28 15:15:19 +00:00
Anita (anko) 4d1a1f1c99 [IMP] payment, *: verify and reroute payment flows
This commit changes the way transactions linked to a document (sales
order, invoice...) are created in a payment flow. Rather than receiving
and trusting the transaction values from the controller, they are now
read from the linked document, and the payment flow is rerouted to use
the document's module's controllers instead of that of `payment`.

This ensures that no unexpected value can be passed to the `create`
method of a transaction, and simplifies the implementation of the
payment flows of linked documents.

task-3136240

closes odoo/odoo#126425

Related: odoo/enterprise#43212
Related: odoo/upgrade#5124
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-09-23 21:08:01 +00:00
Martin Trigaux 07fd6277f9 [FIX] module: use file_path
The method get_resource_path is redundant with file_path but without
all the checks.
The method will be deprecated in master but make it use file_path in
stable.

closes odoo/odoo#136272

X-original-commit: 64ab4a6914dadd741cfe61d9bd1959ae4509a1ca
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-09-23 14:24:13 +00:00
jbw-odoo b6b7af6e62 [FIX] sale: fix ventilate rounding error on downpayment
This previous commit : https://github.com/odoo/odoo/commit/d197efa60cf7c00168847ce7afcfa1741410aee1 aimed at ventilating rounding error corrections on multiple lines. But this would introduce errors or unbalanced moves if the rounding amount/lines quantity was smaller than the rounding of the currency. E.g. à 0.01€ error divided on 3 lines would add 0.00333 on each line, and when the amount is rounded, it would vanish.

closes odoo/odoo#136366

X-original-commit: 0627b4609e8b1b3d15651d6cde0ff4cfdc85c5d6
Signed-off-by: Andrea Grazioso (agr) <agr@odoo.com>
Signed-off-by: de Wouters de Bouchout Jean-Benoît (jbw) <jbw@odoo.com>
2023-09-23 12:11:06 +00:00
Sébastien Theys 7a90938a70 [REF] mail, *: tests: simplify text option of contains
* = bus, calendar, im_livechat, hr, project_todo, sms, snailmail,
    test_mail, web, website_livechat

The current implementation often led to tests relying on DOM structure
to properly target the correct element with the text.

It is now easier to simply check if a parent contains some text.

closes odoo/odoo#136295

Related: odoo/enterprise#47770
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-09-23 10:33:04 +00:00
Thibault Delavallée eb228ac373 [FIX] test_mail: prepare and fixup tests for alias domains
Some tests are updated to lessen diff in future tests, especially about
aliases. Some tests are fixed as they are somehow incorrect (notably
in gateway testing) but currently passing as mail gateway is quite
permissive.

Add some tests preparing MC / alias domains configuration notably about
company / alias synchronization, which is currently only based on config
parameters.

Also update some tests by using fstrings which are generally more readable.

Finally move some tests to their right file / main testing class to keep
them ordered by main topic.

Prepares Task-36879 (Mail: Support MultiCompany Aliases)

closes odoo/odoo#136318

X-original-commit: odoo/odoo@c18300e225
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-09-22 18:40:25 +00:00