Commit Graph
165845 Commits
Author SHA1 Message Date
Didier (did) f1abc4e4f3 [FIX] mail: selfFollower should be included in the followers
Before this PR, the current user was not considered has a follower, regarding
the mention suggestions.
This lead him to be lower than other entries.
This PR fix the issue by adding him back to the follower list.

Task-3531111

closes odoo/odoo#137583

X-original-commit: 50a785fedc5b5c7fd826548e52385bdf458c97a2
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Didier Debondt (did) <did@odoo.com>
2023-10-06 06:14:04 +00:00
Valentin Vallaeys (vava) 8e3ffe7800 [IMP] sales: add discount on SOL in kanban
Before this commit, the discount was not displayed on SOL in mobile
view.

This commit adds the discount when it exists.

task-3111127

closes odoo/odoo#137416

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-10-06 06:14:02 +00:00
hupo-odoo 45b95c12db [IMP] account_report: new option for favorite filters
Adds a new boolean field on accounting report to enable the user to select user-defined filter on accounting reports. If activated, the user can visualize its own favorite filter (defined on journal items list view) on a new option selector on top of accounting reports (see enterprise commit). When selected, the domain of the user-defined filter is added to other selected options' domain.

task-3444246

closes odoo/odoo#134966

Related: odoo/enterprise#47200
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
2023-10-06 06:14:00 +00:00
oco-odoo 791bbfc7c6 [IMP] account: reports: introduce current_groupby field
This field is needed by the enterprise counterpart of this commit. It is used to store custom-defined groupby on the report lines without overriding the standard value that's given in data files.

Task 3413437

closes odoo/odoo#133830

Related: odoo/enterprise#46657
Signed-off-by: John Laterre (jol) <jol@odoo.com>
2023-10-06 06:13:59 +00:00
Odoo's Mergebot ae01d6488d [REF] mail, various: simplify 'mail.tracking.value' model, keep trackings at field removal
PURPOSE

Simplify 'mail.tracking.value' model and code. Remove unnecessary fields and
computation. Make code easier to handle and more batch-enabled. Keep tracking
when removing fields.

SPECIFICATIONS

Remove 'tracking_sequence' on tracking values in DB. Consider insertion order
should be done accordingly and display them based on ID DESC. Sequence is now
used only for order records to insert in DB and can be used to resequence
them using the field description at any time. Feature is still the same (order
based on sequence) but without having to store the sequence itself. It was
never updated anyway.

Remove 'field_desc' and 'field_type' from 'mail.tracking.value' model. Those
can be retrieved when necessary, as it is mainly used for frontend display
in Chatter.

Remove 'old_value_monetary' and 'new_value_monetary' as float value can be
used instead.

Rename 'field' to 'field_id' to better indicate it is a m2o, and not a char
field holding a field name.

When removing fields set the field to False instead. Add a new field to
store fields information allowing to keep name, type and groups information
to allow displaying removed tracking values. Use this field only when a
field is removed to avoid duplicating field information when not necessary
and polluting the table.

Improve support of o2m / m2m tracking.

Cleanup overall tracking code: try to make methods more consistent with I/O,
cleanup formatting methods.

While working on tracking, let us cleanup a bit tests and various code
bits.

Task-3345979 (Mail: Simplify tracking model)

closes odoo/odoo#124182

Related: odoo/upgrade#4747
Related: odoo/enterprise#42131
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-10-06 06:13:55 +00:00
Thibault Delavallée a88381cc12 [IMP] mail: keep tracking when unlinking fields
RATIONALE

Currently when an ir.model.fields is removed all tracking linked to it is
lost. Indeed field is required and has an ondelete cascade attribute set
to it. However we should keep tracking values as those made sense when
used and one could want to have access to this information.

SPECIFICATIONS

When removing fields set the field to False instead. Add a new field to
store fields information allowing to keep name, type and groups information
to allow displaying removed tracking values. Use this field only when a
field is removed to avoid duplicating field information when not necessary
and polluting the table.

Task-3499067 (Mail: keep tracking when unlinking fields)

Part-of: odoo/odoo#124182
2023-10-06 06:13:55 +00:00
Thibault Delavallée e147d35590 [REF] mail: rename 'field' to 'field_id' on tracking value
PURPOSE

Simplify 'mail.tracking.value' model and code. Remove unnecessary fields and
computation. Make code easier to handle and more batch-enabled.

SPECIFICATIONS

Rename 'field' to 'field_id' on tracking model. It better indicates it is a
many2one and not a char field holding a field name for example.

Task-3345979 (Mail: Simplify tracking model)

Part-of: odoo/odoo#124182
2023-10-06 06:13:55 +00:00
Thibault Delavallée b2d7f03398 [REF] mail: remove 'monetary' values from tracking value, use float
PURPOSE

