Commit Graph
148627 Commits
Author SHA1 Message Date
roen-odoo e2b149f9da [FIX] pos_sale : PoS hardcoded terms
Current behavior:
In the PoS when you add an order the 2 terms "Settle the order" and "Apply down payment" where hardcoded in the code.

Steps to reproduce:
- Have PoS and Sale module installed
- Go in PoS
- Try to add an order sale
- The 2 terms are hardcoded and cannot be translated

opw-2754052

closes odoo/odoo#85168

X-original-commit: 440cd020cfce4147973d356fd714a5d78c315c70
Signed-off-by: Grazioso Andrea (agr) <agr@odoo.com>
Signed-off-by: Engels Robin (roen) <roen@odoo.com>
2022-02-24 11:26:53 +00:00
Josse Colpaert a270fc713d [FIX] account_edi_ubl(_bis3): OrderReference should refer to the PO of the customer
According to https://docs.peppol.eu/poacc/billing/3.0/syntax/ubl-invoice/cac-OrderReference/
the cbc:ID in the Order Reference should be the PO number of the customer.

closes odoo/odoo#84988

X-original-commit: cd4145366ae1b1401c3f8a9378ef00f8208c889f
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: William André (wan) <wan@odoo.com>
2022-02-24 11:26:50 +00:00
sofiagvaladze ae687dadc0 [FIX] hr_expense: to give report manager rights and make expense_line_ids editable
1) Now report manager (user_id) (with Team Approver rights) can't see the report.
Here we grant him the same rights as the manager (on employee app)
of the employee will have. Moreover, he can approve the report as well.

2) Purpose: accountant, manager, should be able to edit expense_line_ids
for expense report not only in draft, but also for submitted and approved states.

On the other hand, employee can only edit his expense report only in draft state.

task - 2768700

closes odoo/odoo#84978

Related: odoo/upgrade#3274
Related: odoo/enterprise#24579
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-02-24 11:26:43 +00:00
Martin Trigaux e3a7aa5bd0 [IMP] test_mail: add test for ce342f42f21cad3
Without ce342f42f21cad3 the new test fails because copying an
attachment requires write access to mail.template

closes odoo/odoo#85271

X-original-commit: d5ceaa13a36e86e97f14e870ade477f62234b304
Signed-off-by: Raphael Collet <rco@odoo.com>
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-02-24 10:15:55 +00:00
Xavier Morel 49af835e20 [FIX] base: attachment copy ACL
Currently, `Attachment.copy` has an *explicit* check for write access
on the underlying record.

This doesn't necessarily make sense e.g. a user copying an attachment
from a template to an email may not have write access to the template,
but that should not be an issue. And indeed if the copy is performed
"by hand" (read then create) things work fine[^1].

Since both `read` and `create` are checked, the explicit `copy` check
doesn't seem necessary. Drop it, and try to add some tests around
`copy`. Move `test_06_linked_record_permission` to its own `TestCase`
and split it for readability.

A secondary issue is that the `check` in `create` was performed in the
context of the `self` being copied, leading to the same issue as
`copy` being repeated (that is, `a.copy()` would call `a.create()`
which would call `a.check('write')`, even though we're semantically
creating a record from scratch). The behavior is really intended for
`write` where we want to check if we have `write` access to both the
"source" and the "destination" records.

Explicitly opt-out of having any source data in the `create` before
performing the `check` calls, this way we correctly and only check for
the writability of the destination, and only check for the readability
of the source.

issue 2746483

[^1] well not entirely true, see 4th paragraph

X-original-commit: 60723fb311ed7cc1cf901fe90e8745835cf4d54d
Part-of: odoo/odoo#85271
2022-02-24 10:15:55 +00:00
Philippe Wauthy 48d9b8b613 [IMP] hr_holidays: add tooltip on allocation_validation_type field of hr.leave.type
Since 15.0, the time off type can have different types of approval:
- No validation neededd
- Approved by Time Off Officer
- Set by Time Off Officer

This commit adds a tooltip on the allocation_validation_type to improve usability

task-2681288

closes odoo/odoo#85265

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-02-24 09:14:42 +00:00
Raf Geens 6f3cd5fd94 [IMP] cli: Set global neutralization parameter
This flag allows code to detect it's running on a neutralized database.

