Commit Graph
153892 Commits
Author SHA1 Message Date
Arthur Detroux (ard) ed7794839b [MOV] website: move file to prepare for OWL conversion
This commit moves existing Fields to the OWL `components` folder to
prepare for their conversion to OWL.

Part-of: odoo/odoo#99150
2022-09-08 08:36:51 +02:00
Alexandre Kühn f48479e7ee [FIX] mail: remove manual .update() in compute of emoji grid rows
Task-2976694

closes odoo/odoo#99771

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-09-08 03:23:53 +02:00
Mahamadasif Ansari 95d585221a [FIX] survey: avoid horizontal scroll
Currently, in the survey, if the survey/section/question title, description,
survey breadcrumb and multiple choice question options have a very long
link in the label, then on mobile the card is too long, which makes browsers
display a horizontal scroll.

This commit solves the above problem by adding the `text-break` class to the
label.

task-2925648

closes odoo/odoo#99761

X-original-commit: 8be192ba10042d5bb5b8019439c1ac44e1bf3bef
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2022-09-08 03:23:51 +02:00
Alexandre Kühn 67e3603c07 [FIX] mail: emoji picker with only widely supported emojis
1. Remove emoji that have unicode version equal or greater than 13.0.

2. Also removes "smiling_face" and "frowning_face" emojis, as although
they are old emojis, their visual support is quite lacking, so
they feel off. As substition, use "slightly_smiling_face" and
"slightly_frowning_face" respectively.

3. All regional flags have been removed.

4. the 11 remaining flags have been moved to "Symbols" category.

Task-2976577

closes odoo/odoo#99753

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-09-08 02:25:57 +02:00
Xavier-Do 87e357ef82 [FIX] base: speedup access rights check query
Since #84736 the access right check queries were merged into one
Unfortunately the query plan for cases of a group with tons of users
can be suboptimal.

Using a subselect will force the query plan in order to avoid an index
only scan on res_groups_users_rel.

Performances where tested in production, this new query being
around 300 and 1000 times faster for two tests cases (res.partner
 and account.payment.term)

closes odoo/odoo#99747

X-original-commit: c7f6a88466878698a78ba26ceeb18247df6dc955
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2022-09-08 01:08:28 +02:00
Didier (did) 8d8a4ef9b5 [IMP] mail: remove isPostingMessage from updateMessage
Since we are not using `postMessage` in `updateMessage`, setting
isPostingMessage is not useful.

closes odoo/odoo#99744

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-09-08 01:08:20 +02:00
Kevin Baptiste 9a4b887182 [FIX] hr_appraisal_skills: enable editable skills in appraisal
Since odoo/odoo#97984 the "Add new skills" button was opening a dialog
and was not considering the `editable` attribute of the list view.

closes odoo/odoo#99741

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-09-08 01:08:14 +02:00
Panagiotis Kyriakou 73b6284213 [IMP] project: add gateway tip in digest
This commit introduces a new digest tip which
informs the user about the possibility to create
tasks in a project by receiving an email in its
email alias.

If a project with an email alias is set up it will
show it as an example. Otherwise the tip will be a
generic message.

This introduction will further help explain odoo
capabilities to its users.

Task-2973540

closes odoo/odoo#99740

Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-09-08 01:08:11 +02:00
mafo-odoo 11713bfb1d [FIX] hr_holidays: accross two years accrual plans period fail:
Steps to reproduce:
- Create Accrual plan to add 3 days with frequency Yearly on 1 of
January and days lost at the end of the year
- Submit an Allocation request for this accrual plan starting more than
2 years ago
- Run scheduled action "Accrual Time: Updates the number of time off"

Current behavior:
Allocation request calculation time off computes 0 hours

Expected behavior:
Allocation request calculation time off computes 3 hours for the
period between the first of last year and the first of this year

Explanation:
With this modification there are two changes:

1) When the attribution day is the first of january, the nextcall
set in the _end_of_the_year_accrual is the first day of next
year meaning that no days are going to be computed for the last
year period. We change that so that if the first of the year is
the attribution day then the first of the year is the nextcall and
the last call is computed accordingly.

