Commit Graph
153845 Commits
Author SHA1 Message Date
Audric Onockx (auon) 2d0e0bff45 [FIX] project: display partner_id dropdown
Steps :

In a ONE company environment,
\- Go to Project Task list view.
\- Display 'Customer' column.
\- Select multiple records (multi-edit).
\- Click on a 'Customer' cell to display the dropdown list.

Issue :
Traceback : company not found.

Cause :
partner_id's domain refers to company_id,
which is not present in the vue if not in multicompany.

Fix :
Add it in ivisible.

closes odoo/odoo#98913

Signed-off-by: Xavier <xbo@odoo.com>
2022-08-26 05:40:10 +02:00
Adrien Widart 4ee5df7660 [FIX] sale_mrp: decrease kit quantity after the delivery
When decreasing the SOL qty, if the SOL product is a kit and if the kit
has already been delivered+returned, an additional and useless return
will be created

To reproduce the issue:
1. Create two products consumable products P_kit, P_compo
2. Create a bill of materials:
    - Product: P_kit
    - Type: Kit
    - Components: 1 x P_compo
3. Create and confirm a sale order SO with 4 x P_kit
4. Process the delivery
5. Process a return with 1 x P_compo
6. Edit SO:
    - Quantity: 3 (instead of 4)

Error: once the SO is saved, a second (and useless) return will be
created

When updating the SOL quantity, we try to adapt the pickings. To do so,
we first get the quantity that is currently in delivery, then we compute
the difference between that quantity and the new SOL qty. Eventually, we
create a procurement based on that difference.
https://github.com/odoo/odoo/blob/e11dfa341baf82fedee753502aef5ef2972f75cb/addons/sale_stock/models/sale_order.py#L553
https://github.com/odoo/odoo/blob/e11dfa341baf82fedee753502aef5ef2972f75cb/addons/sale_stock/models/sale_order.py#L573-L578

In case of a kit, the "in delivery" quantity is too simply computed: we
return the old SOL qty (see diff). So, in the above case, we have:
- In delivery : 4
- New sol qty : 3
- Difference : -1

That's the reason why a new return is created, to fulfill the
difference.

We could apply a smarter computation of the "in delivery" qty thanks to
a mix between the computation of the delivered quantity of a kit:
https://github.com/odoo/odoo/blob/e85de8f2d342ac1e69d8eb4020dbb2d4c69ad90b/addons/sale_mrp/models/sale.py#L111-L118
and the way we compute the "in delivery" quantity for a non-kit product:
https://github.com/odoo/odoo/blob/e11dfa341baf82fedee753502aef5ef2972f75cb/addons/sale_stock/models/sale_order.py#L501-L504
https://github.com/odoo/odoo/blob/e11dfa341baf82fedee753502aef5ef2972f75cb/addons/sale_stock/models/sale_order.py#L511-L515

Note: if the kit has several components, and if the user does not return
an entire kit, a similar issue will occur. That's the reason why this
commit solution is smarter than the current code but is not the
smartest. For such a use case, we would need a bigger
solution/refactoring (handle the components one by one instead of the
kit for the quantities and the procurements)

OPW-2917209

closes odoo/odoo#98899

X-original-commit: 9649e1031df60c5ba60424e9fbcf7187f6783b5c
Signed-off-by: Tiffany Chang <tic@odoo.com>
Signed-off-by: Adrien Widart <awt@odoo.com>
2022-08-26 05:40:04 +02:00
Sébastien Theys 4b2bd7b16f [FIX] mail: fixes various issues introduced by recent changes
- fix typo in model manager: "return" -> "continue" in loop
- fix typo in model field: "models" read from record not from field itself
- fix reading obsolete fields in message view
- move listeners on records directly rather than storing a map on model manager
  (code a bit easier to read, and issues on deleted records easier to debug)
- remove obsolete trigger of listener in _created (not possible to observe a
  record before it exists)

closes odoo/odoo#98892

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-08-26 03:43:22 +02:00
Alexandre Kühn 14f2a03c75 [FIX] im_livechat: guard Chatbot/data (i.e. chatbot being available)
Task-2962136

