Commit Graph
153865 Commits
Author SHA1 Message Date
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
Raphael Collet 7a248f5933 [IMP] base: add test to measure the installation of a language on a database
The main purpose of the test is to provide statistics for the runbot, in
order to detect unexpected variations in the loading of translations.

closes odoo/odoo#99636

Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2022-09-07 02:17:53 +02:00
tsm-odoo 29bd02e9b8 [FIX] bus: fix im status service listeners
The im status service subscribes to the `become_main_tab`,
`no_longer_main_tab` events.

Since the PR improving the multi tab service, the multi tab
itself is not an event target anymore but exposes a bus instance
that should be used to subscribe to those events.

The im status service is still based on the first version (that was
using env.bus) which means the event will never be received. This
commit fixes this issue.

closes odoo/odoo#99635

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-09-07 02:17:50 +02:00
Alexandre Kühn b5ce1e39d7 [IMP] mail: Improve Emoji Picker (step 2)
Improvements:

- Much more emojis in the emoji picker (more than 1800 emojis, up from 81)
- Fuzzy search bar to find emoji in the emoji picker

Known limitations:

- Emoji visual is based on browser/OS, so some emojis may not be visible on some devices

Task-2957928

closes odoo/odoo#99343

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-09-07 02:17:47 +02:00
Laurent Stukkens (LTU) fc705d423e [FIX] project: display fields in the right order in list view
Prior to this commit and since odoo/odoo#98913 and odoo/odoo#95729
the `xpath` that are using `company_id` in the views that inherit
`project.view_task_tree2` and `view_task_form2` are no more working
as the `xpath` targets the first match.

This commit fixes this issue.

closes odoo/odoo#99232

Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-09-07 00:04:49 +02:00
Pierrot (prro) 8e857752a2 [IMP] account: improve Journal Items reconciliation view
Clean the action for reconciliation view for the correct handling of it.

Removes the group by Matching in the Journal Items reconciliation
list.

Now includes all linked reconciliation account_move_lines for a better
representation of spaghetti reconciliation.

task-2959808

closes odoo/odoo#98827

Related: odoo/enterprise#30702
Signed-off-by: Laurent Smet <las@odoo.com>
2022-09-06 22:31:16 +02:00
Odoo's Mergebot e3eb7d9bef [MERGE] (account_)payment,*: extract accounting logic from payment
The goal of this work is two-fold:
- First, it aims at clarifying the role of the `account_payment` module
in regard to the `payment` module. The former was meant to
single-handledly handle invoice payments but it failed to do so:
the logic responsible for portal payments was split in two parts with
the main part being located in the `account_payment` module, and the
dangling parts being scattered all over the `payment` module;
regarding payment links, they were not handled by the `account_payment`
module at all.
- Second, it increases the modularity of the `payment` module by
promoting it to the role of a true "engine" that can work without the
Invoicing/Accounting app and, therefore, that can be installed
in standalone and used by community apps that don't depend
on the `account` module.

To meet these objectives, everything that is account-related is moved
to the `account_payment` module while the dependency of the `payment`
module to `account` is removed.
The business features are kept untouched by overriding the hooks already
present in `payment` for the `sale` module.
Doing so allows for some code cleaning with, for example,
`account.payment.method.line` records being automatically created as
new payment acquirer modules are installed rather than having them
override lots of methods and load data files to achieve the same result.

Task-2786690

See also:
- https://github.com/odoo/enterprise/pull/29945
- https://github.com/odoo/upgrade/pull/3832

closes odoo/odoo#97047

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-09-06 22:31:07 +02:00
Odoo's Mergebot 06a044aa57 [MERGE][IMP] website_event_*: improve event compatibility with website editor
# Purpose
Make the event front-end more aligned with other apps and add a few UX imps in the meantime.

# Specifications
- In place of setting default background and color we use the ones setting by the theme or chosen in the website editor by the user
- Avoid raising a traceback with the website editor when editing a datetime with the wrong format.
- When creating a new event from the frontend we round the start and end datetime.
- Fix a typo in template (extra point in ellipsis)

# Link
task-2845417

closes odoo/odoo#91883

Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2022-09-06 22:31:05 +02:00
Jérémy Hennecart (jeh) a205e0b3d8 [FIX] web: remove warning on daterange
Apply the moment format to the start and end date to avoid
raising a warning.

task-2845417

Part-of: odoo/odoo#91883
2022-09-06 22:31:04 +02:00
Jérémy Hennecart (jeh) 8c0bfcc340 [IMP] {website_}event{_meet}: small imp frontend and backend
- Now the start datetime and the location of an event is not editable
in the frontend editor.
It does not make really sense to change the location and for the
datetime it could lead to some Validation error as we don't know
in the card view the end datetime.

- Fix a display issue in the backend kanban view when the
location is too long and not inline with the icon.

- Align correctly the number of people in a community room

task-2845417