Simplify 'mail.tracking.value' model and code. Remove unnecessary fields and
computation. Make code easier to handle and more batch-enabled.

SPECIFICATIONS

Remove 'old_value_monetary' and 'new_value_monetary' fields on tracking model.
Float fields can be used instead as anyway what is important is the type
of value stored, not their actual purpose.

Task-3345979 (Mail: Simplify tracking model)

Part-of: odoo/odoo#124182
2023-10-06 06:13:55 +00:00
Thibault Delavallée 6aa0a25df7 [REF] mail: remove 'field_{desc/type}' from tracking value
PURPOSE

Simplify 'mail.tracking.value' model and code. Remove unnecessary fields and
computation. Make code easier to handle and more batch-enabled.

SPECIFICATIONS

Remove 'field_desc' and 'field_type' from 'mail.tracking.value' model. Those
can be retrieved when necessary, as it is mainly used for frontend display
in Chatter.

Task-3345979 (Mail: Simplify tracking model)

Part-of: odoo/odoo#124182
2023-10-06 06:13:55 +00:00
Thibault Delavallée b4cb36ed80 [REF] mail: remove 'sequence' on tracking value, use insert order
PURPOSE

Simplify 'mail.tracking.value' model and code. Remove unnecessary fields and
computation. Make code easier to handle and more batch-enabled.

SPECIFICATIONS

Remove 'tracking_sequence' on tracking values in DB. Consider insertion order
should be done accordingly and display them based on ID DESC. Sequence is now
used only for order records to insert in DB. Feature is still the same (order
based on sequence) but without having to store the sequence itself. It was
never updated anyway.

Task-3345979 (Mail: Simplify tracking model)

Part-of: odoo/odoo#124182
2023-10-06 06:13:55 +00:00
Thibault Delavallée eea8e584fc [IMP] mail: raise when tracking an unsupported type / unknown field
Currently tracking an unsupported field type simply skips the field. As code
has been cleaned and natively support 2many fields we consider tracking should
be done only on supported fields. Otherwise people might wonder why tracking
does not work.

We now raise when the type is not supported, which is currently the case for
html fields. As they may contain lot of data it is better to think of a
specific tracking based on history / diff than logging old / new value.

When the field does not exist on model, instead of returning None we now
raise. Indeed return value was not consistent and 'None' is not something
people expect as tracking values. If the field does not exist tracking should
clearly say it, as it indicates a model issue somewhere.

Task-3345979 (Mail: Simplify tracking model)

Part-of: odoo/odoo#124182
2023-10-06 06:13:54 +00:00
Thibault Delavallée 6344fc7d50 [REF] mail, various: fix and test 2many fields tracking
PURPOSE

Simplify 'mail.tracking.value' model and code. Remove unnecessary fields and
computation. Make code easier to handle and more batch-enabled.

SPECIFICATIONS

In old times, 'account' and 'project' supported 2many fields tracking. Then
it was moved directly into 'mail'. Thanks to precommit hooks and complete
record access for relational fields, it is now possible to track 2many
fields.

In this commit we cleanup odoo/odoo@167944cc93 that landed during work on this task and
add some tests to be sure it is effectively covered.

Task-3345979 (Mail: Simplify tracking model)

Part-of: odoo/odoo#124182
2023-10-06 06:13:54 +00:00
Thibault Delavallée 11289fd128 [REF] mail: cleanup 'mail.tracking.value' model code
PURPOSE

Simplify 'mail.tracking.value' model and code. Remove unnecessary fields and
computation. Make code easier to handle and more batch-enabled.

SPECIFICATIONS

SPEC 1: prepare all tracking values at same code place

Delegate all computation of tracking values into the 'create_tracking_values'
method. Curently part of it (currency field) is done in the caller. Better
split code per feature.

Method is also made private, as it is not required to expose it.

SPEC 2: cleanup tracking value formatting methods and calls

Code used to display tracking value can be simplified: remove unnecessary
wrappers, make code easier to read, avoid composition of field name but
use a mapping instead (easier to grep 'old_value_char' when it is effectively
used).

Ensure code always calls '_tracking_value_format' to ease future improvements
and have all formatting code being batch-enabled.

SPEC 3: simplify Chatter formatted value structure

'fieldType' is currently added in old and new values. As it is a field
property it can be moved higher in the formatting result to be included
only once. Also add 'fieldName', the column name, to the formatted results
as it will soon help various tool methods. Moreover it makes sense to have
the source of the tracking as the real column name, in addition to its
string and type.

Task-3345979 (Mail: Simplify tracking model)