closes odoo/odoo#98848

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-08-26 03:43:20 +02:00
Alexandre Kühn 357b4437f7 [FIX] website_livechat: introduce Visitor/serverCountry
Fixes a traceback due to Visitor/country being a computed field
that is imperatively updated by server data.

Task-2962126

closes odoo/odoo#98847

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-08-26 03:43:17 +02:00
Odoo's Mergebot 2dd7c57c04 [MERGE][PRF] mail, various: improve performance of activities
PURPOSE

Improve performance of activities creation and management. Improve overall
code.

SPECIFICATIONS

Main code changes are
  * classify activities by model, to browse related records in batch per model
    instead of one by one;
  * rewrite create and _action_done main methods to be done in batch;
  * skip useless computation (use categories before browsing records, avoid
    useless ref / direct xml ID check, ...);
  * globally batch when possible;

See sub commits for more details.

LINKS

Task-2884301 (Voip synchronization simplification)
Task-2883589 (Activity creation performance)

closes odoo/odoo#93682

Related: odoo/enterprise#28421
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-08-26 03:43:01 +02:00
Thibault Delavallée 8f5943269f [PRF] test_mail: update counters
Update counters after all previous performance commits. It is done as a single
update due to frequent conflicts and difficulty to keep updated counters for
each commit separately.

Task-2883589 (Activity performance and cleaning)

Part-of: odoo/odoo#93682
2022-08-26 03:43:00 +02:00
Thibault Delavallée 846d66ae9d [PRF] mail: improve check assignment by doing it in batch
When assigning activities to people we check target user has the rights to
access to document. Otherwise they end up with notifications and activities
for records they can't see.

This code is currently a loop doing browse and access checks one record
at a time. We improve it by grouping activities by related record model
and target user, allowing to batch some calls.

Note that this somehow reverts odoo/odoo@c38a0d6768 and odoo/odoo@a98c15f443
as normally odoo/odoo@16351e4879 should be sufficient to handle MC use
cases. Lack of clear unit tests for those corner cases make it difficult to
clearly reproduce issue anyway.

Task-2883589 (Activity performance and cleaning)

Part-of: odoo/odoo#93682
2022-08-26 03:43:00 +02:00
Thibault Delavallée 33d7ea6fb8 [PRF] mail: improve performance of closing activities
MailActivity model has an ``_action_done`` method that is quite heavily
used and overridden. It notably posts messages, create next activities but
also has some specific behavior depending on category.

Purpose of this commit is to improve code of this method to avoid useless
queries, improve performance, and rethink the computation with batch in
mind.

Task-2883589 (Activity performance and cleaning)

Part-of: odoo/odoo#93682
2022-08-26 03:42:59 +02:00
Thibault Delavallée 17b8d7062c [PRF] mail: improve batch creation of activities
Purpose of this commit is to improve batch creation of activities by trying
to group checks by user and/or model when possible.

Notably

  * subscribe partners in batch when several activities are assigned to the
    same user (use case: batch assign on leads, users may be assigned on
    several records in a single udpate);
  * check in batch access on partners;

Task-2883589 (Activity performance and cleaning)

Part-of: odoo/odoo#93682
2022-08-26 03:42:59 +02:00
Thibault Delavallée 115f5663f1 [PRF] mail, note: improve default activity type computation and remove useless ref
Change some ``ref`` to low level method ``_xmlid_to_res_id``. The latter one
does not call exists, which allows to gain one query that we do not need
here.

Default methods on activity / activity mixin to find the default activity
type (todo, model-based, generic) are cleaned. Notably code was duplicated
between mixin and activity, it now always call the same code.

Remove an unnecessary ref, probably a leftover of new rendering methods on Qweb.

Remove an unnecessary sudo.

Task-2883589 (Activity performance and cleaning)

Part-of: odoo/odoo#93682
2022-08-26 03:42:59 +02:00
Thibault Delavallée 9aa934e683 [PRF] mail: send activity bus notifications in batch
No need to send bus notifications one by one, we may use sendmany. Various
activities crud methods send notifications, better group them when possible.

