Commit Graph
151539 Commits
Author SHA1 Message Date
abd-msyukyu-odoo 8a2380bf36 [IMP] knowledge: restyle the chatter button and size
When the chatter is in side mode (lg+ sizes), its size can become quite small
(since it is proportional with the width of the viewport). Add a static minimal
width so that the display stays readable.

Change the border color of the buttons in the knowledge header so that when the
chatter is displayed, it has a better contrast (the chatter button is a toggle
on-off).

Task-2858428

X-original-commit: 7d07f6f52886d1d7b86fd008fab579ffd8e71702
Part-of: odoo/odoo#93088
2022-06-08 15:46:03 +02:00
abd-msyukyu-odoo 8a24a7e63d [IMP] knowledge: prevent article reload on chatter reload
Currently, when the chatter has to reload, it triggers a reload event for the
parent view. In the case of Knowledge, we want to be able to exclusively reload
the chatter because nothing changed in the article.

In Knowledge, if the param `keepChanges` is used with reload, the full form view
does not need to be fully reloaded. In this case, only the chatter will be
updated.

Task-2858428

X-original-commit: 91e268b580614da224f044061d01e69f09a5034d
Part-of: odoo/odoo#93088
2022-06-08 15:46:02 +02:00
abd-msyukyu-odoo 35c8064b1a [FIX] knowledge: fix blank chatter when changing tracked fields
How to reproduce
  * Open an article and edit one of the tracked fields
    (title, root_article_id, parent_id).
  * Open another article
  * Re-open the first article
  * Open the chatter

Current behavior
  The chatter does not appear.

Expected behavior
  The chatter should appear.

Fix
  Instead of loading the chatter with the form view, load the chatter when the
  user clicks on the chatter button.
  Implements the use of the chatter component differently from the
  form_renderer in mail, to be able to update/render it independently from
  the rest of the view.
  Hide the chatter button if there is no article in the form view since there is
  no chatter to display in this case.

Task-2858428

X-original-commit: b705ccf952cd67dad4f1480928c94cd7215b601a
Part-of: odoo/odoo#93088
2022-06-08 15:46:02 +02:00
abd-msyukyu-odoo 4ed03d5940 [IMP] knowledge: reorder functions alphabetically
Small reorganisation of the code to order functions alphabetically in
knowledge_controller and knowledge_renderer

Task-2858428

X-original-commit: 874dc4a93af72c706ff756b29af96f7030a3423a
Part-of: odoo/odoo#93088
2022-06-08 15:46:02 +02:00
qsm-odoo 5fb94f6b79 [FIX] website, *: properly translate website filters names
*: website_blog, website_event, website_sale

The "website.snippet.filter" model introduced at [1] was not marked to
have its "name" field to be translated. As those names are shown in the
website editor panel to be able to select a filter, they have to be
translated.

[1]: https://github.com/odoo/odoo/commit/0e7640b5f22d2bea04bbe22d3189cff7e03af545

opw-2852416

closes odoo/odoo#93074

X-original-commit: fc9e5619331cf22f8605a72907153f9431ca6b15
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-06-08 15:45:49 +02:00
Odoo's Mergebot 249aabdce7 [MERGE][IMP] survey: clarify live session links flow
Specifications

- Handle the situation in which the quick access
link is used but the live session is not launched yet, by showing an
appropriate error message and by allowing a user with sufficient rights
to launch the live session directly from the quick access page.

- Make the live session's "go to" url in the presentation mode non-clickable
so that the presenter can not join the session as an attendee as it messes
up, and change the copy icon next to the url to a copy button, which is more
explicit.

Task-2816685

closes odoo/odoo#88434

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-06-08 15:45:45 +02:00
Adrien Schoffeniels 89330e8902 [IMP] survey: change live session's go to link layout
PURPOSE:
Clicking the live session's "go to" url in the presentation mode now copies
the url instead of redirecting the presenter, to prevent him of joining the
session in user mode as it messes up.