Part-of: odoo/odoo#124182
2023-10-06 06:13:54 +00:00
Thibault Delavallée c40053bc28 [IMP] test_mail: cleanup tracking tests
When possible, use '@users' decorator. Rename tests to better match their
main purpose, notably

  * test_mail_track*: mail_track specific (specific fields, display)
  * test_message_track*: overall behavior of 'message_track', notably subtypes,
    template usage, ...

Add some additional tests and improve test coverage, as some field types
were not covered (date, datetime, text notably). Improve currency
check for monetary fields.

Move 'mail.tracking.duration.mixin' tests into the file testing mixins
linked to 'mail.thread', rename the Case class according to current test
guidelines.

Also starting from now, `MailCommon` flushes tracking automatically at
setup time, allowing to remove some custom flush done in tests. That way
tests are less prone to non deterministic errors. This implies some changes
in execution of tests, which means some updated query counters notably.

Task-3345979 (Mail: Simplify tracking model)

Part-of: odoo/odoo#124182
2023-10-06 06:13:54 +00:00
Odoo's Mergebot 00f0e65740 [MERGE][REF] mass_mailing: improve subscription portal
PURPOSE

Overall cleaning of subscription and exclusion management code from portal.
This code comes mainly from v12 and can now benefit from cleaning and update.

Globally improve usability and features given by mailing portal about exclusion
list and opt-out management.

SPECIFICATIONS

Cleanup access control (hash usage, returned / raised errors). Globally check
security and usage of controllers.

Refactor JS to be finally using frontend widgets. Split it into sub-widgets to model
main parts of the unsubscribe portal: feedback sending, email blocklist management
and opt-out from mailing lists.

Improve usability of unsubscribe portal, notably

  * allow to give a feedback when unsubscribing from mailing not related to
    mailing lists. It was previously limited to mailings done on mailing lists.
    Now the feedback is allowed in all cases and posts it on the related
    document;
  * clean display of opt-in and opt-out lists;
  * display all public lists, even if not already join. This allows to opt-in
    to new lists, which was not possible before;
  * switch on a neutral name for non public lists (as they may contain
    marketing hints);
  * give UI feedback to customer when using buttons: add confirmation of
    block list addition / removal, of updated subscriptions, ...
  * globally improve wording;

Add a generic 'my' page for mailing, allowing logged users to control their
blocklist status and mailing lists.

Improve feedback sending. Messages and notes are improved to have a
better wording and links to contextual records when possible (mailing,
mailed records, contacts, ...). Add opt out reasons when updating
subscriptions or block list status. This allows to better report on common
causes.

LINKS

Task-2669037 (Mass Mailing: Refactor js/portal for subscription)
Task-2150462 (Mass Mailing: Improve subscription management)

closes odoo/odoo#86084

Related: odoo/upgrade#3327
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-10-06 06:13:53 +00:00
Thibault Delavallée 42d896f8ef [FIX] mass_mailing: this is not deterministic
Part-of: odoo/odoo#86084
2023-10-06 06:13:53 +00:00
Thibault Delavallée 85f76cd077 [IMP] mass_mailing: ease unsubscribe page edition for mailing users
PURPOSE

Globally improve usability and features given by mailing portal about exclusion
list and opt-out management.

SPECIFICATIONS

Ease unsubscribe page preview and edition. 'unsubscribe_from_list' generic
unsubscribe link now redirects to '/mailing/my' page, allowing to see what
an unsubscription page looks like. Empty sections are also added to ease
editor usage.

No real unsubscription preview can be done from 'unsubscribe_from_list' link
displayed in a mailing body as the mailing could not exist when clicking on it.
Moreover it would require custom code to redirect from this generic link to
the real unsubscription page, for few real added value.

Tweak access to allow mailing users to access a mailing given its non-protected
'mailing/<id>/unsubscribe' link. It is not linked to any backend document
(like specific document mailed, ...) but allows to display the page, edit
it, ...

Tweak 'mailing/<id>/view' to allow to generate the non-protected unsubscribe
link. It allows a mailing user to "view" a mailing, then click on "unsubscribe"
and land on the unsubscribe page, without having to deal with document_id
and tokens.

Task-2150462 (Mass Mailing: Improve subscription management)

Part-of: odoo/odoo#86084
2023-10-06 06:13:53 +00:00
Thibault Delavallée c0775de8d0 [IMP] mass_mailing: add unsubscribe headers in mailing emails
PURPOSE

Globally improve usability and features given by mailing portal about exclusion
list and opt-out management.

SPECIFICATIONS

Add unsubscribe headers to email sent by mass mailings. As emails are already
parsed to change the generic 'unsubscribe_from_list' link to an email-specific
link we can add the List-Unsubscribe header at the same time. Add header for
post 'List-Unsubscribe=One-Click' to avoid one-click unsubscribe when readers
crawl email links.