2) If the period to compute the attributed days is acrros two years
the begining of the period is not the first of the year anymore but
the usual lastcall, this has an impact particularly on based on
worked time accrual plans.

opw-2948216

closes odoo/odoo#99728

X-original-commit: 88ba0e68c7878ac4b45cd7103bfecf9cfb567d4f
Signed-off-by: Fockedey Martin (mafo) <mafo@odoo.com>
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-09-08 01:08:08 +02:00
Alexandre Kühn 0f2e34acc8 [IMP] mail: shorten emoji picker search placeholder
Task-2976308

closes odoo/odoo#99724

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-09-08 01:08:05 +02:00
Roy Le 8dd0aa839d [IMP] website: make translation components extensible
It is not common, but we sometimes need to modify translation components
in place. The goal is to have a mechanism to change translation
components and all future/present instances

closes odoo/odoo#99719

X-original-commit: 87f98e6bb82cb2319d7f923b838085befd823f72
Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
2022-09-08 01:08:01 +02:00
Sébastien Geelen (sge) 10c5a16cd4 [FIX] web_editor: fix ctrl+A selection
In some case the ctrl+A selection in the editor
create issue with the commands and the toolbar.

We fixed it by correcting the selection and force it
to be strictly inside the editable.

task-2971144

closes odoo/odoo#99718

X-original-commit: be07c2c021c71d1c5654ea5e331287f2d4e0d559
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-09-08 01:07:58 +02:00
anhe-odoo 18ba4c7578 [FIX] web: add preparse method for parsing dates in catalan
Observed Behaviour

When opening a pivot view with the catalan language activated
and grouping rows/cols by months, everything works fine. But if
we try to import this pivot view in a spreadsheet, all months
are converted to gener, which means 'January' in catalan

Expected Behaviour

When importing the pivot view in a spreadsheet, we should get
the correct date grouping

Reproducibility

This issue can be reproduced with the following steps
1. Activate the catalan language and set it
2. Got to Sales App
3. Select the pivot view
4. Group the rows/cols by order date > months
5. Try to import the pivot view in a spreadsheet

Fix Description

The issue was coming from the fact babel (the package
used to generate date as text in python) write the month as
'de gener', 'de febrer', 'de març', 'd'abril', while moment
(the lib used to handle date in JS) is looking for months as
'gener', 'febrer', ... (ie without "de" or "d'" prefix),
causing it not to recognize the date proposed by Babel. We then
added a preparse method to the catalan language, automatically
used by moment when present in the language definition.

Related Issues/PR

opw-2817041

closes odoo/odoo#99717

Forward-port-of: #90466
X-original-commit: e6addb809134b37e1c45ca7d80bc4532180e1845
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Hendrickx Anthony (anhe) <anhe@odoo.com>
2022-09-08 01:07:54 +02:00
Julien Mougenot c877cab866 [FIX] web: Fix color of filtered kanban records
This commit changes the style rules on grouped kanban records to apply
an outline on focus and a transparency effect when the progress bar
filter does not match the class of the record.

The rules on both kanban_column_progressbar files (legacy & new) have
also been wrapped in global kanban renderer classes to avoid styling
leaks.

closes odoo/odoo#99712

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-09-08 01:07:51 +02:00
Dossogne Bertrand c674b40c02 [FIX] hr_holidays: remove useless boolean display on employee
Removes a useless boolean value on an employee smartbutton

closes odoo/odoo#99694

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-09-08 01:07:48 +02:00
Stefan Rijnhart 7320ab3a76 [FIX] mail: clean context on creation of messages with chatter
When creating records with default keys in context those are currently
propagated through the whole call chain until message creation. However
default keys are meant to be used for the record creation, not its logs
or messages.

A protection against default_child_ids already exists. However better
remove all context keys by using a clean context.

Closes odoo/odoo#93797

closes odoo/odoo#99670

