Commit Graph
148599 Commits
Author SHA1 Message Date
Laurent Stukkens (LTU) 4e02437a3a [FIX] rating: remove unused rating_last_value
This commit removes the rating `rating_last_value` field as it is no
more used in odoo.

closes odoo/odoo#84784

Related: odoo/upgrade#3257
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-02-23 11:00:42 +00:00
Umesh Gupta 0e601ebeb9 [IMP] website_crm_partner_assign: allow archiving partner activation
Currently, for the better first user experience, few partner activation
levels are available by default (added in data files). Since there is no
way to archive it, the only way to not use them in your production is to
delete it. But it means that on each migration, it will be restored.

To improve that, this commit introduces 'active' field in the activation
levels so that one can easily archive them if they are of no use, and
this way they won't be again created every time when db is migrated.

This commit also adds a search view with 'Archived' filter to see the
archived activation levels easily.

taskID-2753985

closes odoo/odoo#84401

Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2022-02-23 10:02:04 +00:00
Rémy Voet (ryv) 59ea46c97e [IMP] base: make recompute faster
When we read data of one record, the method `recompute` (`_fetch_field`
-> `_read` -> `flush` -> `recompute`) can take more than 40 % of the
time of the `_read`, due to a huge number of recordset creation (from
`records_to_compute` and `records & recs`).  Avoid that waste of time by
postponing the test on records.

For example, on a database with modules crm, mrp, purchase, website,
sale_management, reading the prefetchable fields of the current company
took 1.45 ms ± 60.3 µs, and now takes 1.17 ms ± 110 µs (more than 20%
speedup).

closes odoo/odoo#83818

Related: odoo/enterprise#24645
Signed-off-by: Raphael Collet <rco@odoo.com>
2022-02-23 10:02:00 +00:00
Rémy Voet (ryv) 041fe5e21e [IMP] base: add prefetching group feature
The field prefetching mechanism was poorly customizable.  Before this,
we could only tell if a field was prefetched with other fields or not at
all.  We have no way to inform the framework, like: "When I need data of
that field, prefetch these other fields, which are likely be used in the
same transaction".

From now on, the `prefetch` attribute is used as a grouping key for
prefetching fields.  When a field is fetched, all the fields with the
same value for `prefetch` are taken for prefetching.

For example, consider a small set of fields that are rarely used, except
for one flow A using them.  You want to prefetch those fields only in
the flow A, and you want to fetch them in a single query.  With the new
feature, simply set `prefetch=A` for some string `A` on those fields,
and they will be grouped for prefetching.

Part-of: odoo/odoo#83818
2022-02-23 10:01:59 +00:00
Rémy Voet (ryv) 8dda03228e [FIX] event: remove prefetch=True
Remove `prefetch=True` on fields `legend_blocked`, `legend_done` and
`legend_normal`, because they aren't used a lot and translated fields
have a big cost to fetch (one extra LEFT JOIN by translated field).

Part-of: odoo/odoo#83818
2022-02-23 10:01:59 +00:00
Rémy Voet (ryv) a1a30f52a3 [FIX] website: remove force prefetch for translate fields
Issue
-----
When website is installed, the rendering of template uses a side effect
of the ORM cache (cache shared between sudoed env vs non-sudoed env) and
the fields prefetching feature to work correctly.

The `self.visibility` in (`_handle_visibility`, website/ir_ui_view.py)
is done in sudo mode, then it will fetch all prefetchable fields and put
them in the cache (that will be read in non-sudo mode in the render of
the template).  Another example of issue related to this:
https://github.com/odoo/odoo/pull/83341.