Task-2883589 (Activity performance and cleaning)

Part-of: odoo/odoo#93682
2022-08-26 03:42:59 +02:00
Thibault Delavallée 0a380fec77 [PRF] mail: create activities in batch in activity mixin
Improve performance by batching activities creation through the mixin. This
helps saving some queries.

Task-2883589 (Activity performance and cleaning)

Part-of: odoo/odoo#93682
2022-08-26 03:42:58 +02:00
Thibault Delavallée 3aa938cc05 [IMP] mail: add helpers to order/group activities
Purpose is to add helpers on activity model, notably to ease batching based
on models. As activities are linked to records using a res_model / res_id
pair most code is not optimized (checking records one by one). Purpose of
this tool is to ease doing computation by batch of models.

Task-2883589 (Activity performance and cleaning)

Part-of: odoo/odoo#93682
2022-08-26 03:42:58 +02:00
Thibault Delavallée 6bea3c7605 [IMP] mail: return generated records in mail composer
We now return generated records when calling ``_action_send_mail`` on mail
composer. This allows to have access to generated emails (in mass mode) or
posted messages (in comment mode). Otherwise we have to access sub-fields
like activity_ids / message_ids, which may be inefficient or generate extra
ACLs checks.

Also replace some |= with += when usage of OrderedSet is not necessary. To
keep ordering, ordered sets are used when doing an or between record sets.
However in some cases we know we are simply adding records not already in
a previous record set, meaning we can just use +.

Task-2883589 (Activity performance and cleaning)

Part-of: odoo/odoo#93682
2022-08-26 03:42:58 +02:00
Thibault Delavallée 3cc931ef58 [IMP] mail: add helper to find customer partner on thread
Purpose is to use it notably in Voip where we link activities / phonecalls
to partners when possible. Future commits will use it more often in thread
methods.

Method to have the primary email is moved with that helper method in a sub
section, in order to have "model" helpers in the same section. Its code is
also simplified and fixed (return missing). Its name is made coherent with
other naming in the file.

Task-2884301 (Voip activity synchronization simplification)

Part-of: odoo/odoo#93682
2022-08-26 03:42:58 +02:00
Alexandre Kühn f5304e4c80 [FIX] im_livechat: remove imperative update of Chatbot/state
Task-2961956

closes odoo/odoo#98817

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-08-26 01:55:39 +02:00
Raphael Collet 07744c64e9 [FIX] core: in ir.model.fields, discard deleted fields from registry
This patch discard the fields to delete from data structures like field
triggers, field inverses, and fields to compute.

This is quite useful when uninstalling modules.  This commit fixes the
uninstallation of modules base_setup, bus, mail, web_tour.

closes odoo/odoo#98668

X-original-commit: 49398a769b2ec4965bf148f10b5e13d0a6c1acff
Signed-off-by: Raphael Collet <rco@odoo.com>
2022-08-25 22:46:04 +02:00
william d92a8b5ffd [IMP] web: continue to edit lists when editable=top
Previous behavior
================

When `editable=bottom`, when we hit tab until the end of the line, the
user starts to create a new record.
But when `editable=top`, when hitting tab multiple until the end of the
line, the user starts to edit the first line that was existing before
instead of creating a new one.

New behavior
============

The behavior is consistent between both cases: the user can always
continue to edit lines one after the other.
The behavior for `editable=bottom` is not changed, but `editable=top`
continues to add lines on top one of each other.

linked to task-2879904

closes odoo/odoo#98603

Signed-off-by: Georis François (fge) <fge@odoo.com>
2022-08-25 22:46:00 +02:00
Xavier BOL (xbo) 8d46e54c96 [IMP] project: externalize getFirstElementForXpath in test utils file
Before this commit, the `getFirstElementForXpath` function is used in
the unit test for the burndown chart. This function is used to select a
HTMLELement with xpath expression and could be used outside the unit
test of the burndown chart.