X-original-commit: 421ee12a099220cb43f3c3f0bf8d51586e687a28
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-09-08 01:07:45 +02:00
Pierre Masereel 559536b623 [IMP] point_of_sale, pos_restaurant: convert to scss
This commit converts `pos.css` and `restaurant.css` to use SCSS color
variables. The style of the point of sale application has also been
improved to be more clean and mobile friendly.

task-2954422

closes odoo/odoo#99033

Signed-off-by: Masereel Pierre <pim@odoo.com>
2022-09-08 01:07:42 +02:00
Sébastien Theys e605f90ab6 [IMP] mail: clean legacy activity file
In preparation of future clean up.

- remove obsolete method _fetchSpecialActivity
- apply lint / some es6 syntax on legacy activity file
- use async/await and remove most self in legacy activity
- inline activity setFileUploadID function
- inline activity _bindOnUploadAction function
- inline activity setDelayLabel function
- inline activity _readActivities function
- inline activity _sendActivityFeedback function
- inline activity _bindPopoverFocusout function
- remove obsolete activity _unbindOnUploadAction function

closes odoo/odoo#99646

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-09-08 00:13:05 +02:00
Jorge Pinna Puissant 873790f802 [FIX] web: form_compiler, copy all attributes to the labels
Before this commit, the labels tags that were after the fields losses
their attributes (i.e. classes) after the compilation of the form view
arch.

Now, the attributes are correctly copied after the compilation.

closes odoo/odoo#99486

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-09-08 00:12:52 +02:00
Mathieu Duckerts-Antoine 2156805f27 [FIX] web: kanban: quick create in legacy dialog
When one tries to quick create a record in a kanban view column and a
rpc error occurs, a form view dialogs open. If the form view to
display in the dialog is a legacy view, save the record displayed in the
dialog make the kanban renderer receive a legacy datapoint with no resId
key, making impossible to add the appropriate record to the column.
We fix that.

closes odoo/odoo#99294

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-09-08 00:12:44 +02:00
Mathieu Duckerts-Antoine c4067108d5 [FIX] web: kanban: quick create in a dialog
Go to eLearning > Courses > Contents, group the kanban view by Course,
then quick create a record in a column. A form view dialogs opens. Save
the record: a crash occurs.

Root cause: the kanban view needs some record data that are not found
on the record created by the form view dialog but tries to add that
record directly to the column.

Solution: we create a totally new record with same resId and add that
new record to the column.

Part-of: odoo/odoo#99294
2022-09-08 00:12:43 +02:00
Romain Derie 1145a1fc82 [IMP] website: use get_themes_domain() util instead of custom domain
- use util method already used in regular theme selector screen
- theme_common is already in hidden category, no need to exclude it
- searching on theme category rather than `theme%` name
- move the uninstallable check in the util, no reason to show those in
  the regular theme selector screen either

Fixes #92125

closes odoo/odoo#99099

Related: odoo/design-themes#586
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-09-07 23:10:53 +02:00
Romain Derie d9c260de4b [IMP] website: add missing theme models fields
Before this commit, there were multiple issues related to the creation
of `theme.website.menu` records in a theme:

- Not possible to add a menu in the existing website's navbar
- When one would try to create a `theme.website.menu` that menu would be
  created for every website when instaling the theme on a particular
  website, which is terribly wrong as it goes against the multi-website
  holy grail rule: when editing a website, do not impact other websites.
- Not possible to create a mega menu

Now, one can create a menu:
- as a navbar top menu
- as a child menu of another theme menu
- as a whole new menu hierarchy (top level container)

This is not possible to create a menu as a child of a website.menu, like
adding 2 submenu to the existing contact us menu.
First, this is technically impossible to do without introducing yet
another hack code in the `website.menu` write. Indeed, there is no way
to identify a generic menu's website copies. Neither through a direct
DB field, neither through a persistent info like we do with the `key`
attribute of views. So there is no reliable way to tell the system to
add a menu below the "Contact Us" menu of the website, as this is just a
menu copied when the website was created. We could obviously later add
a `key` field or something like that to identify an XML menu's copies.
Second, there is a workaround as one has to recreate the website.menu
and delete the original one (through a `<function/>` record).
Third, this should not be the main use case about menu creation in
themes.