Part-of: odoo/odoo#91883
2022-09-06 22:31:04 +02:00
Jérémy Hennecart (jeh) 4fa73dc531 [IMP] website_event: round default datetime
Add default date_begin and date_end when creating an event.
To avoid having weird time (like 11:23) we round date_begin
to the nearest 30 minutes range and the date_end is set to
the next day of date_begin.

So for example if now is "2022-06-30 10:12" then:
date_begin = "2022-06-30 10:30" and date_end = "2022-07-01 10:30"

task-2845417

Part-of: odoo/odoo#91883
2022-09-06 22:31:04 +02:00
Jérémy Hennecart (jeh) 8285c2a6d1 [IMP] website_event(_*): refont frontend based on colors chosen
This commit removed static background color and the like in all event
modules. Since it's possible to configure colors from the website_editor,
we should used these ones in the frontend.

When an element is superposed on the background we used the later with a
mix of the primary color to have a demarcation and a better visibility
based on the colors chosen.

task-2845417

Part-of: odoo/odoo#91883
2022-09-06 22:31:03 +02:00
Jérémy Hennecart (jeh) 9f9a474add [IMP] event: remove an extra point in ellipsis
Remove an extra point from the ellipsis.

task-2845417

Part-of: odoo/odoo#91883
2022-09-06 22:31:03 +02:00
svs-odoo 3cd9c51254 [FIX] barcodes_gs1_nomenclature: False in search
Before this commit, search for product without barcode while GS1
nomenclature is enable causes a traceback.

To reproduce:
- Install `stock_barcode` and enable GS1 nomenclature;
- Make a search for `product.product` with following domain:
  [('barcode', '=', False)]

While triyng to parse barcode, it will encounter an error because it
will try to decompose the barcode (as a GS1 barcode can have multiple
data) and to know if there is something to process, it will check the
barcode length.
As the barcode is `False` in this case, there is no length.

closes odoo/odoo#91807

Related: odoo/enterprise#27547
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2022-09-06 22:30:46 +02:00
svs-odoo 2dc0db286d [IMP] stock: WH/OUT/00005 without qty_done
Before this commit, the delivery WH/OUT/00005 had 16 `qty_done` for the
product "Desk Combination".  Now it has no `qty_done`.

task-2666478

Part-of: odoo/odoo#91807
2022-09-06 22:30:46 +02:00
svs-odoo 7df34e5137 [IMP] stock: stock.picking.type views
* Names form view's groups to inherit purpose (in `stock_barcode`);
* Cleans a little bit the views' template.

task-2666478

Part-of: odoo/odoo#91807
2022-09-06 22:30:46 +02:00
svs-odoo 7e79713a16 [MOV] stock: picking type views in its own file
Part-of: odoo/odoo#91807
2022-09-06 22:30:45 +02:00
svs-odoo fc5d1fe149 [IMP] stock: backorder wizard
Replaces <p> by <div> and gives a name to the first paragraph to make an
override easier (for now, overrided by `stock_barcode`).

task-2666478

Part-of: odoo/odoo#91807
2022-09-06 22:30:45 +02:00
Mathieu Duckerts-Antoine 122190b31b [FIX] web: lower precedence for globalContext keys
Go to Project -> Reporting -> Timesheets and Planning Analysis and
select other measures in the pivot view via the "Measures" menu.
After that create a new favorite.

Result: the favorite is saved with the correct measures but the
pivot view will never use those measures. This is due to the presence
of the key "pivot_measures" in the action context.

(Note that the same problems occurs with other keys and other views)

We fix that problem by giving less precedence to keys in action contexts
with respect to those found in the search item contexts as it was
originaly the case in legacy views (cfr. __get method in action_model.js).

opw-2945969

closes odoo/odoo#99631

X-original-commit: 4528f562923cd0524f257f3a9c1ecd0002fd49b7
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-09-06 21:24:10 +02:00
Thibault Delavallée 2b2ccab0b6 [FIX] mail: fix broken multi _message_compose_with_view
Returning after first loop iteration has the sad side effect of
somehow breaking batch version of methods.

Oversight of odoo/odoo@0ea27f430c

closes odoo/odoo#99630

X-original-commit: 6d6dbe16d4570372fe5fd3d28ebe5c43b646d3bc
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-09-06 21:24:07 +02:00
Bruno Boi 48511c148e [FIX] web: make a parse smart date test pass
- Name of the test
"utils > dates > parse smart date input"

- Before this commit
The test makes a comparison between the result of parse utils,
which yields luxon's DateTime objects in the user's local TZ
(patched by default to UTC+1 in the testing env), and locally
created DateTime objects in UTC.
This has no sense to compare a date in UTC with another in UTC+1.
The test was thus failing when ran between 11pm and 0am.

- After this commit
The test has been refactored.
Also, even if it has no impact on the parsing result, the local function
parseSmartDateInput now use a DateTime object in local TZ.
This has been done in order to avoid future confusion.
If you're wondering why it has no impact, it is because this function is
used in parseDate(Time), which always sets the local TZ at the end:
```
const a = {
  foo: luxon.DateTime.local(),
  bar: luxon.DateTime.utc(),
};
a.foo.equals(a.bar.setZone("default")); // true
```