This commit externalizes this function in a project test utils JS file
to use this function in another unit tests file if needed.

task-2924268

closes odoo/odoo#97574

Related: odoo/enterprise#30173
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-08-25 19:57:32 +02:00
Alexandre de Pape (alpa) 2e4a225fb4 [IMP] websale_stock: back in stock notification
This commit adds a message "Be notified when in stock" on a product when it is out
of stock. When clicking the message, a form appears where the user can enter
his email. If he is a logged user, the email associated to the partner of the
user is pre-filled in the form. Otherwise the user enters his email.

task-id 2806828

closes odoo/odoo#96633

Related: odoo/upgrade#3718
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-08-25 19:57:26 +02:00
Odoo's Mergebot 55ab08904e [MERGE][IMP] mail, rating: delay rating request sending
FUNCTIONAL ISSUE

When they receive a rating request email, customers can click on this email to
pick a satisfaction level. However, this feedback is currently effectively
posted only when customers submit the feedback form.

Many customers do not go that far in the process and just close that form. This
means that while the feedback is caught and stored in DB nothing is posted and
users are not notified of this rating.

PURPOSE

When the customer clicks on an emoji, post a message in the chatter without
launching notifications. After 2 hours notify followers. If before this delay
the customer fills in the form, update the post content (new face, feedback)
and launch notification process with the feedback (inbox, emails, ...).

By default, the user has 2 hours to fill the feedback, after those 2 hours
we notify the message containing only the first rating without feedback.

TECHNICAL

Currently, rating from email (route with token) is the following

  * Customer receives an email;
  * Customer clicks one of the smiley face that redirects to a ``/rate`` route
    with the token and rate value;
  * the linked ``rating.rating`` record is updated and set consumed;
  * Customer may change its face and add a feedback. In that case a message
    is posted with the rating face in it;

Issues raised by this

  * first rating update does not notify anyone, no message is posted;
  * if Customer does not give a feedback, process is stuck at that point;
  * the rating is not really linked to the posted message (see ``message_id``
    field of ``rating`` record);

Fix that issue to have message directly at beginning of the flow and improve
log and notifications. Update ``rating_apply`` to post the message and update
it when feedback is given.

Allow to delay sending of notifications using a ``mail.message.schedule``
queue model that stores when to launch the notification process for a given
message.

See sub commits for more details.

LINKS

Task-2826699 (Mail: use datetime for scheduled_date mail field instead of char)
Task-2207626 (Rating: Log ratings, post feedbacks)

closes odoo/odoo#95623

Related: odoo/enterprise#29268
Related: odoo/upgrade#3669
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-08-25 19:57:18 +02:00
Thibault DelavalléeandAdrien Dieudonné 22c3cc51ed [FIX] rating: fix bootstrap and styling of rating email and pages
Rating page is broken since migration to bootstrap5. This commit fixes various
issues linked to btn-group, display and usage of group checkboxes. Overall
html structure is cleaned and bootstrap 5 rules are applied.

Some small display improvements are also applied to the rating email.

Task-2207626 (Rating: Log ratings, post feedbacks)

Part-of: odoo/odoo#95623
Co-authored-by: Adrien Dieudonné <adr@odoo.com>
2022-08-25 19:57:17 +02:00
std-odooandThibault Delavallée 6ebb72332e [IMP] rating: improve rating notification with delaying until feedback
Purpose
=======

When someone receives an email with a rating request, he can click on a
smiley. But if he does not write a feedback, nobody is notified. This means
some rating as somehow lost and people are not notified of it.

Specifications
==============

Now, when the user clicks on the smiley, a message is posted but notifications
are not yet sent. This uses the new ``mail.message.schedule`` mechanism added
in this PR. It gives the user some time to write their feedback and send it.

If they write and submit a feedback, the notification process is launched.
Emails and inbox notifications are created and sent.

If they don't write a feedback notification process is launch after 2 hours.

Testing
=======

Some cleaning is done in tests, notably to split some fields tests from
performance test. A bit performance test is also split into sub tests in
order to better understand queries.