----------

Some fields were also missing regarding the `website.page` model.

----------

A stable attempt is done at [1], this is where the current commit
originates from.
As the Odoo 17 release is quickly approaching, it was decided to first
write the proper IMP in master from which we will see what can be
backported and how, if needed.

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

Part-of: odoo/odoo#99099
2022-09-07 23:10:53 +02:00
Eleftherios Kritsotakis 41273923f8 [IMP] pos_loyalty, point_of_sale: settings integration with new loyalty module
After this commit, the settings of coupons, promotions,
gift cards and loyalty cards are now managed under a
single one field in PoS Settings configuration. Moreover,
this settings field is "global" and shared between the
eCommerce and Sales app.

task-2959620

closes odoo/odoo#99060

Related: odoo/upgrade#3842
Signed-off-by: Masereel Pierre <pim@odoo.com>
2022-09-07 23:10:48 +02:00
Víctor Martínez 8d8857928b [IMP] delivery: Add confirm to cancel shipment button to avoid doing it by mistake.
TT38655

closes odoo/odoo#98846

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-09-07 23:10:45 +02:00
damr f3974bea4b [IMP] project,*: improve user experience
This commit (and its enterprise equivalent) purpose is to smooth the
user experience and remove unnecessary steps.

The commits:
- Remove all stat buttons except the status and collaborators one from
  the project edit form.
- Add multiple small changes to string/name fo fields in views
- Change the custom O2M widget for a standard M2M for the management of
  child tasks
- Add the milestone field to the portal page of shared project.
- Remove the wizard 'marked_as_reached_milestone'
- Add the automatic generation of milestone when a SO is confirmed if
  some SOL need it

task-2941835

closes odoo/odoo#98546

Related: odoo/enterprise#30628
Related: odoo/upgrade#3798
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-09-07 23:10:37 +02:00
Dossogne Bertrand 0a8c3e7451 [IMP] hr_*: improve web application submission
hr_*:
hr
hr_contract
hr_recruitment
website_hr_recruitment

Increase UX and possibilities to postulate to a job on recruitement.
Also moves the model hr.contract.type from hr_contract to hr so that it
can also be used from hr_recruitment without having two models in parallel.

taskID 2898063

closes odoo/odoo#96551

Related: odoo/enterprise#29777
Related: odoo/upgrade#3861
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-09-07 23:10:25 +02:00
Odoo's Mergebot 37755283d0 [ADD] onboarding, *: enable appointment onboarding
* = base, calendar, google_calendar, microsoft_calendar

Purpose: Enable efficient Appointment Onboarding, not performed by company but at a global db level.

This PR enables:
* Track onboarding progress on a database scope (vs company) by introducing the `onboarding` module
* Easier configuration of external calendars with a modal instead of redirecting to "Settings"
  \+ on-the-fly connector modules install
* Basic support for the onboarding panel on the calendar view

See included commits for details.

Task-2852375
Part of Task-2900763

See odoo/enterprise#29139

closes odoo/odoo#97105

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-09-07 23:10:19 +02:00
Florian Charlier 2c4bb38835 [ADD] onboarding, base: manage onboardings
This technical module can be used to configure onboarding panels flows at
company or global level (required for new Appointment onboarding, see ENT PR).

This implementation, which should be able to support the migration of the
other onboardings, separates the closed state from the completion state
(allowing to know that steps are not completed even though the panel is
closed).

Basic tree and form view are included.

Adding an onboarding with this module requires to provide records data for the
models:
- `onboarding.onboarding` + action to close the panel
- `onboarding.onboarding.step` + actions for the 'opening' and 'saving' of each
 step.

See related ENT PR for the `appointment` example, in particular
`onboarding_data.xml` and `onboarding_onboarding.py`

Several python tests are also included.

Misc. In base, we slightly refresh the wording/style of the modal closing the
onboarding panel.

Task-2852375
Part of Task-2900763