closes odoo/odoo#85259

X-original-commit: 892efa2c8b85b86155d50055dca568592569d411
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
Signed-off-by: Raf Geens <raf@odoo.com>
2022-02-24 07:17:52 +00:00
Raf Geens a4c2263afa [IMP] base: Disable cron toggle on neutralized databases
In some cases like `fetchmail.server` and `calendar.alarm`, modifying
the record can result in the corresponding cron job being enabled as a
side effect through `ir.cron.toggle`, even if it was archived before. In
`fetchmail.server`'s case on a neutralized database, this can result in
the cron job unintentionally affecting a production mailbox.

Since `ir.cron.toggle` is inherently risky on a neutralized database,
this PR disables it when an `ir.config_parameter` indicates we are on
one.

This parameter can be set both by the neutralization API introduced in
Odoo 15.2 and by legacy neutralization tools for older Odoo versions.

closes odoo/odoo#85258

X-original-commit: 4fba314faa1c8f67ac1dd93351ebf8ce39c5caf7
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
Signed-off-by: Raf Geens <raf@odoo.com>
2022-02-24 07:17:48 +00:00
Achraf (abz) edcbd4a196 [FIX] web: Star a product via sales form
For the moment we cannot star a product from the form of sales view

Steps:
    -Sales/Quotation
    - Create new quotation
    - Add a new product in the order lines
    - Open product form from External link
    - Try to star product

Because of the quickedit the onClick is called when it shouldn't,
the solution would be to rename the onClick function so that it
doesn't interfere with the quickEdit.

opw-2759063

closes odoo/odoo#85242

X-original-commit: edafd9fe49b1e4c73ee1768efc3df26b463b2f14
Signed-off-by: Achraf <abz@odoo.com>
2022-02-24 07:17:44 +00:00
Raf Geens 0a9f67c82a [REM] base: Remove cron code commenting
In neutralized databases, modifying records like `fetchmail.server`
re-activates the related archived cron job as a side effect, which
could impact production mailboxes. The initial solution to this was to
comment out the server action code linked to the cron job as an extra
precaution.

The impact of that solution is too broad, and it also means users have
to be aware of the need to uncomment the code if they do want a cron job
to run on a neutralized copy. It's been replaced by disabling
`ir.cron.toggle` instead:
https://github.com/odoo/odoo/pull/85192

closes odoo/odoo#85260

X-original-commit: 6c950959e1f4bed82d62796f0d89d82784e556b6
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2022-02-24 06:25:02 +00:00
Munaf BahelimandThibault Delavallée 8b2f887c29 [FIX] website_slides: better compute (dis)likes
In this commit we fix computation of likes and dislikes by splitting computation
by usage. Computation for likes and dislikes is improved to be done using a
read_group instead of browsing potentially a lot of slide.slide.partner records.
This should speedup computation, even if we have to do 2 read group instead of
a single big fetch. Indeed we have to take into account vote being 1 or -1 to
compute both values "like" and "dislike".

We also fix batch computation as it was sharing a dict. As frontend UI leads
to voting one slide at a time this should have few effect on stored values.
But now batch computation is correct.

User vote computation is now basically a related on user_membership_id.vote.
We keep the old compute method in case it was called but computation itself
is now done with the other field.

Task-2607416

closes odoo/odoo#85257

X-original-commit: c5b1283862264132d0c2bb1f172c25af5d74448c
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Co-authored-by: Munaf Bahelim <mub@odoo.com>
Co-authored-by: Thibault Delavallée <tde@odoo.com>
2022-02-23 22:04:48 +00:00
Dharmraj Jhala 5661641912 [FIX] website_crm_partner_assign: fix partner grades and activation sequence
Recently with commit[1], we changed the sequence for partner grades and
partner activations at db level (from asc to desc) to see the records
created with data files in our chosen order (for example Gold, Silver,
Bronze instead of Bronze, Silver and Gold).

However, there are several drawbacks with this approach. For example
during db upgrade, all the existing records needs to be adapted to
keep up the order of records created by data files.

This commit reverts change of order at db level, and instead adapts the
sequence of the records being created with the data files in a way that
they are still in the same order we wanted. And it will also maintain the
order of the records manually created by users after db upgradation.