Task-2816685

Part-of: odoo/odoo#88434
2022-06-08 15:45:44 +02:00
Adrien Schoffeniels 92704847ed [IMP] survey: handle not launched live sessions in quick access view
PURPOSE:
This commit allows to handle the situation in which the quick access
link is used but the live session is not launched yet, by showing an
appropriate error message and by allowing a user with sufficient rights
to launch the live session directly from the quick access page.

Since a session can be launched multiple times, the error related to
closed sessions has been removed, so that the user with the rights to do
it can also "relaunch" a session if it has been closed before.

Task-2816685

Part-of: odoo/odoo#88434
2022-06-08 15:45:44 +02:00
Pratik Raval 1ba3cb040f [IMP] website_google_map: display correct partner location on map
Currently, when the geolocation coordinates (latitude & longitude) of
the partner are not set, location for such partners is shown in the
middle of the sea (on /partners page).

With this commit, the coordinates are handled properly so that if they
are not set, instead of sending "0.0" to the map API, we now pass them
as a Falsy value, so that Geocoder API could use the available address
and locate such partners properly in the google map.

taskID-2819772

closes odoo/odoo#88622

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-06-08 14:40:24 +02:00
Samuel Degueldre b74febe128 [IMP] web: stop using guardedCatch in Mutex
Guarded catch promotes bad patterns (using promise rejections as control
flow instead of as errors), as such, we should not use it in non-legacy
code. This commit reworks the exec method of the Mutex utility class to
avoid using it.

closes odoo/odoo#93081

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-06-08 13:39:04 +02:00
std-odoo cf91caa284 [FIX] mail_plugin: always ensure that the returned partner has a name
Task-2826471

closes odoo/odoo#93058

X-original-commit: da26bb66f7c8c65beb7d326a6aaf565da8713a0d
Related: odoo/enterprise#28118
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-06-08 12:27:08 +02:00
std-odoo 81d7b17c5c [IMP] mail_plugin: hide the create button if we do not have access right
Purpose
=======
Hide the "Create Partner" button if we do not have the "create" access
right.

Do not offer to create a project if the current user can't.

Do not try to enrich if we can't create a partner.

The write access on the partner is checked on the record itself because
of access rules.

Task-2826471

X-original-commit: b678a9bc1298e9a1973074740a8c8a1d471b6848
Part-of: odoo/odoo#93058
2022-06-08 12:27:08 +02:00
Nicolas Lempereur 6dae35ab2e [FIX] base: test_mimetype_svg working with magic
In libmagic implementation, space before an SVG make it detected as SVG.

In odoo implementation, for the same case we don't detect it as SVG.

But in the test `test_guess_mimetype.test_mimetype_svg` we only check
odoo implementation behavior, so the test fail if module python-magic is
installed.

With this fix, the test is only run when python-magic is not installed.

opw-2746934

closes odoo/odoo#93056

X-original-commit: 8e38bfb38a3c1c3888d4f4efa1a13fa4cf6246bb
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2022-06-08 12:26:59 +02:00
Tommy (tong) b24bc6dc06 [FIX] l10n_tw: translation cannot be applied on account data
Issue:

  - Translation cannot be applied on account data.
  - Replace icon with the one existing in the base module
  - Add demo data

Cause:

 Missing spoken_languages

Solution:

 Add back spoken_lanugages

closes odoo/odoo#93030

X-original-commit: 2662c1788b2eb3d2c42f9c3142cf953d79a923af
Signed-off-by: William André (wan) <wan@odoo.com>
2022-06-08 11:20:50 +02:00
MerlinGuillaume 49e59b938f [FIX] base: remove invalid default_type when creating res.partner
If you send an email from CRM and the address you are trying to send the
email to is not linked to a partner, a new partner will be created and
it will use the default_ fields in the context which may not be valid
for the partner