Part-of: odoo/odoo#97105
2022-09-07 23:10:18 +02:00
Florian Charlier 6c73ed6f4b [REF] base,*: fix typo + privatize onboarding method
* = account, sale

- Fix typo
- Make private as very specific role
- Allows to grep similar functionality from new onboarding module and previous
common implementation of onboardings.

Task-2852375
Part of Task-2900763

Part-of: odoo/odoo#97105
2022-09-07 23:10:18 +02:00
Florian Charlier ba2b0020df [IMP] calendar, *: configure provider
* = google_calendar, microsoft_calendar, web

Purpose:
Allow to install appropriate module and configure calendar provider credentials
in fewer steps, without needing to go to general settings, etc.

This requires that both buttons are visible from the start.

In this commit, we also prepare the ability to extend this configuration wizard
for the appointment onboarding (see ENT PR).

Task-2852375
Part of Task-2900763

Part-of: odoo/odoo#97105
2022-09-07 23:10:17 +02:00
Florian Charlier 61e9d2c861 [IMP] base: add banner_route to calendar view attributes
Purpose:
Enable to add a banner to the calendar view. This is used to show the
appointment onboarding panel (see related ENT PR).

Task-2852375
Part of Task-2900763
See odoo/enterprise#29139

Part-of: odoo/odoo#97105
2022-09-07 23:10:17 +02:00
Mahamadasif Ansari 873a76b0cd [IMP] survey: set a code fallback instead of default field values
Currently, in a survey question, 'comments_message', 'validation_error_msg',
and 'constr_error_msg' fields have a default value. Because of it, they are
considered "user input" and not translated by default. So, the strings are
always printed in the source language and needs to be translated everytime.

This commit improves the behavior by removing the default strings, and instead
set them as code fallback wherever the fields are used, so that they only needs
to be translated once. Also, the same strings are added as a placeholder on
respective fields to make it more clear to the users that what should the value
in these fields look like. Apart from that, considering we now use a fallback
value, the "validation_error_msg" field does not need to be mandatory anymore.

task-2906052

closes odoo/odoo#98165

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-09-07 19:54:40 +02:00
tsm-odoo 7b10219d32 [FIX] mail: fix composer attachment upload test
Before this PR, the `remove an attachment..does not need any confirmation`
test would fail because the attachment was deleted while still
uploading. Since the abort controller does not work in the mock
server, the attachment would have finished its upload after its
deletion. This commit solves this issue by waiting for the attachment
to be uploaded before deleting it.

closes odoo/odoo#99758

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-09-07 18:57:00 +02:00
tsm-odoo 0954f0284c [FIX] mail: fix chatter attachment drop test
The chatter drop attachment test fails in an indeterministic manner.
This is because we're assuming that the next render will be the one
corresponding to the file uploading. In order to be sure this render
is really the one we're expecting, the `o-file-uploader-upload` event
is added.

closes odoo/odoo#99652

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-09-07 18:56:57 +02:00
Aaron Bohy a17c6d0250 [FIX] web: list & form: reload view after executing action
Before this commit, the form and list views didn't reload when an
action from the ActionMenu (formerly known as "toolbar") was
executed. For instance, go to Contacts (list) > select records >
Actions > Merge: the contacts are correctly merged, but the view
still shows the merged contacts.

Note: it worked well for "static" actions like Archive, Delete,
this fix only concerns "contextual" actions.

closes odoo/odoo#99680

Signed-off-by: Georis François (fge) <fge@odoo.com>
2022-09-07 17:26:45 +02:00
Benoit Socias fc168b17a8 [FIX] http_routing, website: render error page if 403 fallback fails
Since [1] the 403 pages displayed when a website page is restricted to a
different group of users is the default one instead of the website one.

After this commit 403 fallback errors are rendered by the default error
rendering.

Steps to reproduce:
- Go to a page. (e.g. "Contact Us")
- Select "Page Properties" in the "Pages" menu.
- Go to the "Publish" tab.
- Define visibility as "Some Users".
- Select a user group. (e.g. "Administration / Access Rights")
- Access to the same page in an incognito window.
=> The displayed 403 error page was the generic one instead of the
website one (with the navigation header...)

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