Task-2207626 (Rating: Log ratings, post feedbacks)

Part-of: odoo/odoo#95623
Co-authored-by: Thibault Delavallée <tde@odoo.com>
2022-08-25 19:57:17 +02:00
Thibault DelavalléeandStéphane Debauche c5afd7c30f [IMP] mail: allow to update scheduled date of notifications when updating content
Purpose of this commit is to allow to update the scheduled date when using
``_message_update_content`` tool method. This allows notably to delay the
sending of notifications in some cases, then send it once all content is
updated according to business requirements.

When giving a scheduled date in kwargs

  * either it is set, and we update message schedulers accordingly;
  * either we force a void value, which means notification should be done
    now and we trigger the schedulers for immediate sending;

Task-2207626 (Rating: Delay rating notification to ease feedback)

Part-of: odoo/odoo#95623
Co-authored-by: Stéphane Debauche <std@odoo.com>
2022-08-25 19:57:17 +02:00
std-odooandThibault Delavallée 9b11a9d82b [IMP] mail: schedule emails and notifications
Purpose
=======

Currently, only email sending can be scheduled with the `scheduled_date` field
defined on on <mail.mail>. It's not possible to delay the sending of
notifications.

We want to be able to delay the sending of the emails, but also the inbox
and bus bus notifications.

Technical
=========

For that purpose, we created a new model which stores the message we need to
notify with the scheduled date. When a scheduled_datetime is given we skip the
notification process. Instead an entry in that new model is created. A cron
regularly polls the scheduled message and launch the notification process on
messages that are ready to be sent.

Task-2207626 (Rating: Delay rating notification to ease feedback)

Part-of: odoo/odoo#95623
Co-authored-by: Thibault Delavallée <tde@odoo.com>
2022-08-25 19:57:16 +02:00
Stéphane Debauche aed52f3e0a [IMP] mail: correctly support scheduled_date from template when sending emails
Purpose of this commit is to correctly generate and support scheduled date
defined on template when using ``send_mail`` tool that send emails directly
from a MailTemplate.

It uses the parsing tool method defined on mail.mail in order to have a
datetime localized in UTC then set timezone agnostic as expected by the
ORM.

Task-2826699 (Mail: use datetime for scheduled_date mail field instead of char)

Part-of: odoo/odoo#95623
2022-08-25 19:57:16 +02:00
std-odooandThibault Delavallée eb75a77646 [REF] mail: update the message content in the mail thread model
Purpose
=======

Move the code which updates the mail message from the message model to mail
thread. Most other thread methods (like `_message_update_content_after_hook`)
are defined at record model level. It makes sense to delegate the update to
documents and not to the message. Message is a low-level technical object
that should not really hold business code.

While modifying this code, an update is done in the update content. We now
also allow to update the body without removing all attachments.

Finally tests are added as this feature was added without really testing
model code.

Task-2207626 (Rating: Delay rating notification to ease feedback)

Part-of: odoo/odoo#95623
Co-authored-by: Thibault Delavallée <tde@odoo.com>
2022-08-25 19:57:16 +02:00
std-odooandThibault Delavallée cd5850d83d [REF] mail: use a datetime instead of a char for the mail scheduled date
Purpose
=======

Historically, we use a char field on the <mail.mail> to match the field type
on the <mail.template>. But even it's useful to have a char field on the mail
template (which can contains QWeb code or Jinja previously to Odoo 15.0) it is
not that useful for the <mail.mail> to keep this char type, because the value
is already rendered. Moreover this forces to have some code convert and store
datetime values using the standard format and in UTC.

We now correctly use a datetime field, as all other fields of that kind in
Odoo.

Task-2826699 (Mail: use datetime for scheduled_date mail field instead of char)
Prepares Task-2207626 (Rating: Delay rating notification to ease feedback)

Part-of: odoo/odoo#95623
Co-authored-by: Thibault Delavallée <tde@odoo.com>
2022-08-25 19:57:15 +02:00
Laurent Smet bedf191134 [IMP] account,l10n_*: Set 100 as default value for factor_percent in tax repartition lines
closes odoo/odoo#94125