Steps to reproduce:
1. Install CRM and open the app
2. Trigger the list view of the pipeline
3. Select any opportunity with the email 'ErikNFrench@armyspy.com' and
click on 'EMAIL' in the top left
4. Give a subject to the email and select the template 'Welcome Demo'
5. Send the email
6. An error is thrown

Solution:
In res.partner's `default_get`, remove the `default_type` from
the default values retreived from the context if it's not a valid type
of res.partner

Problem:
Trying to create a partner with default_type in the context will try to
give this type to the partner but 'opportunity' is not a valid partner
type

opw-2827177

closes odoo/odoo#93025

X-original-commit: 2b023500d1cc2322adbc51dffda4342aba5032ef
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2022-06-08 11:20:43 +02:00
Merlin (megu) de95dee062 [FIX] mail: send email from CRM using a template
When sending emails from CRM, you can save the mail as a new template.
Despite having selected the desired recipients, the mails sent will not
have any recipients.

Steps to reproduce:
1. Install CRM and open the app
2. Trigger the list view of the pipeline
3. Select any opportunities, go to Action and click on 'Send email'
4. Give a subject to the email and click on 'SAVE AS NEW TEMPLATE'
5. Send the email
6. Go to emails, there are no recipients for the emails generated

Solution:
Set the `use_default_to` to true by default when using the 'SAVE AS NEW
TEMPLATE' button

opw-2827177

X-original-commit: 1180b8cd9f0ed5bebdef97d702f29a5652fa6ac8
Part-of: odoo/odoo#93025
2022-06-08 11:20:43 +02:00
David (dafr) cc6d3a52ac [FIX] pos_gift_card: Increase gift card barcode size
With some scanners, the barcode was not readable due to its size.
A 2 time width increase make the barcode width similar to the code width in text form.

OPW-2793423

closes odoo/odoo#92999

X-original-commit: d19517cf84baf979ee10e6796a6f9e093ab48485
Signed-off-by: Masereel Pierre <pim@odoo.com>
2022-06-08 11:20:37 +02:00
Sébastien Theys 527ac92f8d [IMP] mail: unregister afterEvent handler in tests
This will reduce memory leaks in tests.

closes odoo/odoo#92878

Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2022-06-08 11:20:31 +02:00
MAHAMADASIF ANSARI a0ae236a20 [IMP] sale_crm: remove default 'Customer' filter
When going to quotations from a lead by clicking on a stat button, the
result we see can sometimes be inconsistent with the count of a stat
button (count can be higher than the quotation we see). This happens
because we set a default filter which shows quotations only for the
contact set on the current lead. However, even if the contact's
company is set on another quotations, we should see them since they are
considered for the stat button data.

This commit removes the default 'Customer' filter and thus allowing
also to see the quotation linked to customer's company. This does
not have any side effect because the default domain makes sure that
quotations we see are linked with current opportunity only.

task-2859354

closes odoo/odoo#91898

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-06-08 11:20:25 +02:00
Odoo's Mergebot 216f8b9069 [MERGE][IMP] survey: improve mobile UI
PURPOSE

This commit removes a few unessential content, fixes
misalignments and removes the input autofocus on mobile devices

SPECS

Remove a few unessential content
Some contents take a considerable space on mobile without adding
essential information, requiring the user to scroll to see useful info.
These contents are now removed on mobile devices.

Fix misalignments
Some parts were misaligned on small screens, taking unnecessary space or
cutting parts of sentences. These parts have been adapted to handle
small screens.

Remove the autofocus on the first input in survey forms on mobile devices
When a new page of a survey is loaded, the first input is autofocused so
that the user can directly complete the survey without manually getting
the focus. This causes inconsistencies and undesired behaviors on mobile
devices. Especially, when the focus is set automatically on Android devices,
the soft keyboard is opened, the viewport is reduced and the view is scrolled
to the input, which involves that the user misses information about the
survey (such as the beginning of the question for long questions), or
section descriptions. The autofocus has therefore been removed for mobile
devices.