closes odoo/odoo#99616

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-09-06 21:24:01 +02:00
Prakash Prajapati bd7f6df4af [FIX] hr: fix the traceback when click on a resource
Steps to reproduce:
-Install planning
-Go to Gantt View
-Click on resource avatar

task-2960247

closes odoo/odoo#99551

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-09-06 21:23:55 +02:00
David Monjoie f163958330 [REF] web_editor: merge insertion commands into one
Prior to this commit, we had three insertion commands:
* insertText: takes a string and insert a text node containing it
* insertHtml: takes a string, convert it to elements on the fly and insert them
* insertFragment: takes a fragment element and insert it in the dom

With this commit, we now have a single one polymorphic command `insert` that
accepts two types of arguments:
* string: inserts a text node with the provided string as text
* node:  insert the provided node in the dom

The new `insert` command does **not** support the previous case of `insertHtml`
which used to convert string into html on the fly. No more magically hidden
conversions ! No more need to construct a fragment yourself like was needed for
`insertFragent` either. If you need to convert string into html, notably for
hardcoded fixed html, you can use the `parseHTML` util which returns a frament
containing the parsed nodes which can be given to `insert` directly..

closes odoo/odoo#99536

Related: odoo/enterprise#31081
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-09-06 21:23:49 +02:00
Aaron Bohy d2bfac8552 [FIX] web: kanban: no quick create icon when quick_create="0"
Before this commit, the "+" icon was displayed in kanban columns
even if the attribute "quick_create" was set to false in the arch.
With this commit, we correctly takes that attribute into account.

closes odoo/odoo#99626

Signed-off-by: Samuel Degueldre <sad@odoo.com>
2022-09-06 19:20:45 +02:00
Didier (did) 683f9be971 [FIX] mail: fix traceback with empty message body
This PR fix a traceback that occure when the message body is empty (eg: only
uploading an attachment).

closes odoo/odoo#99625

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-09-06 18:23:00 +02:00
Denis Ledoux 443b1e1576 [IMP] base: back-end views, remove attributes unused by the web client
In back-end views, the attributes
- attrs
- states
- invisible
- readonly
- required

are transfered to the `modifiers` attribute.
The web client only uses this `modifiers` attribute.
Hence, the above attributes which gets transfered
to the `modifiers` attribute can be safely removed
from the architecture sent to the web client.

In addition, in case the modifiers were all falsy
e.g. `{'invisible': False, 'readonly': False, 'required': False}`
`simplify_modifiers` was simplifying these modifiers to
`{}` and `modifiers="{}"` was set on the node,
which is a bit useless and waste transferred bytes.

This allows to gain some KB for all `get_views` calls.

For instance, with only `account_accountant` installed,
`get_views` of `account.move` goes
from 228.01 KB to 208.78,
therefore sparing 10% of KB for each calls.

An example using the `res.partner` form:

Before:
```xml
<field name="is_company" invisible="1" on_change="1" modifiers="{&quot;invisible&quot;: true}"/>
<field name="commercial_partner_id" invisible="1" on_change="1" modifiers="{&quot;invisible&quot;: true, &quot;readonly&quot;: true}" can_create="true" can_write="true"/>
<field name="active" invisible="1" on_change="1" modifiers="{&quot;invisible&quot;: true}"/>
<field name="company_id" invisible="1" on_change="1" modifiers="{&quot;invisible&quot;: true}" can_create="true" can_write="true"/>
<field name="country_code" invisible="1" modifiers="{&quot;invisible&quot;: true, &quot;readonly&quot;: true}"/>
<field name="company_type" widget="radio" options="{'horizontal': true}" on_change="1" modifiers="{}"/>
```

After:
```xml
<field name="is_company" on_change="1" modifiers="{&quot;invisible&quot;: true}"/>
<field name="commercial_partner_id" on_change="1" modifiers="{&quot;invisible&quot;: true, &quot;readonly&quot;: true}" can_create="true" can_write="true"/>
<field name="active" on_change="1" modifiers="{&quot;invisible&quot;: true}"/>
<field name="company_id" on_change="1" modifiers="{&quot;invisible&quot;: true}" can_create="true" can_write="true"/>
<field name="country_code" modifiers="{&quot;invisible&quot;: true, &quot;readonly&quot;: true}"/>
<field name="company_type" widget="radio" options="{'horizontal': true}" on_change="1"/>
```

closes odoo/odoo#99619

Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
2022-09-06 16:22:57 +02:00
tsm-odoo 0f9b11a025 [REM] mail: remove obsolete wait until event parameter
The `waitUntilEvent` start helper parameter has become obsolete. Indeed,
events are systematically awaited by the `openDiscuss`/`openView`
helpers. This commit removes this parameter.

closes odoo/odoo#99577

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-09-06 15:22:59 +02:00
Victor Feyens 3ae178780c [FIX] account_payment: do not check journals for custom acquirers 2022-09-06 14:14:07 +02:00