Related: odoo/enterprise#28648
Related: odoo/upgrade#3695
Related: odoo/documentation#2557
Signed-off-by: Laurent Smet <las@odoo.com>
2022-08-25 19:56:56 +02:00
oco-odoo b7232b14b7 [IMP] account, l10n_*: Introduce unified reporting engine
This commit adapts account's model to the new report engine introduced for v16, and updates the data files accordingly.

account.report model is now declared in community, together with the other models used by the reporting. This is done so that the tax tags can properly be created by the tax report and used on tax templates. All the actual computation logic stays in enterprise.

See enterprise commit for full details.

Task 2524389

Part-of: odoo/odoo#94125
2022-08-25 19:56:55 +02:00
Pratik Raval bb24757d08 [IMP] crm: detect leads based on similar phone/mobile number
Currently, the 'similar lead detection' mechanism only considers email,
contact name, and partner name while finding duplicate leads in CRM.

After this commit, it will also consider the mobile/phone number for
the same. Note that the mobile numbers and phone numbers both will be
matched with each other while finding duplicate leads.

Task-2817884

closes odoo/odoo#88372

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-08-25 19:56:48 +02:00
MerlinGuillaume 4ffde5b8b9 [FIX] web: use different hotkeys for 'ADD' and 'SAVE' buttons
A modal using the 'ADD' and 'SAVE' buttons will have the same keyboard
shortcut for both of these buttons

Steps to reproduce:
1. Install Inventory
2. Go to Inventory > Operations > Transfers and open a transfer with a
contact and in status 'Ready'
3. Click on 'EDIT' and open the contact in the Delivery Address with the
quick edit button
4. Push on 'Alt' key: the 'ADD' and 'SAVE' buttons use the same shortcut

Solution:
Modify the current hotkey used for button 'SAVE'

opw-2954146

closes odoo/odoo#98884

X-original-commit: 0f8d28269f4900e70d7fefbb359580390656cdf7
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Guillaume Merlin (megu) <megu@odoo.com>
2022-08-25 18:25:22 +02:00
Adrien Dieudonné 137445164b [FIX] website: removes BS5 dropdown from searchbar
This commit partially reverts https://github.com/odoo/odoo/pull/98254/
in which we use the correct toggle attribute.

The problem is that this part is customized and the DOM is not as
expected by Boostrap (BS5 seems more strict than before).

Because of this, we consider that we shouldn't use Bootstrap's dropdowns
(the js part) for this case but we want to keep the same design.
To do so, we simply replace the class name by a custom one to prevent
BS from accessing it and we apply an @extend to keep all the css rules.

Because @extend could be costly in terms of performance, we did some
analysis:
* +3kB for the css frontend assets bundle.
* No significant change for the bundle Generation time:
  [1.66sec - 2.93sec] vs [1.71sec - 3.31sec]
  (quite difficult to analyse due to the number of variation)

Note that we already have this @extend in the backend and we could have added
this in asset common but we didn't as it will soon be deleted from the backend
(we will use our own dropdowns).

Steps to reproduce:

Go to shop page.
Type "desk" in the search input.
The suggestion popup appears.
Click outside the field. (e.g. to the left of it)
Click on the search field.
=> An error popup was displayed.

closes odoo/odoo#98756

Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
2022-08-25 17:02:52 +02:00
Florian Charlier b542ceec63 [FIX] website_slides: fix embed-over-nav overlap
The `ratio` class used for embeds creates a static context.
Using `position: relative` for the subsequent element makes sure it doesn't
end up 'under' the embed on large viewports sizes.

For simplicity, we chose to not test for the actual presence of an embed
or window size before applying position-relative on the next div.

Task-2663320
Part of odoo/odoo#79615

Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2022-08-25 14:24:53 +02:00
Florian Charlier db7c9ba7c5 [IMP] tools, website_{*}: increment multiple fields at once
* = blog, forum, slides

For performance reasons, allow to increment multiple fields of the same record
within the same query.

With python tests.