commit[1] - https://github.com/odoo/odoo/commit/b28aae2

taskID-2765577

closes odoo/odoo#85235

X-original-commit: 5cc309744de5c2d5713d6bd95d02a66c21aaf11e
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-02-23 19:52:52 +00:00
rugo-odoo 86c394a93e [ADD] l10n_hu: update CoA
closes odoo/odoo#83234

closes odoo/odoo#85229

Related: odoo/enterprise#23696
Related: odoo/enterprise#24678
X-original-commit: 2adf6fa72e6ee34ea41f3628c5a1ffb0ffd0c92d
Signed-off-by: William André (wan) <wan@odoo.com>
2022-02-23 17:12:49 +00:00
Samuel Degueldre 5cea16ab7e [FIX] web: do not crash when attempting to consume a tour
Previously, when completing the last step of a tour by hand, the tour
manager attempts to make an RPC to consume the tour in the backend. This
used to crash with an error saying parent._trigger_up is not defined.
This was caused by the root.widget, which is the tour manager parent,
not being a real instance of ComponentAdapter, but an object created
with the ComponentAdapter as it's protorype. To give it access to
_trigger_up, it should be created with the ComponentAdapter's prototype
as its prototype, but this would still fail as it wouldn't have the
correct environment containing the rpc service.

The simple solution is to create a real instance of the ComponentAdapter
by hand. Although owl 2 does not support instanciating components by
hand and mounting them later, we will never mount this component or use
any of its owl features, we are simply using it to replace what used to
be the ServiceProvider in legacy.

closes odoo/odoo#85221

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-02-23 16:07:59 +00:00
tsm-odoo a7835ff436 [IMP] mail: make m2x user tests use start instead of createWebClient
task-2767820

closes odoo/odoo#85066

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-02-23 16:07:55 +00:00
Samuel Degueldre 6daa2d01b7 [IMP] web, *: use MutationObserver to neutralize image src in tests
*: mail, mrp

Previously, to prevent images and iframes from making  GET requests in
tests, we would listen for the DOMNodeInserted event. This event is
deprecated and should not be used. Additionally, we weren't listening
for attiribute changes for performance reasons, which would result in
some GET requests still being made when an src attribute was changed.

This commit changes the mechanism that is used to do this from mutation
events to a MutationObserver which is not deprecated, and now also
listens for attribute modifications as MutationObservers can be
configured to only listen for changes to certain attributes, greatly
alleviating the performance impact of listening for those.

This mechanism has also been enabled globally by doing it once in the
test setup code, instead of requiring one to call a specific helper, as
we never want to make real requests during tests.

Some tests have been adapted to this new behaviour.

closes odoo/odoo#85216

Related: odoo/enterprise#24665
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-02-23 15:07:59 +00:00
Touati Djamel (otd) ba85494235 [FIX] uom: keep the current factor instead of setting it to 0
Steps to reproduce the bug:
- Create new UOM categories
- Add a new reference UOM
- Add another line, for example:
    - type: “Smaller than the reference”
    - Ratio: 4
- Click outside the line

Problem:
The type is changed to “Bigger” and the ratio is reset to 0,
because we are trying to change the type and the factor based on the value of the current uom factor,
but as this factor has not yet been calculated in `set_ratio` the changes will be distorted.

This part of the code in the onchange is useful when for example we already have a UOM category saved,
and we change the reference, in this case all the UOM will have to be calculated again

Solution:
Don't change the factor and the type in the onchange if it's a new line

opw-2754303

closes odoo/odoo#85214

X-original-commit: daf0dd44345de9877e2e79035d05ddca6c19064b
Signed-off-by: Arnold Moyaux <arm@odoo.com>
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
2022-02-23 13:58:12 +00:00
oco-odoo f3dde80a69 [FIX] account: tax adjustment wizard: use the company's fiscal country instead of address country to filter available tags
Introduced by 950b0ae88d

closes odoo/odoo#85213

Signed-off-by: William André (wan) <wan@odoo.com>
2022-02-23 13:58:08 +00:00
Géry Debongnie 649c037ab0 [IMP] web: update owl to last version
closes odoo/odoo#85197

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-02-23 13:58:00 +00:00
Yannick Tivisse 07faeeacd6 [IMP] hr: Fix duplicated div name to allow inheritence
closes odoo/odoo#85202