Task-2150462 (Mass Mailing: Improve subscription management)

Part-of: odoo/odoo#86084
2023-10-06 06:13:53 +00:00
Thibault Delavallée b4d7eda6e0 [REF] mass_mailing: improve feedback, add reasons
PURPOSE

Globally improve usability and features given by mailing portal about exclusion
list and opt-out management.

SPECIFICATIONS

Messages and notes are improved to have a better wording and links to contextual
records when possible (mailing, mailed records, contacts, ...).

Add opt out reasons when updating subscriptions or block list status. This
allows to better report on common causes.

For that purpose we introduce a new model allowing to store those reasons.
A boolean flag allow to trigger the usage of the feedback textarea in portal
page.

Task-2150462 (Mass Mailing: Improve subscription management)

Part-of: odoo/odoo#86084
2023-10-06 06:13:53 +00:00
Thibault Delavallée b897571b9f [REF] mass_mailing: rename subscription model
PURPOSE

Overall cleaning of subscription and exclusion management code from portal.
This code comes mainly from v12 and can now benefit from cleaning and update.

SPECIFICATIONS

In this commit we rename ``mailing.contact.subscription`` model into the
shorter ``mailing.subscription``. This is sufficient to explain the model
purpose. As we plan to add an opt-out model this also allows to have sub
models with suffixes without being too long.

We also rename ``subscription_list_ids`` field on contact model to
``subscription_ids`` as this is shorter and clearer.

Finally the ``mailing_contact_list_rel`` table name that comes from old
implementations (simple m2m table) is renamed to ``mailing_subscription``
to match the model name.

Task-2669037 (Mass Mailing: Refactor js/portal for subscription)

Part-of: odoo/odoo#86084
2023-10-06 06:13:53 +00:00
Thibault Delavallée d27797dd9b [REF] mass_mailing: add a 'my' page to handle subscriptions
PURPOSE

Globally improve usability and features given by mailing portal about exclusion
list and opt-out management.

SPECIFICATIONS

Currently mailing portal is usable only through dedicated links added in
mailings. Those use a hash token based on mailing, document_id (if mailing
ran on business documents) and email of the recipient. However this is not
convenient, especially for users that want to update their subscriptions
manually.

Purpose of this commit is to add a generic page in mass mailing allowing
to manage subscriptions to mailing lists as well as blocklist status directly
from portal. That way people don't need to come from a given email mailing
link.

A new page is added. It is located on ``mailing/my`` and has the same
capabilities as the unsubscribe pages, except it works outside of a given
mailing contact. Page (html, js) and behavior are shared among the various
use cases.

This page is available for logged user, both internal and share. Other people
should come through existing unsubscribe links using email, document id and
hash token.

Access control is updated so that it is now possible to use mailing routes
without requiring always email / document_id / hash_token. User can be used
instead.

A tour is added allowing to test this new feature.

Task-2150462 (Mass Mailing: Improve subscription management)

Part-of: odoo/odoo#86084
2023-10-06 06:13:53 +00:00
Thibault Delavallée 8019a605c7 [REF] mass_mailing: update route parameters
PURPOSE

Overall cleaning of subscription and exclusion management code from portal.
This code comes mainly from v12 and can now benefit from cleaning and update.

SPECIFICATIONS

Rename route parameters to be more clear about their usage. Notably res_id
is better labelled document_id, token is a hash_token, ...

Update legacy to still support old routes.

Task-2669037 (Mass Mailing: Refactor js/portal for subscription)

Part-of: odoo/odoo#86084
2023-10-06 06:13:53 +00:00
Thibault Delavallée be3c92d805 [REF] mass_mailing: improve portal subscription management page
PURPOSE

Globally improve usability and features given by mailing portal about exclusion
list and opt-out management.

SPECIFICATIONS

Purpose of this commit is to cleanup and improve the portal subscription page
that allows to manage subscription to mailing lists and blacklist status.

Main features updated or added

  * allow to give a feedback when unsubscribing from mailing not related to
    mailing lists. It was previously limited to mailings done on mailing lists.
    Now the feedback is allowed in all cases and posts it on the related
    document;
  * clean display of opt-in and opt-out lists;
  * display all public lists, even if not already join. This allows to opt-in
    to new lists, which was not possible before;
  * switch on a neutral name for non public lists (as they may contain
    marketing hints);
  * give UI feedback to customer when using buttons: add confirmation of
    block list addition / removal, of updated subscriptions, ...
  * globally improve wording;

Unsubscribe from a document now uses the same layout as unsubscribe from
mailing lists. Indeed the first one blacklists the email while the second
one opt-outs from mailing lists. But overall form is the same and options
are also the same. After all previous cleaning we can now keep a single
page for everything.