Task-2622693

closes odoo/odoo#87990

Related: odoo/enterprise#26143
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-06-08 11:20:14 +02:00
Adrien Schoffeniels 72c4ffc3ee [IMP] survey: improve mobile UI
PURPOSE
This commit removes a few unessential content, fixes
misalignments and removes the input autofocus on mobile devices

SPECS

Remove a few unessential content
Some contents take a considerable space on mobile without adding
essential information, requiring the user to scroll to see useful info.
These contents are now removed on mobile devices.

Fix misalignments
Some parts were misaligned on small screens, taking unnecessary space or
cutting parts of sentences. These parts have been adapted to handle
small screens.

Remove action buttons related to live sessions on small screens
Since the presentation mode doesn't look good on mobile devices
(questions have a lot of linebreaks, arrows do not always work),
and since normally no one presents a live session using a mobile
device, the action buttons "Create Live Session", "Open Session Manager"
and "Close Live Session" are now hidden on small screens.

Remove the autofocus on the first input in survey forms on mobile devices
When a new page of a survey is loaded, the first input is autofocused so
that the user can directly complete the survey without manually getting
the focus. This causes inconsistencies and undesired behaviors on mobile
devices. Especially, when the focus is set automatically on Android devices,
the soft keyboard is opened, the viewport is reduced and the view is scrolled
to the input, which involves that the user misses information about the
survey (such as the beginning of the question for long questions), or
section descriptions. The autofocus has therefore been removed for mobile
devices.

Task-2622693

Part-of: odoo/odoo#87990
2022-06-08 11:20:13 +02:00
Adrien Schoffeniels a7438e3278 [IMP] survey: make xpathing to survey template more robust
PURPOSE:
The 'o_survey_statistics_header' class has been added so that it can be
used as reference for template extension.

Task-2622693

Part-of: odoo/odoo#87990
2022-06-08 11:20:13 +02:00
Christophe Monniez e5361e93be [IMP] core: bump master release to 16.1 alpha
closes odoo/odoo#92997

Related: odoo/upgrade#3571
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2022-06-08 10:06:42 +02:00
Romain Derie d348bed1ad [IMP] website, *: use upsert to improve visitor perf
* im_livechat, test_event_full, website_blog, website_crm,
  website_event, website_event_track, website_event_track_quiz,
  webite_livechat, website_sale

There is 6 main changes in this commit:

1. Using raw SQL Upsert instead of the ORM methods. While raw SQL should
generally be avoided, it makes sense for such a low level behavior which
is impacting every flows.
Indeed, tracking visitors is a generic behavior done on all pages and
controllers. It is important to optimize it to reduce processing time
and SQL Queries.
Benchmark of that change alone:
> Rendering a tracked page improves from ~19.5ms to ~17ms (using `ab`
  with 1000 loop) and the requests involved in the tracking process are
  reduced from 8 SQL Queries to 3:
  - 1 request to upsert the visitor
  - 1 request to fetch the visitor data
  - 1 request to add the tracking record

2. Adding in that upsert query the `visitor.track` insert, creating both
records in one go, bringing the query count from 3 to 2.

3. Refactoring of the `parent_id` behavior that was introduced in stable
with [1]. The purpose was to keep track of multiple visitor linked to a
same user to merge the tracking together. Especially useful for tracking
a same visitor on different devices (when logged in).
Only one visitor was kept as active, others would be archived and their
tracks would be set/moved to the main partner.
Removing those duplicate visitor was not possible because those archived
duplicated visitor were holding the devices notification push token.
Since [2], those token were moved to their own table, all related to the
main visitor.
We can then now safely remove those duplicate visitors after merging
their track to the main visitor. Thus, the `parent_id` field is no more
useful. Removing it removes a layer of complexity.
Note that thanks to this part, the `active` field can also be removed.