Task-2663320
Part of odoo/odoo#79615
2022-08-25 14:24:53 +02:00
Florian Charlier e3389e392e [IMP] website_slides: Improve frontend UI
The layout of slides needs a little freshening-up.

### Comments and slides

* The ratings are only showed once, and only for "documentation" contents
* Indications of why the user cannot post a comment are added (signing up,
  Karma, commenting not allowed), and the portal template is not called if
  there is no comment and commenting is not allowed (for user or course).
  In addition, the "Comment" tab is never hidden anymore, to not hide
  the available/activate-able features.
* Detailed view statistics are now shown only to selected users.
* Slide public views represent views by the public and all users that
  are not members of the course.
* When channel/slide images are not set or inaccessible, a default image
  is used (instead of plain background or unauthorized requests).
* These images are now editable on frontend.
* The 'Additional Resources' subtitle is hidden from the detailed slide view
  for invite-only courses as nothing else was shown with it.

### Misc.

*  This commit also fixes the "unresponsive" `total_views` count after public
views, by manually incrementing it too. This is required because `public_views`
is directly updated via SQL query and does not trigger model _computes.

* We also adjusted the test in survey that used a public user while in all
cases users must be logged-in (and therefore get portal privileges) before
they can participate.

Task-2663320
Part of odoo/odoo#79615
2022-08-25 14:24:52 +02:00
Bruno Boi ec70294e64 [FIX] web: invalid kanban record quick_create stays open
- Before this commit
Validating an invalid kanban record on quick creation
would leave the quick creation mode.

- After this commit
Validating an invalid kanban record on quick creation
will stay in quick creation mode, indicating which fields are invalid.

closes odoo/odoo#98874

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-25 12:05:47 +02:00
luvi 67b41d47e6 [FIX] im_livechat: add w-auto on layout colors fields
In commit 0194fa8236144596042a20f182ec3f48ea29b998, we fixed
the appearance of the color list in the livechat channel view.
But w-auto classnames were not added to some fields, which let
the positioning issues only partially fixed.

This commit concludes the fixed introduced in #98755.

closes odoo/odoo#98871

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-25 12:05:43 +02:00
luvi c8c34b7e0e [REV] project: revert changes in template
This commit reverts changes that are no longer
necessary since PR #98711 which fixed a lot
of issues regarding styles and alignments.

closes odoo/odoo#98867

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-25 12:05:40 +02:00
FrancoisGe 2e23ac138d [FIX] web: debug menu view metadata
Before this commit, in a legacy view, clicking on debug menu
"View Metadata" causes a crash.

closes odoo/odoo#98866

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-25 12:05:36 +02:00
Guillaume (gdi) 1006cfb47e [FIX] website: prevent to have two modals for Images Wall
Before this commit, when you double-clicked on an image in the Images
Wall block, the modal appeared twice. This commit ensures that for the
block Images Wall, only one modal can be present at a time.

Steps to reproduce the problem:
- Drop the block Images Wall on a page
- Save
- Click twice quickly on the same image

-> Two modals are open (one on top of the other)

task-2937538

closes odoo/odoo#98857

X-original-commit: e21ff31c429a8bc339f527a2e4eacc0f1b2f6d7d
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-08-25 12:05:33 +02:00
Benoit Socias 375f4dff1c [FIX] web_editor, *: clean previously shown link in link popover
*: web_tour, test_website

Since [1] when the link popover was introduced, when the URL of a link
was made empty, an validation error appeared by the previously shown URL
did still appear inside the popover.

After this commit the previously shown link is replaced by a message
that indicates that no URL is specified.
The telephone and envelope icons are now also always removed when the
URL is change: they used to be only toggled, which made it possible to
make them appear and disappear by updating an email address or a phone
number.

Steps to reproduce:
- Add an image-text snippet to the page
- Select the image
- Add a link on the image
- Specify URL
- Click on image => link popup shows the entered URL
- Make the URL field empty
- Click on image
=> link popup still showed the previously entered URL

[1]: https://github.com/odoo/odoo/commit/8fcf930a6b6b7ffb0965b0a689c7a3117962ce7e