Related: odoo/enterprise#24597
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-02-23 13:57:55 +00:00
Julien Castiaux 66b691dc32 Revert "[FIX] website: remove force prefetch for translate fields"
This reverts commit a1a30f52a3.

closes odoo/odoo#85199

Related: odoo/enterprise#24660
Signed-off-by: Julien Castiaux <juc@odoo.com>
2022-02-23 12:59:52 +00:00
Julien Castiaux 66a3a409eb Revert "[FIX] event: remove prefetch=True"
This reverts commit 8dda03228e.

Part-of: odoo/odoo#85199
2022-02-23 12:59:52 +00:00
Julien Castiaux e655e8da8a Revert "[IMP] base: add prefetching group feature"
This reverts commit 041fe5e21e.

Part-of: odoo/odoo#85199
2022-02-23 12:59:52 +00:00
Julien Castiaux 7534358351 Revert "[IMP] base: make recompute faster"
This reverts commit 59ea46c97e.

Part-of: odoo/odoo#85199
2022-02-23 12:59:51 +00:00
Andrea Grazioso (agr-odoo) 073933ab01 [FIX] mrp: merge SFP for 2 different MO
Set the warehouse with manufacturing 3 steps
Create a BoM with a Components that use a Sub BoM
Set Both product MTO + Manufacture
Create a MO
You have only 2 picking for the first MO with the SFP
that contains both the finished product and the intermediate
component. However they are created and moved at two different times
since you could not create the finished product withtout the
component, so there is no meaning to put them both in the same picking.

It happens because the _assign_picking will merge moves with the same
procurement group. In our case, it's the wanted behavior to have the
2 differents SFP linked to the same MO.

The idea between the fix is:
- We want to have the pick components picking merged.
- We want to have the store components split since they come from
different MO
So we create the different procurement groups during the _run_pull with
the picking type of store finished product. This way the pickings won't
be merged during _assign_picking

We will also propagate those groups to the newly created MO in order to
keep the picking type sequence and correct name.

FW PORT of
https://github.com/odoo/odoo/commit/bcfa03821b92bf52675db0e3b54d3cb19dfe3087

opw-2585525

closes odoo/odoo#85195

X-original-commit: a647e680a196f7e6d9147d51dd80f8c31e0e741b
Signed-off-by: Arnold Moyaux <arm@odoo.com>
Signed-off-by: Adrien Widart <awt@odoo.com>
2022-02-23 12:09:02 +00:00
Josse Colpaert c690c674a4 [FIX] l10n_pe: street_name and street had wrong edit/read only class
Before, if you would put Peru Street 23, it would put Peru in House number.
This is because the editable field was the street field, so behind the scenes,
Odoo will split it and according to the standard format without country,
this means Peru will go into House.

We tried first with a change inversing it, but as we are doing the change,
the best thing is to remove the split all together.  We added also onchange
logic that if you put a district it would automatically put the right city.

City or city_id should depend on the country and is correctly inherited by a
fields_view_get.

Task 2724531

closes odoo/odoo#85194

X-original-commit: 47cd0b51fb60cebb88e3a84b7e332e1ff800b0a8
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Josse Colpaert <jco@odoo.com>
2022-02-23 12:08:57 +00:00
Nicolas (vin) 9983fa064a [FIX] account: call _onchange_price_subtotal on demo data
The demo data created by account did not call _onchange_price_subtotal
on the created account_lines, making the total debit
and credit not matching the state of the lines.

closes odoo/odoo#85188

X-original-commit: 403939ea7b460b95cc31993613f5cba5f5fefcfa
Related: odoo/enterprise#24651
Signed-off-by: Olivier Colson <oco@odoo.com>
Signed-off-by: Nicolas Viseur <vin@odoo.com>
2022-02-23 11:00:48 +00:00
Nicolas (vin) e8063c6657 [IMP] account: journal audit improvement
Improve the journal audit report by adding information about impacted
tax grid for each computed journal.

Task id #2658937

X-original-commit: 09848ba2ae5bd0f25c20a20e73089a5a0f1c8f74
Part-of: odoo/odoo#85188
2022-02-23 11:00:48 +00:00
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