Task-2150462 (Mass Mailing: Improve subscription management)

Part-of: odoo/odoo#86084
2023-10-06 06:13:53 +00:00
Thibault Delavallée 11e813d7f3 [REF] mass_mailing: cleanup subscriptions update (optin / optout from lists)
PURPOSE

Overall cleaning of subscription and exclusion management code from portal.
This code comes mainly from v12 and can now benefit from cleaning and update.

SPECIFICATIONS

Purpose of this commit is to cleanup code that manages chosen lists from
portal and updates opt-in and opt-out accordingly.

Code is now located on mailing list model. When opting-it, new subscriptions
have to be created for mailing lists so that email is part of the list. When
opting-out we just have to toggle the opt_out flag on subscription model.

Logged messages are also improved. We log on contact model the updated
mailing lists for opt-in or opt-out.

Task-2669037 (Mass Mailing: Refactor js/portal for subscription)

Part-of: odoo/odoo#86084
2023-10-06 06:13:53 +00:00
Thibault Delavallée 32e3917b35 [REF] mass_mailing: rewrite subscription management JS
PURPOSE

Overall cleaning of subscription and exclusion management code from portal.
This code comes mainly from v12 and can now benefit from cleaning and update.

SPECIFICATIONS

Purpose of this commit is to get rid of old declarative javascript used in
mass mailing. It is still using old fashioned JS, not using widget or any
standard way of doing JS-based behavior in Odoo.

In this commit we introduce a main widget that manages the subscription page.
It has 3 sub widgets to manage parts of its features

  * blocklist management: add or remove current email from exclusion list.
    Adding an email in exclusion list is doable only if activated in settings;
  * feedback: allow user to give their feedback. It currently logs on target
    model, based on a hardcoded search on 'email_normalized' field. This is
    strange as not all models have a normalized email field, but who am I
    to judge anyway ?
  * subscription management: allow to opt-in and opt-out from mailing lists;

This commit mainly keeps the current behavior, just rewrites the JS part.
Some further feature or UI update will move into sub-widgets in subsequent
commits.

Some Markup issues are also fixed in this commit, as code is already updated.

Task-2669037 (Mass Mailing: Refactor js/portal for subscription)

Part-of: odoo/odoo#86084
2023-10-06 06:13:53 +00:00
Thibault Delavallée f6aea2b047 [MOV] mass_mailing: split main unsubscribe controller
PURPOSE

Overall cleaning of subscription and exclusion management code from portal.
This code comes mainly from v12 and can now benefit from cleaning and update.

SPECIFICATIONS

Main portal controller of mass mailing is currently the unsubscribe controller.
This controller has two main behavior:

  * one is used when un-subscribing from a mailing based on mailing lists
    (opt-out from lists);
  * one is used when un-subscribing from a mailing based on documents (like
    registrations or applicants). This one directly sets emails in exclusion
    list;

Better split it into two sub methods so that it is easier to understand and
modify in future commits.

Task-2669037 (Mass Mailing: Refactor js/portal for subscription)

Part-of: odoo/odoo#86084
2023-10-06 06:13:53 +00:00
Thibault Delavallée c559eef741 [REF] mass_mailing: cleanup controller access code
PURPOSE

Overall cleaning of subscription and exclusion management code from portal.
This code comes mainly from v12 and can now benefit from cleaning and update.

SPECIFICATIONS

Purpose of this commit is to better organize controllers about access control.
First do access control in a clean check method, then have business code. We
also use more frontend oriented errors like BadRequest or Unauthorized.

A main tool method now correctly raises depending on given input. Controllers
have the responsibility to let it raise, return a keyword of even skip error
if the flow allows it. If something is wrong, simply raise (http) or return
(json) generic errors in main cases to avoid leaking information.

Task-2669037 (Mass Mailing: Refactor js/portal for subscription)

Part-of: odoo/odoo#86084
2023-10-06 06:13:53 +00:00
Thibault Delavallée 786c2c9e3c [IMP] mass_mailing: improve contact order
Use name instead of email, as contact is notably used in sms marketing
application with mainly phone numbers. Better use the name as primary
ordering field. Then use ID to avoid non deterministic behavior.

This requires to fix some tests in 'test_mass_mailing' so that they
use test models instead of existing models. That way they are not
dependent on existing data and existing models definition anymore. An
issue with ordering rose as we modified the ordering of contact model.

Task-2150462 (Mass Mailing: Improve subscription management)

Part-of: odoo/odoo#86084
2023-10-06 06:13:53 +00:00
Thibault Delavallée a2872cb981 [IMP] mass_mailing: add tests for unsubscribe mailing portal
Purpose of this test is to add tours and tests about the portal in mass mailing
that allows to unsubscribe from mailing list and to use the exclusion list.