4. Deeper functionnal change, inspired from Plausible: The access_token
is no more stored in a cookie but is the result of a hashing method
based on <IP Adress, User Agent>.
The reason behind that change is that, in an upcoming refactoring,
sessions won't be stored anymore unless absolutely needed (login, add to
cart..). It will also ship a no cookies policy, trying to get rid of all
cookies.
This change is bringing some functional changes:
- Since the IP is included in the hash to generate the token, it means
  that:
  A. If an anonymous user switch IP (eg from 4G to wifi), it is
     considered as a new visitor.
  B. If 2 anonymous users with the exact same user agent (same browser,
     same browser version, same exact os or phone) are on the same IP,
     those will be considered as the same visitor.
- Since the request host is not included in the hash, it means that
  visiting a DB from 2 differents URLs (domain and/or ip) on the same
  device and same browser will result in a shared visitor.
  It shouldn't imply any issue as this is A. not wrong and B. mostly
  used for tests.
As all this is only related to non logged in user, it shouldn't be a
real issue as anonymous visitors are not supposed to be meant to be
business critical, even if we use them for "a bit more" than simple
analytics data.

5. The access_token is now replaced by the partner_id once the user logs
in, so:
- We don't need to either search on the partner_id field or the
access_token field (depending if the user is logged in or not), we can
only use the access_token row/field to do both.
- On logout, everything works out of the box as the access_token will be
regenerated since there is no partner_id anymore.
- On login, if an access_token matches the user's partner_id, that
visitor is returned.
If there is no such token, a new visitor is created for that partner_id.
In both 2 cases, tracks are moved to that visitor and the anonymous
visitor is removed.
- We can remove the code that was in charge of checking if the
access_token / visitor cookie was wrong (coming from another user eg,
different user login on same device). Indeed, such collision is not
possible anymore as the access_token automatically match the logged in
user.
- We can remove the code that was in charge of checking if the
access_token / visitor cookie was wrong (coming from a logged in user
while the current visitor is not loggedin). Such collision is not
possible anymore as the access_token is (re)generated as an anonymous
token (hash) when not logged in.

6. There is no more check to prevent a track to be created if there was
already a track for that URL in the last 30 minutes.
While this can easily be re-introduced (one CTE on the upsert), it was
adding ~100ms (from ~20 to ~110ms) to the request on a big database as
Odoo where there is ~100 millions tracks and ~100 millions visitors.
It has been validated that it was not a real issue as it is not
fundamentally wrong. If a visitor visited 20 times a product or a
specific page in that short amount of time, you might want to know that
because the user is most likely interested by it.

Changes (1+2), 3, (4+5) and 6 are all independant from each other and
could have existed on their own.

[1]: https://github.com/odoo/odoo/commit/c6b8a44b970a46dcd87a4e2cb1ad52fa340b209f
[2]: https://github.com/odoo/enterprise/pull/16781/commits/f75090fe8b42484e89e933976e8441d2f5eb9415

task-2867045

closes odoo/odoo#87857

Related: odoo/enterprise#28004
Related: odoo/upgrade#3566
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-06-07 16:31:20 +02:00
Romain Derie 92feb6a67f [FIX] website: ensure request.env and env.uid are set
Some cases might lead to undefined `env` on request or undefined `uid`
on request.env:
1. Mobile app: no uid is set on the jsonRequest env
2. Multi db: _env is None on request, and request.env unbound

1. Was checked with [1]
2. Was checked with [2] but by doing so, it actually broke the check
   done for 1.

[1]: https://github.com/odoo/odoo/commit/245ef4b0fddc7e5da3ebe841438c2d2902933f14
[2]: https://github.com/odoo/odoo/commit/3a7033463ea98def2e3fb85333c4f00f7c7d6925

task-2867045

Part-of: odoo/odoo#87857
2022-06-07 16:31:19 +02:00
Romain Derie 124c65b6a1 [IMP] website: stop creating visitors and tracks for bots/crawlers
Before this commit, every visit on the website would create a visitor
and tracks, including visits from bots and crawlers (e.g. google bot).