Because of this, the fields of mixin `website.seo.metadata` were forced
to be prefetchable (the default for translate is to be not prefetchable
since https://github.com/odoo/odoo/pull/82896), which causes a useless
LEFT JOIN on "ir_translation" in most of business flow.

Fix
---
Remove the `prefetch=True` on mixin fields, and add a extra read to fill
the cache in case of website rendering.  It also allows to read these
fields at the same time.

Part-of: odoo/odoo#83818
2022-02-23 10:01:58 +00:00
qsm-odoo 863266530a [FIX] web_editor: avoid multiple calls to access asset content
Instead of calling get_resource_path multiple times, Odoo utils were
able to be used, allowing custo.

task-2774978

closes odoo/odoo#85182

X-original-commit: 5cda0604358f40bd3ec74b922539088386093a86
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Olivier Dony <odo@odoo.com>
2022-02-23 09:06:58 +00:00
Demesmaeker 6c6907ee1a [IMP] payment: improve send_payment_request test
We split the test in three to allow easier debugging at no cost in line
of codes and by extracting a part that could be used for future tests.

task-2659750

closes odoo/odoo#85162

X-original-commit: 8502d4ec895f2d4a2ddb1b305a9f6f119da750fa
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Signed-off-by: Morgane Demesmaeker <edm@odoo.com>
2022-02-23 09:06:53 +00:00
Merlin (megu) 950b0ae88d [FIX] account: show tax reports of company's country
The tax adjustment wizard shows tax reports of countries other than the
 current company's country

Steps to reproduce:
1. Install Accounting
2. Go to Accounting > Configuration > Management > Tax Reports
3. Create a report for another country than the current company and add
 a line with a tag name
4. Go to Accounting > Accounting > Actions > Tax Adjustements (in debug
mode)
5. The created tax report line is suggested but it shouldn't

Solution:
Put the domain of `tax_report_line_id` in python and add a filter on the
country

opw-2760337

closes odoo/odoo#84854

X-original-commit: cc13d20996f1e0a261829ced91cbbe18d6236fb5
Signed-off-by: William André (wan) <wan@odoo.com>
2022-02-23 09:06:49 +00:00
Touati Djamel (otd) ee2cb8d1e6 [FIX] mrp: prevent traceback when choosing a BOM of a product without a variant
Steps to reproduce the bug:
- Go to inventory > configuration > Products > Attributes
- Create a new Dynamic Attributes > add two attribute values
- Create a storable Product “Test”:
    - Add the two attributes
    - Save
    - Create a BOM related to this product
- Create a new manufacturing order:
    - Do not choose a product
    - Select the BOM related to the product “test”

Problem:
Traceback is triggered because as the product template only has dynamic variants, there is not a `product.product` record created yet.
but we try to access it in the onchange: https://github.com/odoo/odoo/blob/14.0/addons/mrp/models/mrp_production.py#L598

Solution:
do not set the product when a BOM of a product_tmpl without a variant was chosen
opw-2732254

closes odoo/odoo#84543

X-original-commit: 50b538e7d32bbce7cad7c05f0bc80db6b969a70b
Signed-off-by: Arnold Moyaux <arm@odoo.com>
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
2022-02-23 09:06:46 +00:00
william-andreandaj-fuentes 0afbefca21 [FIX] account: formula/tag conflict on tax report lines
When removing a tag_name but adding a forumula instead[1], postponing the
constraint made the constraint `_validate_formula` fail because we were
writing on `formula` before writing on `tag_name`, and both were non
null in that transient state.

[1] https://github.com/odoo/odoo/commit/1c184391d545298b9b38d4935a6e457ba7674f43#diff-f24beb4fa8533b0bb6f95ecb84b749c2f20991803142ed11282dcce944799098R187-R190

closes odoo/odoo#85174

X-original-commit: ecf4e6f8a6cf1eb99b689f9fe9088d5cad4dfa34
Signed-off-by: William André (wan) <wan@odoo.com>
Co-authored-by: william-andre <wan@odoo.com>
Co-authored-by: aj-fuentes <afu@odoo.com>
2022-02-22 21:05:44 +00:00
Sébastien Geelen (sge) 8a5c8a3cb9 [FIX] web_editor: fix icon replacement is mass_mailing
In mass mailing edition :
Replacing a font awesome icon with an image was not working properly.

task-2733908

closes odoo/odoo#85167

X-original-commit: d4d25c8b497e465753cef030292faa4824145cb1
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Geelen Sébastien (sge) <sge@odoo.com>
2022-02-22 21:05:40 +00:00
Odoo's Mergebot 4bfd756c2f [MERGE] portal_rating, website_slides: ease and improve review submission
PURPOSE

Make it easier to submit reviews and improve rating display.

SPECIFICATIONS

Remove useless and empty "Published on" + DATE MISSING when creating and/or
updating a comment response.

Fix various display of rating values when containing more than 2 decimals. Add
rounding in both frontend display as well as backend statistics computation.

In order to reduce friction and ease the rating process for attendees we do not force
the constraint stating that the message must contain a message or an attachment
onto the users. Do that only for courses

Fix various display issues (star titles, spaces, ...)

Task-2728564

closes odoo/odoo#82792

Related: odoo/enterprise#24640
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-02-22 20:47:55 +01:00
Noe Antoine db82f55330 [IMP] portal_rating: clean attributes of star element in rating composer
When hovering a star, a title is disturbing since a description is already
displayed to the user. "One star" is therefore confusing since it will appear
on every star, even for the fourth one out of five, for instance. Therefore,
all titles are removed from stars. Also, to avoid this confusion in aria label,
we do not use numbers in cleaned labels.

Task-2728564

Part-of: odoo/odoo#82792
2022-02-22 19:47:54 +00:00
Noe Antoine 4ddeca9ad0 [IMP] portal_rating: remove space between stars in rating star input
Before, the inline-block style created some small unbreakable whitespace between
the stars in the review/rating composer. It meant that when the user hovered
their mouse in that space, they left the star element, but not the stars area,
hence displaying the message of the default (current) rating instead of the one
that corresponds to the closest star. It is repaired using an inline-flex for
the stars area. The stars are also centered in their element, with a small
horizontal padding.

Task-2728564

Part-of: odoo/odoo#82792
2022-02-22 19:47:53 +00:00
Noe Antoine aead9a884e [IMP] website_slides: allow empty messages when reviewing courses
In order to reduce friction and ease the rating process for attendees,
we do not force the constraint stating that the message must contain a
message or an attachment onto the users. Instead, we allow ratings and
replace the empty message by a blank space to avoid triggering the error
message. If no stars are selected, an error message is now displayed to
the user, asking to select a rating before submission, preventing them
to post their review until then.

Since we do not really support 0 stars ratings, and do not want the user
to see that error message in case of the course, we set the default rating
to 4.0 instead of 0.0.
-> Therefore, we also remove the grey star contrast coloring on first review
   since we do not want the user to have the impression a choice has already
   be made beforehand. In that case, everything will be yellow.

Void content detection is done by extracting it in both python (portal
chatter post controller) and frontend (submission check) and relaxing it
in slides modules.

Task-2728564

Part-of: odoo/odoo#82792
2022-02-22 19:47:53 +00:00
Noe AntoineandThibault Delavallée 9355631e89 [FIX][IMP] portal_rating: round decimal ratings to two decimals
When hovering the number of stars of a course in front-end, for instance,
one can see "4,16666666666667 stars on 5". This is not very convenient.
The number is rounded up to two decimals instead. -> "4,17 stars on 5".

Same fix is done in backend in slides-specific kanban view of ratings. Value
is now rounded.

Finally _rating_get_repartition is fixed round values to the nearest half
value. We generally receive integer values between 0 and 5 but other values
may exist. Getting a repartition rounded at nearest half integer is sufficient
notably when looking at star-based display which covers only complete or half
complete stars.

Task-2728564

Part-of: odoo/odoo#82792
Co-authored-by: Noé Antoine <nan@odoo.com>
Co-authored-by: Thibault Delavallée <tde@odoo.com>
2022-02-22 19:47:53 +00:00
Noe Antoine 6e12ba51bb [IMP] portal_rating: remove "Published on" when updating or creating comment
When answering to a comment, or editing such an answer, the form shows
a "Published on" which is supposed to be followed by the date the comment
has been published. However, since when using the form we are editing or
creating an answer comment, it remains empty and useless. Therefore, we
remove it. It is still on comments once set, but not while editing them.

Task-2728564

Part-of: odoo/odoo#82792
2022-02-22 19:47:53 +00:00
Thibault Delavallée 83d2affbe9 [MOV][FIX] rating: move rating values, thresholds and converters into a single file
Purpose is to try to have a single entry point when dealing with rating
values. Also fix incoherency introduced with odoo/odoo@32ba417549 where grades
are not coherent in all computation. This new computation seems better as
bad is now limited to <= 1 everywhere.

Task-2728564

Part-of: odoo/odoo#82792
2022-02-22 19:47:52 +00:00
Thibault Delavallée c04e0fa10a [MOV] rating: split rating mixin
It currently holds two different mixins. Let us split it into two files in
order to have a file per model. Also a quick reordering of rating model is
performed just to sort a bit things

Task-2728564

Part-of: odoo/odoo#82792
2022-02-22 19:47:52 +00:00
Aurélien Warnon b2e56259cb [IMP] survey: allow un-ticking choices
For surveys, we want to allow the end-user to un-tick an option he had ticked
before, for any kind of questions with choices (simple / multi-choices and
matrix).

e.g: You select an option but on second thoughts you're unsure it's the right
answer, you want to be able to remove your answer.

Especially if the question is not mandatory and you loose points if you don't
answer correctly.

Since the base browser behavior does not allow un-ticking a previously ticked
radio input, we have to play around a bit with specific classes.

Task-2727592

closes odoo/odoo#82272

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-02-22 18:29:31 +00:00
Adrien Widart 8a6ff86324 [FIX] stock: prevent useless SML creation in inventory mode
Some useless SMLs are generated when editing the on hand quantity in
inventory mode

To reproduce the issue:
1. Create a storable product P
2. Update its on hand quantity to 100
3. Inventory > Reporting > Inventory Report
4. On the line for P, update to quantity to 75
5. Inventory > Reporting > Product Moves, search for P

Error: There are two SMLs with a quantity equal to zero

Calling `action_apply_inventory` from the `write` is useless since the
method is already called in the inversed method of
`inventory_quantity_auto_apply`

OPW-2739833

closes odoo/odoo#85152

X-original-commit: c2164fba4a9049115a6a46de28a90fc779fb9eee
Signed-off-by: Arnold Moyaux <arm@odoo.com>
2022-02-22 17:11:09 +00:00
Adrien Widart 56719fc380 [FIX] stock: select dest location of a SML
On a SML, when setting the done quantity, the onchange may change the
destination location selected by the user

To reproduce the issue:
1. In Settings:
    - Enable "Storage Locations"
    - (Then, ensure "Storage Categories" is disabled)
2. Inventory > Operations Types, edit "Internal Transfers":
    - Enable "Show Detailed Operations"
3. Create an internal transfer IT:
    - From: WH/Stock
    - To: WH/Stock
4. Add a detailed operations to IT:
    - Product: anyone
    - To: WH/Stock/Shelf 1
    - Done: 1

Error: One the field "Done" is modified, the "To" changes and becomes
"WH/Stock". This location should not change (it should be
"WH/Stock/Shelf 1")

When setting the done quantity, an onchange recomputes the destination
location of the SML. To do so, it uses a initial location and searches
among its children. Here is the issue: when "Storage Categories" is
disabled, this initial location should be the one selected by the user.

OPW-2704665

closes odoo/odoo#85151

X-original-commit: 4202e46a8313fa9f1487d372ef0cb771f769be8d
Signed-off-by: Arnold Moyaux <arm@odoo.com>
Signed-off-by: Adrien Widart <awt@odoo.com>
2022-02-22 17:11:05 +00:00
Goffin Simon 39b15d6283 [FIX] sale_crm: Typo error
Introduced by https://github.com/odoo/odoo/commit/d675dbaa4c7174591e0e7c1a3caf3e76877312ce

opw:2746271

closes odoo/odoo#83853

X-original-commit: 02ef4bc1eb8479ba0a3faa6b6429fc18a54a592e
Signed-off-by: Simon Goffin <sig@odoo.com>
2022-02-22 17:11:01 +00:00
Ronald Portier f278589d2a [FIX] cli: support export of pot files
The export_translation method supports the "new language" option but
it was not possible if giving a .pot file.

closes odoo/odoo#85141

X-original-commit: 93e23025252784f39f37a7ffd109425ae56b1d36
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-02-22 16:16:40 +00:00
Antoine Guenet b8176448c3 [FIX] web_editor: ensure uploaded images in backend are not public
When uploading an image in the editor, we go through
`_attachment_create`, which sets the image to public if `res_model` is
`ir.ui.view` (the default if none was passed). Because of a wrong
reference to the editable DOM element (which contains the `res_model` as
data), when instantiating the media dialog, we were passing no
`res_model`. As a result, when saving an attachment, no `res_model` was
passed to `_attachment_create` and the attachment was made public.
Attachments in the backend should not be public and should be linked to
the proper model.

task-2759034

closes odoo/odoo#85132

X-original-commit: 5b664f0c04433091c3d6f85f245887d1808c308f
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-02-22 16:16:35 +00:00
Tiffany Chang (tic) f4fde9ec58 [FIX] mrp: allow adding byproducts to confirmed MO
Steps to reproduce:
- Create + confirm a MO
- Add a byproduct with a Produced (qty) > 1
- Change the `qty_producing` to a non-zero qty

Expected result:
  Byproduct's "Produced" qty stays unchanged and its "To Produce" is 0
Actual result:
  Byproduct's "To Produce" defaults to 1 and its "Produced" qty is
  updated to scale to the according to the amount `qty_producing` (i.e.
  if `product_qty` = 2 and `qty_producing` = 1, then by-product's
  "Produced" = .5

Additionally, a Missing Record error pops up because of missing
stock.move.line

Solution, don't allow byproducts added after MO is confirmed to default
to 0. Additionally allow byproducts to have 0 "To Produce" quantity and
don't sum the cost share of merged byproduct moves since when Produced
> To Produce then an extra move is created and the cost share ends up
being doubled during the merge.

closes odoo/odoo#85130

Task: 2716164
X-original-commit: 51ff14a56b909bdf22c9f1c4540347655578e1f4
Signed-off-by: Arnold Moyaux <arm@odoo.com>
Signed-off-by: Tiffany Chang <tic@odoo.com>
2022-02-22 16:16:31 +00:00
Bruno-brsy fdbbfd06d6 [FIX] account: bank suspense accounts
Step to reproduce:
- Install account_accountant
- Go to Accounting / Configuration / Accounting / Journals
- Create a Journals in Accounting
- Select a type as "Bank"

Issue:
Since this PR: https://github.com/odoo/odoo/pull/81071
The bank suspense account has been changed from "Current Liabilities"
type to "Current Assets", but isn't being correctly updated in
the journals view.

Solution:
In the domain of the "suspense_account_id", we should use
"data_account_type_current_assets" for the "user_type_id" instead  of
"data_account_type_current_liabilities"

opw-2715621

closes odoo/odoo#85105

X-original-commit: c16bc3192fe8ea033144c9cb6ab5b8c6db21d735
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Signed-off-by: Bruno-brsy <brsy@odoo.com>
2022-02-22 16:16:28 +00:00
Pouya Malekinejad b843407fed [IMP] models: small optimization in onchange
closes odoo/odoo#84865

Signed-off-by: Vincent Schippefilt (vsc) <vsc@odoo.com>
2022-02-22 16:16:24 +00:00
Vincent Schippefilt e5523f06ce [FIX] base: unique module name declared twice
before this commit, there was 2 unique indexes on module name
after this commit, only 1 unique index remains (the one declared in base/ir_module.py) to keep the error message

closes odoo/odoo#85116

Signed-off-by: Raphael Collet <rco@odoo.com>
2022-02-22 15:20:13 +00:00
Pierre-Yves Dufays 83c0e88e78 [FIX] event: improve attendee view by removing the default group by week
The default group by registration week has been removed in the attendee view  because:
- it makes the view impossible to use on mobile (too many columns)
- it makes the navigation on desktop a bit tricky

This reverts a change introduced in odoo/odoo@4bed87d.

Task 2761011

closes odoo/odoo#85113

X-original-commit: 7ebc86fd9202a0023513a2d4535f93a2d3914c1d
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-02-22 15:20:10 +00:00
Thanh Dodeur fb8f5169b2 [FIX] mail: prevent empty popover in the rtc call participant card
Before this commit, the popover containing the volume bar of the rtc
call participant card was rendered empty. This was because the `t-set`
was used instead of `t-set-slot`. This commit fixes this issue.

related to: https://github.com/odoo/odoo/commit/edd79ff560cf321ebd0488e4917abb7424fea1bb

closes odoo/odoo#85106

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-02-22 15:20:06 +00:00
Andrius Laukavičius 99b58cb48e [FIX] account: customer_rank/supplier_rank no copy
If partner is copied, it will copy customer_rank/supplier_rank and it
will be treated as such even though such partner has no references to
invoices for example.

closes odoo/odoo#85102

X-original-commit: c0161736db4f2415e6a44674d872bf8aa2972287
Signed-off-by: William André (wan) <wan@odoo.com>
2022-02-22 15:20:02 +00:00
Paolo (pgi) 2b784e1d59 [IMP] l10n_it_edi_sdicoop: Improving behaviour after MancataConsegna
In the B2B case, after a MancataConsegna, the invoice is considered
issued, but the delivery is failed.
In the B2G case, the Exchange System will retry to send it for 10 days
and inform the Public Administration. After 10 days, it will be
considered issued but not delivered.
In both cases of failure, the user is required to send the invoice
through other means than the Exchange System.

Ref (IT): https://www.datalog.it/fattura-elettronica-cosa-fare-in-caso-di-mancata-consegna

closes odoo/odoo#85100

X-original-commit: e8e08aba971cbf688b09f39cf3b3e4bc75641e84
Signed-off-by: Florian Gilbert <flg@odoo.com>
2022-02-22 15:19:58 +00:00
tsm-odoo 609890eaa4 [IMP] mail: update notification_type to match server's default
task-2767820

closes odoo/odoo#85095

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-02-22 15:19:48 +00:00
roen-odoo 0537c24f99 [FIX] pos_gift_card: giftcard popup text too long
Current behavior:
When using DE language in PoS. The text from giftcart popupbutton was tool long and was out of the button

Steps to reproduce:
- Change language to DE
- Open PoS and giftcard popup

opw-2744369

closes odoo/odoo#85090

X-original-commit: 28903717e2af5bbcb65e6be81ab0668d956ec659
Signed-off-by: Masereel Pierre <pim@odoo.com>
Signed-off-by: Engels Robin (roen) <roen@odoo.com>
2022-02-22 15:19:42 +00:00
Antoine Guenet 51c9629aa1 [FIX] web_editor: prevent traceback on apply style to empty lines
When the selection only contains empty lines, no text nodes are
selected. `applyInlineStyle` however counted on text nodes being
selected, resulting in a traceback.

task-2740204

closes odoo/odoo#85059

X-original-commit: ee6c71a3bcd6ec927acbe4eaf4c21acb28396e87
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-02-22 15:19:38 +00:00
Arthur Detroux (ard) 2e44cb41ea [FIX] website: fix editor not starting after creating a website
Commit [1] introduced an automatic start of edit mode when
selecting a theme but didn't take into account wether the frontend lang
of the user was matching that of the website that is supposed to enter
in edit mode.

Steps to reproduce:
- Create an empty database and install website.
- Add an extra lang on website (e.g FR) and visit the website in that
lang.
- Go in settings an create a new website, skiper the configurator,
  select a theme.
- Redirect is with enable_editor but nothing happens.

The editor isn't started if not in the source's lang.

This commit redirect the user to the default_lang of the website
so that editor can always be started. It also introduces a tour
to test out the flow.

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

task-2687416

closes odoo/odoo#85058

X-original-commit: 02e08af7278cd66d768fe6a4f23aa17eb816be3c
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-02-22 15:19:34 +00:00
Noe Antoine fe758ac69a [IMP] website_sale_slides: use total amount in course sales reporting
Before, there was a mismatch between the course's sales smart button
and the reporting it leads to. The amount shown is the total, taxed,
amount. Once in the reporting, the default measure is the subtotal,
untaxed.

This commit harmonizes both as well as course revenue reporting by
replacing the current default measure (price_subtotal) by the total
amount. This measure price_total is used in both graph and pivot views.

Task-2718756

closes odoo/odoo#83184

Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2022-02-22 15:19:27 +00:00
Patrick Hoste 6a67eb8ffa [IMP] website_event: improve tag visibility on frontend
PURPOSE:

Before this commit when they were a lot of tags they were all
displayed inline being hidden by the card size. This commit
fix this bug and display them nicely row after row.

LINKS

Task-2737156

Pr: odoo/odoo#83082
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2022-02-22 15:19:23 +00:00
Patrick Hoste b74ed97482 [IMP] event: order event tags by category sequence / own sequence
PURPOSE

Before this commit the tags were ordered only by their own sequence
making the display quite random when several tags had the same
sequence but belonged to different categories.
After this commit the tags are ordered by their category sequence
followed by their own sequence.

LINKS

Task-2737156
Closes: odoo/odoo#83082
2022-02-22 15:19:23 +00:00
std-odoo 4dbcefb5e5 [IMP] utm: ensure the uniqueness of the names of the UTM models
Purpose
=======
Ensure that the names of the UTMs models (campaign, medium and source)
are unique.

If not, generate automatically an unique name.

The name field is no more translatable; it makes no sense to translate
a technical which will be added in the URL, and can even cause issues
(the UTM record is not recognized because of the translation).

For the campaign, we keep a "translatable" name which is called
"title".

For the UTM source, use a mixin to generate automatically the name of
the source based on the content (_rec_name) of the record. So we remove
the override of create / write / copy in the different models and
ensure consistency between those models.

Task-2245823

closes odoo/odoo#60501

Related: odoo/enterprise#21882
Related: odoo/upgrade#1863
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2022-02-22 12:53:00 +00:00
William Braeckman dcf33627f5 [IMP] hr_holidays: add a test on accruals
This is a followup to odoo/odoo#3250 where a test for this case is
missing.

TaskId-2768450

closes odoo/odoo#85076

X-original-commit: 3d1f2f2d540a97506e0238f579199116aa8646dc
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-02-22 11:59:16 +00:00
Audric Onockx (auon) a51f49a61d [FIX] project : search in all without access error
Steps :
Install project and sale_project
Log in as portal > Tasks
Search bar > Dropdown > Search in All
Type anything and search

Issue :
Access Error : You cannot read sale_order_id.name, sale_order_id.invoice_ids.name,
sale_line_id.name, message_ids.body fields in task.

Cause :
We search in every field including those portal doesn't have access to.

Fix :
Add the domain of the rule of task to the search domain, so the search
only occurs on allowed fields.

opw-2762212

closes odoo/odoo#84934

X-original-commit: 7c2855e17a85af6609a705abe50e69720f9bad75
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-02-22 11:59:12 +00:00
Yannick Tivisse c6d1f71bf0 [IMP] hr: Allow plans to directly request signatures
closes odoo/odoo#84976

Related: odoo/enterprise#24577
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-02-22 09:41:54 +00:00
Thomas Beckers 96ee7317bd [FIX] project: translate 'assignee' for shared project with portal user
Issue :
In the kanban view related to shared project with portal user,
the term 'assignee' is not translated in the portal user language.

With this commit, this term will be translated based on the user language.

opw-2746504

closes odoo/odoo#85063

X-original-commit: 0231e1b78a3b377153c9d2e097b9d4aad9bc3b0d
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-02-22 08:46:48 +00:00
Alexandre Kühn 9e515155a6 [IMP] mail: turn "Chatter/attachmentsLoaderTimeout" into field
Task-2734101

closes odoo/odoo#85012

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-02-21 20:11:59 +00:00
Bruno Boi 030b1ba8d6 [REF] web: factorize some hotkey service code
- JS and DOM registrations are now shaped similarly,
  so this help to handle them with the same piece of code

- the keydown event object is now manipulated only in a single function,
  so it is clearer what it is used for and when it is eventually
  stopped or default prevented.

- some constants were converted from Sets to Arrays because they had
  no particular reason to be Sets.

closes odoo/odoo#84969

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-02-21 20:11:55 +00:00
Bruno Boi d2fc219d52 [FIX] web: protect key navigation in editable
Before this commit
The hotkey service was not taking into account that a new hotkey press
may have been triggered from an editable element.
This led to unwanted behavior, i.e. pressing ArrowLeft on an input
inside a sub Dropdown closed the sub Dropdown instead of navigating
through the text written in the input.

After this commit
The hotkey service now detects if the hotkey press was triggered from an
editable element (any input, textarea or other element with
[contenteditable=true] attribute) and does not dispatch this hotkey,
unless a candidate registered handler has explicitly asked to bypass the
editable protection. In that case, its callback will still get called.

task-2764821

Part-of: odoo/odoo#84969
2022-02-21 20:11:55 +00:00
Bruno Boi d48915e285 [FIX] web: dispatch an hotkey only once
Before this commit, the hotkey service will potentially
dispatch many time the same pressed hotkey.

After this commit, it will dispatch only to the newer
registrations or the first that match in the DOM.

task-2764821

Part-of: odoo/odoo#84969
2022-02-21 20:11:55 +00:00