This is done using small tours called from unit tests. Two type of tours are
added. The first one targets mailing done on mailing lists. As it targets
contact model unsubscription click opts-out the contact from the mailing
list. The second one targets mailing done on other documents. When clicking
on unsubscription link the document's primary email is directly added into
the exclusion list.

Some other additional tests are added to cover various use cases and features
of mailing controllers.

Task-2150462 (Mass Mailing: Improve subscription management)

Part-of: odoo/odoo#86084
2023-10-06 06:13:53 +00:00
Habib (ayh) c855bee515 [IMP] account: enable index scan on AML
The corresponding enterprise PR enables sorting account move lines on the bank recon by matching amount.
Unfortunately there is a significant performance impact when enabling this ORDER BY (~300 ms -> ~2600 ms tested on a large db)

In order to optimise the above, we slightly modify the domains used so that the existing index `account_move_line__unreconciled_index` is used.
This is not yet tested on a large DB (due to the index change), however observations on a populated database indicate an improvement:
without index: 80ms
with index: 30ms

closes odoo/odoo#135155

Related: odoo/enterprise#45816
Related: odoo/upgrade#5146
Signed-off-by: Laurent Smet (las) <las@odoo.com>
2023-10-06 05:10:21 +00:00
Aaron Bohy 42ee5c346c [FIX] web: debug menu: can get view
Since commit [1], there was a crash when the user clicked on the
"Get View" item in the debug menu (in any views). This was because
the arch now received by the views in props is an XmlDocument,
whereas before it was a string.

[1] odoo/odoo@cc3a3a328d

closes odoo/odoo#137668

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-10-06 03:21:50 +00:00
Géry Debongnie 601eb8f144 [REF] web: remove use of internal variable
In a previous commit, we temporarily used the `__OWL__DEVTOOLS__`
global variable to access the list of all apps. This was obviously not
something that we want to do, so we introduced a proper hook in Owl.

This commit changes the code to use the static apps object from the App
class.

closes odoo/odoo#137661

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-10-06 02:17:40 +00:00
Bruno Boi 5557853f4b [FIX] web: keep the searchbar dropdown in place
**Before this commit**
Open the SearchBarMenu dropdown, then add
numerous filters or groupbys.
When doing so the search bar may grow or shrink,
leading to the dropdown being repositioned while
you interact with it.
This gets really annoying when you are using your
mouse.

**After this commit**
The dropdown will stay in place while your
pointer is inside and get repositioned as
soon as your pointer leaves the dropdown.

**Implementation Notes**
- The usePosition hook now returns an object with functions
  that allow to lock/unlock the positioning updates.
- The "fixedPosition" usePosition's option has become
  obsolete with this new mechanism and has thus been replaced.

closes odoo/odoo#137449

X-original-commit: 3e883a2a1af07875efd7dea8de39cf9914d2a0de
Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
2023-10-06 00:55:54 +00:00
Bruno Boi 0c0a0d02a4 [FIX] web_tour: hide on tour pointer scroll
**Before**
When the scroller tour pointer is clicked,
it scrolls fine but if the mouse cursor is left
inside the pointer element, its position is
not updated until you leave it.

**After**
When the scroller tour pointer is clicked,
it directly goes away as soon as the scroll starts.

X-original-commit: 6d0d085a158777076bb58821b2fc83d020fe9b53
Part-of: odoo/odoo#137449
2023-10-06 00:55:54 +00:00
Lopes Marc (loma) 936f0d7914 [IMP] survey: improve results page
Purpose
=======

Improve the overall look of the page for screen and print media.
Display/hide questions, and alternate between pagination and full
display of user responses.

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

= HEADER AND OVERVIEW =

- remove waste space between Edit Survey button and survey title
- remove trophy cup or any icon on the right of the title
- put filters on the right of the title
- remove background
- replace the `Results overview pie chart` by the survey KPI's
- add a print button

= QUESTIONS =

- add a button for each question to toggle their visibility
- avoid breaking question into multiple lines, use all space available
- change info badges design so they are not mistaken for buttons
- remove question type from the info badges

= USER RESPONSES =

- add a `show all` button per question to display all responses,
whitout pager and scrollbar.
- for each response, push the filter icon to right side of the row
- use regular font and color for responses, remove response text from
the anchor tag

= PRINT MODE =

- hide the `webeditor/ back to backend` button
- visible questions: display all responses (no pagination or scrollbar)
- user responses: hide filter icons
- make sure elements like tables are properly cut between pages
- resize graphs to ensure they fit into A4 paper page

task-3424235