Now, we prevent that as it doesn't bring any value to track those bots.

Note that it means there won't be any track created if you are using
tools like `ab` for perf investigation or `curl` commands.

task-2867045

Part-of: odoo/odoo#87857
2022-06-07 16:31:19 +02:00
Alexandre Kühn 922e32b880 [FIX] mail: show popover in discuss public view
Follow-up of
https://github.com/odoo/odoo/pull/92896
Task-2871688

PR above introduced PopoverManager, but forgot to include it in the
public discuss view. As a result, no popover view were working.
For example, clicking on the Emoji button in the composer was not
showing the emoji list in a popover view.

closes odoo/odoo#92950

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-06-07 13:06:15 +02:00
Stanislas Gueniffey 564af98969 [IMP] account_move: recurring entries
Recurring entries are created using the 'auto_post' selection field
- 'no' for regular entries
- 'at_date' for non-recurring auto-posted entries
- 'monthly', 'quarterly', 'yearly' for recurring auto-posted entries

Auto-posted entries can also be posted manually.
For recurring entries, the next one is  created upon posting.

See : odoo/enterprise#27798
See : odoo/upgrade#3543

closes odoo/odoo#92348

Task: 2855545
Signed-off-by: William André (wan) <wan@odoo.com>
2022-06-07 12:11:29 +02:00
Joseph Caburnay 75d14c2282 [FIX] pos_loyalty: reward button highlight, free product, etc
- Properly compute the free product quantity.
  - Free product that generate points not based on quantity
  - Same free product from different rewards
- Proper timing of the reward button highlight. If there are products
  that are potentially free product when added, then the reward button
  is highlighted.
- Don't reorder free product reward lines. Before, if there are multiple
  free product rewards, the lines are reordered at each ui action.
- Loyalty points are computed properly, at least when free products are
  involved.
- Introduct some tests to protect the fixes.

closes odoo/odoo#92809

X-original-commit: 3e954d26b7e1e5c41c4f5372010f0573c9adcfe9
Signed-off-by: Masereel Pierre <pim@odoo.com>
2022-06-07 10:16:22 +02:00
std-odoo f3f750b0f7 [FIX] mail: do not ignore email sent by mailing list
Bug
===
Since 9c1cdd330e we ignore all incoming
email sent by mailing lists.

They are real use case when people want to be able to receive email
from mailing list (e.g. if they subscribed to an automated service,
or if someone is in leave and has done a auto-replier for that, etc).

Add a model to whitelist some email address. The alias limit
does not apply for those emails.

Task-2862092

closes odoo/odoo#92015

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-06-07 10:16:18 +02:00
Laurent Smet 080d41a341 [REF] account_accountant: Refactor the bank reconciliation widget
- Refactor the bank reconciliation widget to use more standards views and have a side-by-side kanban/widget views instead.
- Make sure the bank reconciliation widget is doing the same thing as the "reconcile" method on account.bank.statement.line. Then, what you see on the view is exactly what you get on the corresponding journal entry.
- Since the "reconcile" method is gone, clean the matching rules since it's now called only for one statement line at a time. Also, move the auto_validate feature into a CRON to avoid performance issues when opening the widget.

closes odoo/odoo#91448

Task: 2555114
Related: odoo/enterprise#27360
Related: odoo/upgrade#3555
Signed-off-by: William André (wan) <wan@odoo.com>
2022-06-07 10:16:14 +02:00
Laurent Smet e79b32a868 [IMP] account[_check_printing]: Add check number into payment journal item label
Since 'check_number' is now part of the journal item's label, the account_accountant_check_printing module is no longer necessary.