task-2765857

closes odoo/odoo#98845

X-original-commit: f212c56d73f5dad8eb5850b0b39cc92f55706ee2
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
2022-08-25 12:05:29 +02:00
Benoit Socias afe148341a [FIX] web_editor, website: not show link tools if link contains a media
Since [1] the link tools got created when the destroyed sub-elements of
the link were clicked on. This causes a problem when the element is a
media because upon destroy the tools reset the link to an incorrect
state.

After this commit the link tools is not touched anymore if the element
that was clicked on is a media.
Also, it reflects the changes done in the popup into the media link
options, and the ones done in the option into the popup.

Steps to reproduce:
- Add an image-text snippet in the page
- Click on the image
- Set up a link
- DO NOT click on the image again
- Click on the left of the image (to click on the snippet itself)
- Click on the image again
=> The image was removed instead and a text link remained

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

task-2765857

X-original-commit: 11ee7d5520c3a14a381b3f5b973114670f1e2edb
Part-of: odoo/odoo#98845
2022-08-25 12:05:29 +02:00
Bruno Boi c343318f93 [FIX] web: keydown traceback on empty m2m_tags(_avatar)_field
- Before this commit
On an empty m2m_tags(_avatar)_field, triggering a keydown event yields to a traceback due to an owl issue.
This will be fixed in owl later.

- After this commit
The 't-on-keydown' attribute on TagsList component has been moved into the tags themselves.

closes odoo/odoo#98840

Signed-off-by: Samuel Degueldre <sad@odoo.com>
2022-08-25 12:05:24 +02:00
Bruno Boi d56468eb66 [FIX] web: disable browser autocompletion for AutoComplete component
- Before this commit
The browser autocompletion feature may conflict with
the AutoComplete component. First, the browser could
display its own autocompletion dropdown over our component's.
Secondly, selecting an item in the browser's autocompletion
dropdown simulates a keydown event with an undefined 'key' property,
leading to display traceback when the AutoComplete component
uses the keydown event (i.e. in getActiveHotkey).

- After this commit
The <input/> of our AutoComplete component now has the following attr
`autocomplete="off"`. This disables the browser's autocompletion feature
for this <input/>.

Part-of: odoo/odoo#98840
2022-08-25 12:05:24 +02:00
Demesmaeker 05a4c4ad0e [FIX] sale: ensure pricelist rule available
task-2961855

closes odoo/odoo#98808

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-08-25 12:05:19 +02:00
Julien Mougenot 1ab23b9467 [FIX] web: Prevent drag on kanban record dropdown
Before this commit, clicking on any part of a kanban record would
initiate a drag & drop sequence, this included its dropdown. This caused
2 issues:

- You could start to drag & drop records by dragging their still opened
dropdowns ;

- Said dropdowns would remain open when dragging their parent record.

This commit fixes both of these issues by hiding dropdowns during drag
sequences and preventing drag when clicking inside the dropdowns.

closes odoo/odoo#98791

Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
2022-08-25 12:05:15 +02:00
Julien Mougenot cf4a8f198f [IMP] web: Add 'ignore' param to useSortable
This commit adds a new parameter to the 'useSortable' hook that allows
HTML elements to prevent a drag sequence. This 'ignore' param can be a
string or a function returning a string, that will be a selector
targetting the elements that need to prevent drag & drop sequences.

Part-of: odoo/odoo#98791
2022-08-25 12:05:15 +02:00
Nicolas (vin) 3bac0f9d68 [FIX] account: Do not add tax grids for CABA taxes upon reversal
When using CABA and reversing a move, we expect the CABA move to
be the one impacting the tax grids, and not the reversed move.
Thus, we now avoid setting the tax grids for CABA taxes on
move lines created when making a reverse move.

Task id # 2895267

closes odoo/odoo#98789

X-original-commit: 5dd50ac1433be262ddd49d8b165e240afd16e675
Signed-off-by: Laurent Smet <las@odoo.com>
2022-08-25 12:05:10 +02:00