closes odoo/odoo#135683

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-10-05 18:35:30 +00:00
Zelong Lin 69fe16d42d [IMP] mail: make mentions in chatter full composer
Before this commit, it was not possible to send messages in
full composer containing user mentions. Even whe the mentions were
added in the small composer and then continuing composing the message
in the full composer.

With this commit, we can now make user and channel mentions in the
full composer, by typing `@` and `#` like in the small composer of
Discuss.

When composing a message in small composer and then switching to full
composer, the mentions are preserved.

task-3470060

closes odoo/odoo#132701

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-10-05 16:49:04 +00:00
Odoo's Mergebot f0b7838f95 [MOV] event_barcode: merge into event
This PR moves event_barcode module from enterprise to community. It is
now integrated directly with the base 'event' module. Using it is optional
and activated directly from settings, instead of having to install a
new module.

This PR also allows organizers to use QR codes without needing a barcode.

Some improvements are made in registration flow, notably improving barcode
display and usage in checkout process and outgoing emails.

Task-3411827 (Move event barcode to community)
Task-3470321 (Improve registration flow)

closes odoo/odoo#135153

Related: odoo/enterprise#45598
Related: odoo/upgrade#5183
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-10-05 16:49:01 +00:00
dane@odoo.com a98717b0e5 [IMP] event: refactor barcode
Commit is responsible for refactoring
code related to barcode.

Part-of: odoo/odoo#135153
2023-10-05 16:49:01 +00:00
dane@odoo.com a653d22aeb [IMP] event: hide barcode
When barcode/QR code isn't available '123456789' placeholder
is inserted which might be misleading. The change makes sure
to show barcode/QR code only when they are available.

task-3411827

Part-of: odoo/odoo#135153
2023-10-05 16:49:01 +00:00
dane@odoo.com 9476597594 [IMP] event: Event registration config
Add QR code on top left corner of the confirmation mail.
It also modifies confirmation page
by showing phone number of organizer and contact mail.

Part-of: odoo/odoo#135153
2023-10-05 16:49:01 +00:00
dane@odoo.com 0e9a9aff46 [MOV] event_barcode: integrate into community event module
event_barcode is moved to community and integrated directly into
event module

task-3411827

Part-of: odoo/odoo#135153
2023-10-05 16:49:01 +00:00
Pierre Pulinckx (pipu) 99730d7ae4 [FIX] web: fix color property in calendar status
Problem : From the sales order, if we go to the calendar view, it shows
status like "sales order", "quotation",... when we check the style in
the console, span style has nonsensical values for
background-color and border-color.
Ex : style="background-color:state; border-color:state;"

Correction : The styles are already applied by
t-att-class="getFilterColor(filter)"
used on the div.o_calendar_filter_item.
Then the utilisation of t-att-style is no more useful.

taskId : 3512867

closes odoo/odoo#137656

Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
2023-10-05 15:36:27 +00:00
Touati Djamel (otd) 6af53f5f48 [FIX] purchase_requisition: convert purchase price to current currency
Bug introduced in:
https://github.com/odoo/odoo/pull/128327/commits/8f96e08985ebac3309745f1036a5e83d287e6382

Steps to reproduce the bug:
- Activate 2 currencies (assume EUR and USD, conversion
   rate: 0.65 EUR = 1 USD)
- Create new product “P1”:
    - Purchase tab:
        - add two vendors:
- Vendor_USD, currency = USD, price = 100
- Vendor_EUR, currency = EUR, price = 80
 - Create PO:
    - vendor = vendor_EUR
    - Currency = Eur
    - Add P1, Unit price should be 80

- Alternative tab > Create alternative > Vendor = Vendor_EUR
- Compare product lines Issue: The line with price = 100 USD is
 highlighted as being the cheapest option, but if we apply conversion
 rules, 80 EUR = 123,07 USD > 100 USD.

Solution:
Before selecting the cheapest line, we convert the prices of the
purchase order lines that are in a currency other than the current
currency of the company.

opw-3378253

closes odoo/odoo#137642

X-original-commit: c45272828ee85bc23dd97dc93dc741f8f59a5305
Signed-off-by: Tiffany Chang (tic) <tic@odoo.com>
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
2023-10-05 15:36:26 +00:00
Gabriel de Paula Felix (gdpf) a0d4c62108 [FIX] google_calendar: do not spam while updating recurrent events
Before this task, lots of mails were sent after updating or deleting recurrent event in 'All events' or 'This and future events' update type. This was happening because updating these recurrent events was triggering patch calls event by event, when they should be handled in batch.

After this commit, updating or deleting recurrent events should trigger at most two mails for Google users.

closes odoo/odoo#137607