Task: 2555114
Part-of: odoo/odoo#91448
2022-06-07 10:16:13 +02:00
Laurent Smet 847b1e18f6 [IMP] account: Allow 'handle_price_included' taxes computation at the line level
Task: 2555114
Part-of: odoo/odoo#91448
2022-06-07 10:16:13 +02:00
Laurent Smet b684771a3b [IMP] account: Add a method allowing to preview the reconciliation
This is useful when you need to get the amount to fully paid something in advance, specially in multi currencies.

Task: 2555114
Part-of: odoo/odoo#91448
2022-06-07 10:16:13 +02:00
Laurent Smet 27b4924e7e [IMP] web: Allow to detect which notebook tab is the active one
Task: 2555114
Part-of: odoo/odoo#91448
2022-06-07 10:16:12 +02:00
Laurent Smet 951e287c2c [IMP] web: Allow to hide the currency symbol on FieldMonetary widget
In some cases, we want to use the regular FieldMonetary widget (performing the amount rounding correctly) but without displaying the currency symbol since the currency code is displayed elsewhere.
This is needed because some currencies are using the same currency symbol like USD / MXN.

Task: 2555114
Part-of: odoo/odoo#91448
2022-06-07 10:16:12 +02:00
Laurent Smet a7990134ee [FIX] web: Prevent 'load_views' caused by default values inside the context
The use case is the following:
- Create a kanban view
- Customize it to open a form view on the right when clicking on a kanban card
- The form view is initialized using the context with a 'default_...' key to set a field.
=> Since the context is different every time, the 'load_views' rpc call is always triggered, leading to performance issues.

Task: 2555114
Part-of: odoo/odoo#91448
2022-06-07 10:16:12 +02:00
Julien Mougenot 486a21d0e4 [IMP] web: allow custom onPushState method
This helper is tested by the account_accountant module. See legacy view adapter.

Task: 2555114
Part-of: odoo/odoo#91448
2022-06-07 10:16:12 +02:00
Julien Mougenot bcc5a6efbf [IMP] web: legacy view adapter
Part-of: odoo/odoo#91448
2022-06-07 10:16:11 +02:00
Fabien Pinckaers c08fa433e4 [IMP] remove unused indexes (field index included in unique index)
account.account: code was already in unique constraint
account.journal: inverting compound unique constraint to benefit from indexing company_id
hr.employee: user_id already in unique index
phone.blacklist: number already in unique index
stock.orderpoint: product_id already in unique constraint/index

closes odoo/odoo#92932

Signed-off-by: Fabien Pinckaers <fp@odoo.com>
2022-06-07 09:19:27 +02:00
Romain Derie bc1389ee89 [FIX] website: fix wrong translation check due to transifex change
Somehow the already translated term `Save` in french was translated
again from `Sauvegarder` to `Sauver`.

We already faced that issue when forward porting the tour as that
translation was not the same between versions, see [1].

The tour should be adapted to create a new fake language and some
translations for it (the ones being checked in the tour) to make it more
robust and not impacted by the real translation from transifex.
It would also makes the test faster as it wouldn't have to load a real
language which has a lot of translations.

As this is blocking and preventing any r+ in saas-15.3 a day before the
saas-15.4 freeze/release, this quick fix is introduced in the meantime.

[1]: https://github.com/odoo/odoo/pull/84528#issuecomment-1041323974

closes odoo/odoo#92938

X-original-commit: 594ac2c9651f27cc1623fcd5b916cb191241651b
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-06-07 00:05:54 +02:00
Pierre Paridans 08030d3409 [FIX] web: allow this test to pass on both newer & older Chrome
This commit should be reverted once Chrome has been upgraded to v97+ on
Runbot.

closes odoo/odoo#92921

X-original-commit: abac4e9eb4be8e31f776d745ad1fd19a310c608f
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2022-06-03 21:33:00 +02:00
Bruno Boi 15d642ef73 [FIX] web: failing parseDateTime test in Chrome97+
Since Chrome 97+ some assertions in a parseDateTime test was failing.