task-2963843

closes odoo/odoo#99671

X-original-commit: fc0a0c2ccea83b3a9a5df0e300eac1fe7eb7a2a2
Signed-off-by: Julien Castiaux <juc@odoo.com>
Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
2022-09-07 17:26:42 +02:00
Philippe Wauthy f77840cfc7 [IMP] hr(_holidays): improve department filters
In the Employees app, when using the department kanban view and clicking on the
Time Off Requests or Allocation Requests, it leads to a tree view but the department
from which the user comes from is not part of the filters.

This commit adds the department in the filters of the tree view.

Due to the search panel being present in the tree view, the department filter is removed from the list of
filters to avoid a duplication of the filters in the search panel.

task-2939207

closes odoo/odoo#97773

Related: odoo/enterprise#30358
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-09-07 12:41:09 +02:00
luvi 3d5b7010c0 [FIX] account: fix alignment of fields
This commit fixes the alignment of fields in the
setup wizard template. Since the conversion of those
fields, some parts of the DOM have been altered, and
the oe_inline class makes the inputs and selects
elements larger than it should.

After this commit, and its enterprise counterpart,
the UI is correctly aligned.

closes odoo/odoo#99675

Enterprise: https://github.com/odoo/enterprise/pull/31103
Related: odoo/enterprise#31103
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-09-07 11:25:55 +02:00
Denis Ledoux e2ffff1e42 [IMP] base: faster search on filters by re-ordering unique constraint
The domain used in `get_filters`, used in `get_views` is

```python
[('action_id', 'in', [action_id, False]), ('model_id', '=', model), ('user_id', 'in', [self._uid, False])]
```

Therefore filtering the filters on `action_id`, `model_id` and
`user_id`.

An index on `(action_id, model_id, user_id)` would therefore be welcome
in order to search quicker on filters.

The unique constraint `name_model_uid_unique` almost does it,
but it puts the name in first, and therefore the index is not used
when searching on the above domain.

By moving `name` to the end of the unique constraint,
the index created for this unique constraint becomes
usable for the above domain,
and it makes the SQL statement to search on filters way quicker.

Before:
```sql
EXPLAIN ANALYZE SELECT "ir_filters".id FROM "ir_filters" LEFT JOIN "ir_translation" AS "ir_filters__name" ON ("ir_filters"."id" = "ir_filters__name"."res_id" AND "ir_filters__name"."type" = 'model' AND "ir_filters__name"."name" = 'ir.filters,name' AND "ir_filters__name"."lang" = 'en_US' AND "ir_filters__name"."value" != '') WHERE (((("ir_filters"."active" = true) AND (("ir_filters"."action_id" in (225)) OR "ir_filters"."action_id" IS NULL)) AND ("ir_filters"."model_id" = 'account.move')) AND (("ir_filters"."user_id" in (2)) OR "ir_filters"."user_id" IS NULL)) AND TRUE ORDER BY  "ir_filters"."model_id" ,COALESCE("ir_filters__name"."value", "ir_filters"."name") ,"ir_filters"."id" DESC;
                                                                              QUERY PLAN
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
 Sort  (cost=3500.58..3500.59 rows=1 width=56) (actual time=12.940..12.942 rows=0 loops=1)
   Sort Key: (COALESCE(ir_filters__name.value, (ir_filters.name)::text)), ir_filters.id DESC
   Sort Method: quicksort  Memory: 25kB
   ->  Nested Loop Left Join  (cost=0.00..3500.57 rows=1 width=56) (actual time=12.933..12.934 rows=0 loops=1)
         Join Filter: (ir_filters.id = ir_filters__name.res_id)
         ->  Seq Scan on ir_filters  (cost=0.00..3499.02 rows=1 width=36) (actual time=12.932..12.932 rows=0 loops=1)
               Filter: (active AND ((action_id = 225) OR (action_id IS NULL)) AND ((user_id = 2) OR (user_id IS NULL)) AND ((model_id)::text = 'account.move'::text))
               Rows Removed by Filter: 100001
         ->  Seq Scan on ir_translation ir_filters__name  (cost=0.00..1.54 rows=1 width=36) (never executed)
               Filter: ((value <> ''::text) AND ((type)::text = 'model'::text) AND ((name)::text = 'ir.filters,name'::text) AND ((lang)::text = 'en_US'::text))
 Planning Time: 0.311 ms
 Execution Time: 12.972 ms
```