Task-id: 3163695
X-original-commit: ad2106babda61446bce13283d570dc723418b630
Signed-off-by: Arnaud Joset (arj) <arj@odoo.com>
Signed-off-by: Gabriel de Paula Felix (gdpf) <gdpf@odoo.com>
2023-10-05 15:36:25 +00:00
Julien Alardot (jual) 11a0f8fab7 [FIX] hr_expense: Fix currency_rate handling
The desired flow of currency rate in expense is as followed:
- (default) Use Odoo currency rate
- Allow the user to set a custom rate (to include fees) when changing
  the total amount in company currency
- Revert to the default behaviour when the currency is changed
  or the amount in foreign currency is changed

This aims to fix how currency rate is computed and overridden
- Reorganize all currency rate computation, so it doesn't revert to Odoo rate
  at every compute call
- Deals with a bug where a "total_amount_currency", when changed
  just before calling "action_submit_expenses" would not trigger
  the computation of unit_amount
- Force save when changing currency on expense form view to prevent a bug
  where the first modification of "total_amount_company" would be canceled
  (due to the new behaviour of currency rate computation)
- Removes unit_amount_display from views as it should be removed
  in later versions and is deprecated since 16.0

task-3476569

closes odoo/odoo#137598

Signed-off-by: Laurent Smet (las) <las@odoo.com>
2023-10-05 15:36:24 +00:00
Julien Alardot (jual) 471d8301b5 [IMP] project_sale_expense: change bad tests flows
Previous test flow:
 - Re-invoice a multi-currency expense with a product having a cost
   with a "unit_amount" override

Expected test flow:
  - Re-invoice a multi-currency expense with a product having no cost
    and a "total_amount" override

In the past it was feasible (but wrong) in the back-end to set a product
with price in a multi-currency expense.
Setting an expense amount through the unit_amount is also not reflecting
the actual flow

task-3476569

Part-of: odoo/odoo#137598
2023-10-05 15:36:24 +00:00
Brieuc-brd cfd1eb439d [FIX] web_editor: display read-only handles
Prior to this commit, read-only handles were hidden, which created a
layout issue (eg. the header was no longer highlighted when we clicked
on it).

This commit adapts read-only handles to make them visible by using a
border around the selected element.
It also adapts the common borders of all handles to place it
inside the element to avoid being partially hidden when the element is
on the edge of the container (eg. the header or the footer).

task-3537616

closes odoo/odoo#137569

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-10-05 15:36:23 +00:00
Brieuc-brdandqsm-odoo c16428cf39 [FIX] web_editor, website: adapt dropzone transparency
Since the introduction of the new dropzone design at [1], the dropzones
were not transparent enough anymore and the inline content behind them
was not readable.

This commit adapts the layout of dropzones to make the content behind
them more readable.

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

task-3537616

Part-of: odoo/odoo#137569
Co-authored-by: qsm-odoo <qsm@odoo.com>
2023-10-05 15:36:22 +00:00
Romain Derie 58607d1cf7 [REV] pos_self_order, product, website_sale: add product info popup
This reverts commit 3b9401c354.

It shouldn't have been merged in the first place. The PR was `r-` but it
seems like the mergebot bugged and still merged it because there was an
occurence of `r+` in the sentence which asked robodoo to `r-`.

> robodoo r- just to be sure, since there was a random r+ not [...]

Rationale of the revert:
- Bad field name:
  - "ecommerce" in product module
  - "ecommerce" but used in POS
- Arguably very low value to share the field -> This field is used in
  ecommerce to add info exactly between the price and the name of a
  product. There is low chance that you want to share that exact
  information with the POS.
- Technically, it couldn't work. What you design in website builder on
  the product page is related to website assets JS and CSS, which are
  not loaded neither in the backend and neither in the POS.
  It was leading to multiple critical issues, mainly:
  - Losing the whole style of the content (CSS)
  - Breaking completly the snippets (visually and design wise) (CSS/JS)
  - Not even show (JS is in charge of showing the content eg)

Note that the same issues were already existing in that field in the
backend (it's shown in the product form view). The ecommerce team was
looking for a solution to make it work, but it's impossible as to work,
it would need the website / frontend assets, which can't be loaded in
the backend / POS.

The cancel of this PR was validated with PO of POS and ecommerce
following those explanation, which they weren't aware of.

Apart from this revert, further PR will be done to:
1. Remove the field from the product form view (ecommerce app)
2. Create a new field for POS

Revert of https://github.com/odoo/odoo/pull/136906

task-3524272

closes odoo/odoo#137514

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-10-05 15:36:21 +00:00
Michael (mcm) 89693faebb [FIX] web: fix http.post array params
Since [1] an error was thrown when giving multiple files to http.post.
This commit reverts changes in the function but the function now also
allows to give a FormData instead of pojo.

[1]: https://github.com/odoo/odoo/pull/136271

closes odoo/odoo#137421

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-10-05 15:36:19 +00:00