This commit adapts these assertions as the behavior in this browser
version is more sensible.

X-original-commit: 866133f5b292ae17b68e1e593cf4c9a29f7e8839
Part-of: odoo/odoo#92921
2022-06-03 21:32:59 +02:00
Alexandre Kühn 315a0d6b5b [IMP] mail: introduce PopoverManager, and some code cleaning
1. Remove useless props category on component `ChannelMemberListCategory`
2. Make fields of model `DiscussSidebarCategory` more declarative,
   i.e. by defining values from compute of field rather than imperative
   code somewhere in the code of discuss.
3. Introduce a new model `PopoverManager`, which eases use of `PopoverView`s
   as they are automatically added in the DOM in a similar way than `Dialog`s
   with `DialogManager` or `ChatWindow`s with `ChatWindowManager`.
   Doing so also make these popover view no longer deep child in component tree:
   this fixes an issue in which popover views could be cut due to DOM tree.

Task-2871688

closes odoo/odoo#92896

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-06-03 18:34:53 +02:00
Julien Castiaux fc115ebdf7 [FIX] web: invalid image placeholder resizing
Access `/web/image/82303?height=16`, traceback because the placeholder
image cannot be resized to `"16"`.

closes odoo/odoo#92891

Signed-off-by: Julien Castiaux <juc@odoo.com>
2022-06-03 18:34:49 +02:00
Josse Colpaert c5f0e89bca [FIX] l10n_ec: change loading order of files
There was a problem loading the demo data, because at the
installation of the CoA, the document types had not been loaded
yet.  By changing the order in which the files are loaded
in the manifest, we make sure that the when we upgrade the demo
data to Ecuadorian standards that the right document type is set.
(as it will be there because it will be loaded before the loading
of the demo data)

closes odoo/odoo#92889

X-original-commit: a641cfb470c5454a8772851f1f9c6c0271b23774
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Josse Colpaert <jco@odoo.com>
2022-06-03 17:37:45 +02:00
lejeune quentin dbc065423b [FIX] pos_stripe: Add a link to Stripe connect
We need to complete the onboarding of Stripe connect or
record the secret key

Actually there are not a direct link to payment from POS

So we add a link from the Stripe payment method to Stripe view form

closes odoo/odoo#92869

Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2022-06-03 16:41:19 +02:00
Pierrot (prro) 011d8ad9e3 [IMP] account: Improve Journal Items Tax Audit UX
Small changes to show and hide some fields by default,
and add some in the view.

task-2855459

closes odoo/odoo#92852

Signed-off-by: Quentin De Paoli <qdp@odoo.com>
2022-06-03 16:41:14 +02:00
Pierrot (prro) 65b67d4cbb [IMP] account: improve invoice UX
Improvements to the account move form:
- "Reconciled Entries" button -> "Reconciled Items", and goes now to the
    Journal Items list view grouped by Matching number
- Removed the unwanted margin next to the "Journal Items" table (in the
    "Journal Items" tab)
- the partner can be hidden, in the Journal Items list view

task-2855459

Part-of: odoo/odoo#92852
2022-06-03 16:41:14 +02:00
Pierrot (prro) d7fe7fd8f0 [IMP] account: improve Journal Items UX
Improvements to the Journal Items list view:
- readonly set on multiple fields
- hide/optional show by default on multiple fields
- "Tax Grid" string set on tax_tag_ids for more clarity
- Added multiple fields to the "simple" list view for more consistency
    with the grouped list view
- Added an edit button on some "group by" lines to edit the
    corresponding field
- Removed the Revert and Duplicate button from the "grouped by" view
    (on the group by line)
- Added a button to open the corresponding Journal Entry, and removed
    the Journal Item form access. The Journal Item form should not be
    accessible anymore.
- Show the total sum for Balance
- Added the "Tax Grid" group by

task-2855459

Part-of: odoo/odoo#92852
2022-06-03 16:41:14 +02:00