After:
```sql
EXPLAIN ANALYZE SELECT "ir_filters".id FROM "ir_filters" LEFT JOIN "ir_translation" AS "ir_filters__name" ON ("ir_filters"."id" = "ir_filters__name"."res_id" AND "ir_filters__name"."type" = 'model' AND "ir_filters__name"."name" = 'ir.filters,name' AND "ir_filters__name"."lang" = 'en_US' AND "ir_filters__name"."value" != '') WHERE (((("ir_filters"."active" = true) AND (("ir_filters"."action_id" in (225)) OR "ir_filters"."action_id" IS NULL)) AND ("ir_filters"."model_id" = 'account.move')) AND (("ir_filters"."user_id" in (2)) OR "ir_filters"."user_id" IS NULL)) AND TRUE ORDER BY  "ir_filters"."model_id" ,COALESCE("ir_filters__name"."value", "ir_filters"."name") ,"ir_filters"."id" DESC;
                                                                            QUERY PLAN
------------------------------------------------------------------------------------------------------------------------------------------------------------------
 Sort  (cost=14.44..14.44 rows=1 width=56) (actual time=0.086..0.087 rows=0 loops=1)
   Sort Key: (COALESCE(ir_filters__name.value, (ir_filters.name)::text)), ir_filters.id DESC
   Sort Method: quicksort  Memory: 25kB
   ->  Nested Loop Left Join  (cost=8.86..14.43 rows=1 width=56) (actual time=0.080..0.081 rows=0 loops=1)
         Join Filter: (ir_filters.id = ir_filters__name.res_id)
         ->  Bitmap Heap Scan on ir_filters  (cost=8.86..12.87 rows=1 width=36) (actual time=0.079..0.080 rows=0 loops=1)
               Recheck Cond: ((((model_id)::text = 'account.move'::text) AND (user_id = 2)) OR (((model_id)::text = 'account.move'::text) AND (user_id IS NULL)))
               Filter: (active AND ((action_id = 225) OR (action_id IS NULL)))
               ->  BitmapOr  (cost=8.86..8.86 rows=1 width=0) (actual time=0.078..0.079 rows=0 loops=1)
                     ->  Bitmap Index Scan on ir_filters_name_model_uid_unique  (cost=0.00..4.43 rows=1 width=0) (actual time=0.075..0.075 rows=0 loops=1)
                           Index Cond: (((model_id)::text = 'account.move'::text) AND (user_id = 2))
                     ->  Bitmap Index Scan on ir_filters_name_model_uid_unique  (cost=0.00..4.43 rows=1 width=0) (actual time=0.002..0.002 rows=0 loops=1)
                           Index Cond: (((model_id)::text = 'account.move'::text) AND (user_id IS NULL))
         ->  Seq Scan on ir_translation ir_filters__name  (cost=0.00..1.54 rows=1 width=36) (never executed)
               Filter: ((value <> ''::text) AND ((type)::text = 'model'::text) AND ((name)::text = 'ir.filters,name'::text) AND ((lang)::text = 'en_US'::text))
 Planning Time: 1.000 ms
 Execution Time: 0.121 ms
```

I take the opportunity to add the populate for `ir.filters`,
which helped me for the above analysis.

closes odoo/odoo#99657

Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
2022-09-07 11:25:52 +02:00
William Braeckman 90c035b70e [FIX] hr_org_chart: fix data not being reloaded
This commit fixes an issue with the org chart since it was converted to
owl, the data would not be reloaded when changing from record to record.
Instead it would always show the data from the first record it ever
loaded.

