Commit Graph
153356 Commits
Author SHA1 Message Date
Antoine Guenet 2b7b279218 [FIX] web_editor: prevent wrong DOM operations when editable not in DOM
`getDeepRange` fetched a range on potentially the wrong document and
`getTraversedNodes` created a node iterator on potentially the wrong
document, when the editable was not in the DOM.

Part-of: odoo/odoo#92200
2022-08-26 17:16:30 +02:00
Antoine Guenet 49de251a7b [FIX] web_editor: ensure editor is properly destroyed after each test
If an error was thrown during a call to `testEditor` (eg, a test
failed), we never went through the code that destroys the editor and
cleans the DOM. This catches any error to throw it only at the end of
the function.

Part-of: odoo/odoo#92200
2022-08-26 17:16:30 +02:00
Sébastien Geelen (sge) d32a8c53c2 [IMP] web,web_editor,mass_mailing,sms: new dynamic placeholder
Introduce a new Dynamic Placeholder Generator
in mass mailing and SMS creation.

Using a specific character (#) in subject or via the PowerBox in body
we open a field selector popup, which can be use to select
the wanted field and enter a default value. on validation, the dynamic
placeholder will be inserted in the corresponding input/editable.

task-2154624

closes odoo/odoo#71878

Related: odoo/enterprise#30333
Related: odoo/upgrade#3766
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-08-26 17:16:10 +02:00
Sébastien Geelen (sge) 7587f50140 [FIX] web_editor: more robust getRangePosition
Ensure getRangePosition do not crash if
the current selection is collapsed.

task-2154624

Part-of: odoo/odoo#71878
2022-08-26 17:16:10 +02:00
Sébastien Geelen (sge) 09be8678bb [FIX] web_editor: fix t-out support
Ensure <t-out> tag inside the editable area are
not considered as no content or empty.

task-2154624

Part-of: odoo/odoo#71878
2022-08-26 17:16:09 +02:00
Sébastien Geelen (sge) 1a82c91524 [IMP] mail,sms,mass_mailing_*: remove dynamic placeholder tab
We remove the existing dynamic placeholder generator tab,
in mail and sms creation views.
In preparation of the implementation of a new way to generate
the dynamic placeholders

task-2154624

Part-of: odoo/odoo#71878
2022-08-26 17:16:09 +02:00
Laurent Smet 8295bd1ba0 [FIX] account: Fix demo data for matching rules
Fix a bug introduced by:
https://github.com/odoo/odoo/commit/4b23d11184be9bac5ef9790cc7f38bc4d637b47a

Since this commit, the matching rules's regex "BRT: ([\d,]+)" that was matching "BRT: 100,00" is no longer matching "BRT: $ 96.67".

closes odoo/odoo#98698

Related: odoo/enterprise#30490
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
2022-08-26 11:51:40 +02:00
Laurent Smet 8f7fe1aeb3 [IMP] account: Add link to statement lines used to match a payment
On the bank reconciliation widget, we need to open the statement line matched with the payment.

Part-of: odoo/odoo#98698
2022-08-26 11:51:39 +02:00
Abdelouahab (abla) b342fe8460 [FIX] project: grouping by date_deadline access error
To Reproduce
=============

- share a project with a portal user (with editing rights)
- connect to portal with this user and try to group tasks by deadline

Problem
=======

An access error is raised stating that this user doesn't have right to read
`deadline_field:week` field.

The issue comes from this line :
https://github.com/odoo/odoo/blob/42cb8ad0a31162d9d1b93e4eae0562c89685fe3c/addons/project/models/project.py#L1621

where `fields` contains `date_deadline:week` but `self.SELF_READABLE_FIELDS` contains `date_deadline`
that's why `date_deadline:week` will remain in `unauthorized_fields` .

Solution
=========

To solve the issue we take only the field name from the groupby when computing `fields_list` that
will be checked by `_ensure_fields_are_accessible`

opw-2949047

closes odoo/odoo#98953

X-original-commit: 1d0a62d0d235a4f0686e17033bb9d144d5583907
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Signed-off-by: abla001 <abla@odoo.com>
2022-08-26 08:07:55 +02:00
jbw 62a5af923a [FIX] account: take sequence_override_regex int account when resequencing
Before this fix, resequencing would use values from _get_sequence_format_() run from an empty model.
This method result is influenced by the sequence_override_regex param of the move journal.
This means that if the journal of the moves that are resequenced has a sequence_override_regex param, it will be ignored in the wizard.
This fix run the _get_sequence_format_() method on the first move to take the journal into account.
Note that the wizard only allows resequencing moves from one same journal.

closes odoo/odoo#98926

Task: opw-2825699
X-original-commit: b22c37a5f173161b4a5f798462ea05142bb9334a
Signed-off-by: William André (wan) <wan@odoo.com>
2022-08-26 06:55:46 +02:00
qsm-odoo 06e93c2489 [FIX] web: prevent wrong date format if picker used too soon on frontend
If datetimepickers were used too soon after page loading, they would use
the wrong format and UI options as the code in charge of initializing
those options was not fully lazy loaded yet.

With this patch, we prevent the tempusdominus lib to consider pickers
that are in a body that is marked by the lazyloader during the lazy
loading of JS files. We could potentially not add the lib attribute
(data-toggle="datetimepicker") on those elements and let the business
code initializing the pickers add it but that would not have been a
stable fix and it may be better this way as this works generically.

opw-2944720

closes odoo/odoo#98917

X-original-commit: 7e012340d3adcd64e829a5dca34173da24d649bc
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-08-26 06:55:43 +02:00
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