closes odoo/odoo#99618

Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-09-07 11:25:48 +02:00
Adrien Widart a32a0534cd [FIX] mrp: remove time off for a test
Since [1], a global time off is created in the demo data. Its date is
"today + 8 days". In `mrp`, the test `test_workcenter_timezone` tries to
plan some work orders for the next Monday:
https://github.com/odoo/odoo/blob/06e33207cdc6608e629a316fdddc35a15e08a3ad/addons/mrp/tests/test_order.py#L1882-L1883
So, if you install the demo data of `hr_holdiays` on Sunday and run the
test the day after, the global time off will prevent the slot
reservation by the work orders (and so it will lead to a failed test).

[1] e9bc5b9f36

closes odoo/odoo#99665

X-original-commit: efa48d90839b7bd8b5638f352d7846339e360ac2
Signed-off-by: Adrien Widart <awt@odoo.com>
2022-09-07 09:23:56 +02:00
Kevin Baptiste 6610e7e183 [IMP] hr_attendance: add camera choice for barcode scanner
Add new settings to allow the user to select which camera to use for the
barcode scanner and to allow/disallow the manual identification of
employees.

task-2973809

closes odoo/odoo#99622

Related: odoo/enterprise#31082
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-09-07 09:23:47 +02:00
FrancoisGe 3f94f5a0f6 [REF] web: convert attach_document to owl
closes odoo/odoo#99585

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-09-07 09:23:40 +02:00
Aaron Bohy 66d726bcb0 [IMP] web: tests: helper to allow FormViewDialogs in legacy
This commit introduces an helper that can be used in legacy tests,
when the tested flow opens a FormViewDialog (wowl). The helper
properly sets up the legacy environment to make the (wowl) dialog
service available, and spawns a MainComponentsContainer s.t. the
(wowl) dialog can open. This helper is already used by several grid
and timesheet_grid tests, and it might be useful in other cases
soon as we are currently removing the use of legacy FormViewDialog.

closes odoo/odoo#99582

Related: odoo/enterprise#31054
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-09-07 09:23:34 +02:00
Dossogne Bertrand f669c70e42 [FIX] hr_holidays: correct "current year" filter
Before this commit, the "Current Year" filter on the
time off analysis report showed records according to the
activeness of their status. This commit fixes that filter.

taskID 2951192

closes odoo/odoo#98826

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-09-07 09:23:28 +02:00
Dardenne Florent (dafl) 6436c209d6 [IMP] web: kanban: group tooltips asynchronous
The purpose of this commit is to increase the responsiveness of the kanban
by rendering the view as soon as possible.

Before the kanban view when grouped does orm call to fetch the tooltips.
The rendering of the kanban view is waiting for this orm call.

Now tooltips orm call is done asynchronously and the kanban view
is re-rendered once the call returns.

task-2721035

closes odoo/odoo#97816

Signed-off-by: Samuel Degueldre <sad@odoo.com>
2022-09-07 08:23:29 +02:00
William Braeckman 3dada389d4 [FIX] hr: Fix automatic employee creation
Introduced by #85428

closes odoo/odoo#99672

X-original-commit: e6cef5ab9ec189f1f0b86e21a1400859f021ba06
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-09-07 07:20:41 +02:00
Laurent Smet 8003310ccc [FIX] account: Fix ensure_one method called on 'self' instead of 'st_line'
closes odoo/odoo#99664

X-original-commit: f95000096c848aabb1990237390a659ed739f491
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
Signed-off-by: Laurent Smet <las@odoo.com>
2022-09-07 02:18:05 +02:00
Xavier-Do 5de336c651 [IMP] base: avoid user access rights check
No need to check access rights if we have no intersection with private
fields.

This is a small performance improvement since this value should be in
cache most of the time, but still usefull for tests.

closes odoo/odoo#99644

X-original-commit: db59dbdd7be12c6ea266d5abaf076cd189a2e7d8
Signed-off-by: Rémy Voet <ryv@odoo.com>
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2022-09-07 02:17:58 +02:00