Commit Graph
152817 Commits
Author SHA1 Message Date
+2 bc0a0cead6 [IMP] web,*: enable owl list & form views
The new list and form views were merged recently [1], but they
weren't activated because they weren't 100% ready yet. This is now
the case. This commit adds those views to the view registry. As a
consequence, a lot of qunit tests and tours needed to be adapted,
mostly for selector changes.

We also add legacy list and form views to the view registry, with
keys 'legacy_list' and 'legacy_form'. This allows to force those
legacy views when necessary. For instance, we did it in views
using complex custom legacy x2many field widgets that haven't been
converted yet (we have a compatibility layer but it isn't complete
and doesn't support every advanced usecases).

[1] odoo/odoo#92475

Part-of: odoo/odoo#78221
Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Bruno Boi <boi@odoo.com>
Co-authored-by: Géry Debongnie <ged@odoo.com>
Co-authored-by: Samuel Degueldre <sad@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Simon Genin (ges) <ges@odoo.com>
Co-authored-by: Francois (fge) <fge@odoo.com>
Co-authored-by: Michael Mattiello (mcm) <mcm@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Lucas Perais (lpe) <lpe@odoo.com>
Co-authored-by: Jorge Pinna Puissant <jpp@odoo.com>
Co-authored-by: luvi <luvi@odoo.com>
2022-07-22 16:21:45 +02:00
Jorge Pinna Puissant 6994ccb31f [IMP] web: BasicModel: improve the performance of context eval
Before this commit, the evaluation of the context was done for all
the context, even when only a subset of the context was needed.

Now, we evaluate only the attributes of the context that are used.

Part-of: odoo/odoo#78221
2022-07-22 16:21:45 +02:00
Géry Debongnie 5329b9a9ae [IMP] web: prevent toPyDict from iterating on keys
The `toPyDict` method is used to transform an object into a "python" dictionary,
by returning an equivalent object with the PY_DICT object in the prototype chain.
In practice, it is called everytime we create an evaluation context.

This is a performance problem, since creating the context is not cheap in the
case of Odoo form views: we need to iterate on all the values of the current
record, checking for each changes, applying all relational operations, ...
And even worse, almost all of the domains that we need to evaluate have very
simple conditions, which just needs to check the value of one field. So, it is
useful to make the computation of the eval context keys lazy, and this commit
make sure that pyjs does not undo the lazyness of the eval context, if any.

Part-of: odoo/odoo#78221
2022-07-22 16:21:45 +02:00
Mathieu Duckerts-Antoine c5a8c4414c [FIX] web: load legacy x2many subviews
In a view form, legacy x2many fields with no view inline would not have
their subviews loaded. We fix that.

Part-of: odoo/odoo#78221
2022-07-22 16:21:44 +02:00
Mathieu Duckerts-Antoine 1d61d68207 [FIX] web: processing of field mode attribute
The view mode in which to display a legacy x2many field in a new form
view was badly processed. This lead those fields to be not renderered at
all (no list or kanban renderer displayed) or be renderered with the
wrong renderer in mobile mode. We fix that.

Part-of: odoo/odoo#78221
2022-07-22 16:21:44 +02:00
Mathieu Duckerts-Antoine 182b241e7d [IMP] web: support of fieldDependencies
Sometimes a field component might need to know some other fields values
to render itself or for other purposes. In legacy, a mechanism allowing
to load some field values not displayed was available: a field would
declare a fieldDependencies object specifying some field names and
their types and the related values would be loaded along the other data.

Here we introduce the same mechanism for the new views.

Note that in a new view list, the tag widget is not currently supported
so that we have remove some lines in the list arch parser that were
useless.

Part-of: odoo/odoo#78221
2022-07-22 16:21:44 +02:00
FrancoisGe ce61a35cf8 [FIX] web: crash when an arch as tree inside another tree
Before this commit, if an arch contained a tree which itself contained
a tree, the parser would crash.

The reason for this crash is that the parser was trying to parse the
second tree with the model of the first. So it didn't know the fields.

The solution is to stop the exploration of children when it is not
necessary. For example, for fields, it is not necessary to explore
the children, it is parseFieldNode that takes care of it.

Part-of: odoo/odoo#78221
2022-07-22 16:21:44 +02:00
Lucas Perais e3a54289ac [FIX] web: useViewButtons: add beforeExecute param
This rev allows the function built by the useViewButtons hook to take
a beforeExecute callback at call time, in addition to the existing
beforeExecuteAction callback that we can pass to the hook, at the
function's build time.

The rationale for this is to allow any caller to prevent the execution
of the action represented by the clickParams at the call level. It is
useful to check if a user is allowed business-wise to execute an action.

Part-of: odoo/odoo#78221
2022-07-22 16:21:43 +02:00
Samuel Degueldre 6ebf19b189 [FIX] web: fix statusbar field not displaying correct value in mobile
Previously, the statusbar field didn't display the currently selected
value for selection field in mobile, as the getter to compute the name
of the currently selected item only accounted for the many2one case but
not for the selection field case.

This commit adds handling for the selection field case and a test for
it.

Part-of: odoo/odoo#78221
2022-07-22 16:21:43 +02:00
Samuel Degueldre 3562946bf3 [FIX] web: fix many2one quickcreate in legacy fields in new views
Previously, legacy many2one fields and their extensions in new views
were unable to quick create records, this is because the compatibility
layer between the legacy fields and the relational/basic_relational
model is incomplete. This commit adds code to handle this specific case

Part-of: odoo/odoo#78221
2022-07-22 16:21:43 +02:00
FrancoisGe 91c32bb980 [FIX] web: X2m with custom controller
The goal of this commit is to allow an X2m in list mode with a custom
controller to use the controller context when creating a new line with
a 'tab' keydown.

Part-of: odoo/odoo#78221
2022-07-22 16:21:43 +02:00
FrancoisGe 415746602f [FIX] web: ListView with a class
This commit adds the ability to set a class on a list view.
This class will be added at the same level as "o_list_renderer".

For example:
    <tree class="myClass">
        ...
    </tree>

Part-of: odoo/odoo#78221
2022-07-22 16:21:42 +02:00
FrancoisGe f670df3693 [REF] web: ListRenderer: extract function for inheritance
This commit defines a "displayOptionalFields" getter that can be
overriden to force the presence of the optional column dropdown.
For instance, this is necessary in enterprise to add an item to
promote Studio.

Part-of: odoo/odoo#78221
2022-07-22 16:21:42 +02:00
Jorge Pinna PuissantandSamuel Degueldre 2c9db825c1 [REF] base,web,*: convert settings form view to owl
*hr_timesheet,point_of_sale,website

This commit moves the settings form view implementation from base
to web, and converts it to owl.

The setting's search has been improved to take into account more
elements. Before, it was possible to only search on the field's
labels. Now, we can also search on the field's description, and
the titles of setting's group.

Part-of: odoo/odoo#78221
Co-authored-by: Samuel Degueldre <sad@odoo.com>
2022-07-22 16:21:42 +02:00
Simon Genin (ges)andluvi 350ad39d51 [REF] account: convert fields to owl
This commit converts the following fields to owl:
 - account_resequence_widget
 - grouped_view_widget
 - account-tax-totals-field

Part-of: odoo/odoo#78221
Co-authored-by: luvi <luvi@odoo.com>
2022-07-22 16:21:42 +02:00
Aaron Bohy 24e8e10b34 [FIX] web: LegacyField: correct mode and hasReadonlyModifier
Before this commit, legacy fields spawned in wowl views didn't
receive the correct "mode" and "hasReadonlyModifier" params. They
do now.

We do not add qunit tests for this, as tours already identified the
issues, and it only concerns legacy fields that we'll soon remove
anyway.

Part-of: odoo/odoo#78221
2022-07-22 16:21:41 +02:00
Aaron Bohy d3662d370c [FIX] web: editable list: can edit legacy many2one
Have an editable list view with a legacy many2one field (for instance,
an extension that hasn't been converted to wowl yet). Before this
commit, the edited row was unselected when the user clicked in the
many2one dropdown to select a value. The reason is that legacy
many2ones use jQuery autocomplete, that puts the dropdown directly in
the body, which is obviously not inside the table.

We do not add a qunit test for this, as it only concerns legacy
fields that are about to be removed, and it is tested in tours
anyway.

Part-of: odoo/odoo#78221
2022-07-22 16:21:41 +02:00
Aaron Bohy 46e8188443 [FIX] web: fix action menus layout issue
Before this commit, when there were more than one action menu (in
a list or form view), e.g. "Print" and "Actions", they weren't
displayed in the same line.

Part-of: odoo/odoo#78221
2022-07-22 16:21:41 +02:00
Samuel Degueldre 7b9b04f0a9 [FIX] web: fix form labels showing even when they should be invisible
Previously, if a label for a field had an invisible attr which should
cause it to be invisible, and it was not at the top-level of a group, it
would be rendered even when it shouldn't. This was caused by the fact
that when we compile the form arch, we don't copy the t-if attribute
from the original label when generating the FormLabel component.

This happens to work when the label is at the top level of a group,
because when compiling a group, if anything at the top-level of a group
has a t-if, we move it from the node itself to the t-set-slot that gets
generated for the FormGroup component before we would generate the
FormLabel.

Part-of: odoo/odoo#78221
2022-07-22 16:21:41 +02:00
Samuel Degueldre 7ff03baca2 [FIX] web: FormView: add o_xxs_form_view className on small screens
The form view is styled differently on small screens, and those rules
are based on the presence of the "o_xxs_form_view" className. This
commit correctly toggles it.

Part-of: odoo/odoo#78221
2022-07-22 16:21:40 +02:00
Lucas Perais 6a73b3e7ff [FIX] web: form: fix ButttonBox More dropdown style
Before this commit, the More dropdown button of the ButtonBox
(which displays stat buttons) was broken i.e. the more button
was on another line because its size was wrongly set.

After this commit, the style is corrected, every button of the Box
is on the same line.

Part-of: odoo/odoo#78221
2022-07-22 16:21:40 +02:00
Lucas Perais 8ca03fb6e3 [FIX] web: form: the status bar must be present if in arch
Before this commit, when the status bar did not have buttons to display
it was not displayed at all.

After this commit, we display it even if there are not any button inside.

Part-of: odoo/odoo#78221
2022-07-22 16:21:40 +02:00
Lucas Perais 042e1a5c30 [FIX] web: form: form header should end up in sheet_bg
Before this commit, the header declared in a form's arch was not injected
at the right place.

After this commit, the header's elements are put as children of the sheet_bg element
if present.

Part-of: odoo/odoo#78221
2022-07-22 16:21:40 +02:00
Lucas Perais (lpe) d3f26c4aab [FIX] web: MainComponentContainer updates when registry changes
Before this commit, adding a component in the main component registry
after the initial mount did not work that is, the MainComponentContainer
never rendered the new component.

After this commit, adding a component to the registry works as expected.

Part-of: odoo/odoo#78221
2022-07-22 16:21:39 +02:00
Lucas Perais 3c7ace02df [FIX] web: layout: banner should not be in o_content
Part-of: odoo/odoo#78221
2022-07-22 16:21:39 +02:00
Aaron Bohy 8dda736df4 [FIX] web: FormViewDialog: fallback on LegacyFormViewDialog
It might happen that one wants to spawn a FormViewDialog with a
view that has a js_class, and the corresponding js code hasn't
been converted to owl yet (it is still an extension of the legacy
FormView). Before this commit, when that happened, the control
panel buttons of the form view weren't moved to the footer of the
dialog, because this isn't supported with legacy views. This
commit is a workaround, as it fallbacks on the legacy FormViewDialog
in this situation.

Without this commit, the main flow tour fails.

Part-of: odoo/odoo#78221
2022-07-22 16:21:39 +02:00
Mathieu Duckerts-Antoine 1c344b8955 [FIX] web: MonetaryField: can take 0 value
Before that commit a zero value for a monetary field would be wrongly
considered invalid. This would block many flows (e.g. a save).

Part-of: odoo/odoo#78221
2022-07-22 16:21:39 +02:00
Lucas Perais 2320eccf4d [FIX] web: MonetaryField: input should be visible
Before this commit, the monetary input was invisible because its
width was 0.

After this commit, the input is visible.

Part-of: odoo/odoo#78221
2022-07-22 16:21:38 +02:00
Lucas Perais c0a67682cb [FIX] web: AceField: reset ace lib only if editor's element has changed
Before this commit, the ace editor crashed when switching to edit mode or
when clicking in it.

After this commit, it works as expected.

Part-of: odoo/odoo#78221
2022-07-22 16:21:38 +02:00
Géry Debongnie b4063a1e73 [IMP] web: update owl from 2.0.0-beta-14 to 2.0.0-beta-16
Release notes:

https://github.com/odoo/owl/releases/tag/v2.0.0-beta-15
https://github.com/odoo/owl/releases/tag/v2.0.0-beta-16

Details:

- fix: lifecyle_hooks: correctly wrap errors in async code
- imp: use a custom error class for all errors thrown by owl
- fix: package.json: remove browser value
- ref: component_node: slightly simplify code
- fix: components: fix cause left unset when thrown object is not Error

Part-of: odoo/odoo#78221
2022-07-22 16:21:38 +02:00
Yannick Tivisse 3bfcf83db7 [IMP] hr_holiday: Ensure persistence of number_of_hours_display
Purpose
=======

Base the number_of_hours_display on the company calendar instead of the
employee calendar to avoid modifying the informative allocated value
in case of a working schedule change.

closes odoo/odoo#96419

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-07-22 10:22:48 +02:00
Josse Colpaert 4e6f88fd44 [IMP] l10n_pe: add document type nota de debito boleta electronica
For them, we are going to add the corresponding type of document, as was done in the credit notes

This is a fw-port, but it had to be done in community instead of enterprise
https://github.com/odoo/enterprise/pull/27180/commits

closes odoo/odoo#96111

X-original-commit: 7a5e9b280ad10f52f5412505aa7fb250011a12ef
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Josse Colpaert <jco@odoo.com>
2022-07-22 08:01:39 +02:00
Yolann Sabaux cad6cae93e [FIX] pos_coupon: correct unit_price for rewardProduct
Steps to reproduce:
- set a pricelist: discount, global, 10%
- set promotion program: free product
- In pos, select the product

Issue:
The product is deducted at its lst_price and not at the discounted price such as in `Sales`.

opw-2892748

closes odoo/odoo#96477

X-original-commit: ca933667e2b5e1633f08555b2852dcf30a4a11ab
Signed-off-by: Masereel Pierre <pim@odoo.com>
Signed-off-by: Yolann Sabaux (yosa) <yosa@odoo.com>
2022-07-21 20:28:50 +02:00
hieu 19549afdfc [FIX] project: fix access error when internal user access to project
form

Before this commit, when the internal user without any access rights to
the Project app and has a link to access to the form view of a "public"
project, an access error is occurred when that user when to access to
the
project form view. The reason is the `project.collaborator` is only
accessible to the user with an access right to the Project App and since
the number of collaborators displayed in a stat button is computed with
the access rights of the current user, the compute cannot be done for
the
internal user.

This commit executes the compute is superuser to prevent the user having
access error and to correctly access to the project form view as before.

Steps to reproduce the bug:
--------------------------
1) Create a Project P and add *Marc Demo* in the followers of that
project
   if the Privacy Visibility is "Invited internal users".
2) Remove the access rights to the Project app for *Marc Demo* user.
3) Copy the link to the form view of project P.
4) Log in as *Marc Demo*.
5) Paste the link copied in step 3 to access to the form view of project
P.

Actual Behavior:
---------------
An access error is occurred because the user without any access to the
Project app cannot access to the `project.collaborator` model.

Expected Behavior:
-----------------
The internal user without any access rights to the Project App should
access
to the form view of the project P.

closes odoo/odoo#96497

X-original-commit: c725c3fbb29eff49eff3794aff9d407175599e63
Signed-off-by: Xavier <xbo@odoo.com>
2022-07-21 12:29:47 +02:00
Nshimiyimana Séna 901c9521e2 [FIX] crm: duplicate 'lost' button on a lead's form view
Currently,  two lost buttons will appear, if you go to the form view of a lead that has 100% probability. The difference between the two duplicated "Lost" buttons is that one ask for a "lost reason" before marking a lead/opportunity as lost, the other does not.

After discussing with the PO for CRM, it appears that the button that asks for a "lost reason" should not appear on a lead. This commit makes the necessary changes to reflect that behavior.

opw-2886623

closes odoo/odoo#96486

X-original-commit: 707bddefdc5604db3304afa3633a0b90027f78b4
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Nshimiyimana Serge Séna (sesn) <sesn@odoo.com>
2022-07-21 11:20:49 +02:00
Dieter Reinert 9946c252d6 [CLA] signature for DieterReinert
closes odoo/odoo#95074

X-original-commit: 4ec9769eb177593daea6dba417da813158f5ba64
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-07-21 11:20:46 +02:00
Géry Debongnie 23caf8b96f [IMP] web: update owl from 2.0.0-beta-12 to 2.0.0-beta-14
Release notes:

https://github.com/odoo/owl/releases/tag/v2.0.0-beta-14

Details:

- [FIX] compiler: better handle update of properties with same value

closes odoo/odoo#95804

Related: odoo/enterprise#29350
Signed-off-by: Samuel Degueldre <sad@odoo.com>
Signed-off-by: Géry Debongnie <ged@odoo.com>
2022-07-21 10:19:42 +02:00
Samuel Degueldre bebc565269 [FIX] web: m2oautocomplete in some weird cases
Part-of: odoo/odoo#95804
2022-07-21 10:19:42 +02:00
Joseph Caburnay 6107e07971 [IMP] point_of_sale: automatically validate the order if fully-paid
Only when the total payment is exactly the order's total price.

closes odoo/odoo#93694

Related: odoo/enterprise#28433
Signed-off-by: Masereel Pierre <pim@odoo.com>
2022-07-21 09:15:46 +02:00
Hubert Van de Walle (huvw) 96c2716674 [FIX] stock: history back on the forecast report
Steps to reproduce:

  - Go to stock > Replenishment
  - Click on a forecast report widget
  - Go back using the browser arrows
  -> The page is redirected to another forecast report and the
  breadcrumbs are cleared

Cause of the issue:

  The forecast report action uses the `window.history.pushState` to
  add the active model in the url.
  When going back, the new url is the same one but without the active
  model.
  We can get the correct behavior by doing `window.history.go(-2)` in
  the console.

Solution:

  Use `history.replaceState` instead

opw-2917725

closes odoo/odoo#96487

X-original-commit: b39dc5488bacb704aaa60f1a502bf005d57f3276
Signed-off-by: Steve Van Essche <svs@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2022-07-21 01:53:47 +02:00
Hubert Van de Walle (huvw) c21101c161 [FIX] account: mobile: unable to add lines to misc journal
Steps to reproduce:

  - Load odoo on a small screen / mobile phone
  - Go to accounting > Miscellaneous Operations
  - Click on create
  -> The button to add a line in Journal Items is missing

Cause of the issue:

  On mobile, the kanban view is used for Journal Items
  The kanban view used [0] has an attribute `create="false"`

Solution:

  Override the `create` attribute when the kanban view is a subview

[0]: https://github.com/odoo/odoo/blob/93520cc291ffb76dd1425e413f29653df37b4062/addons/account/views/account_move_views.xml#L94

opw-2870637

closes odoo/odoo#96484

X-original-commit: 31ac34816e61d66479dbd11ebb9c5348c3f12886
Signed-off-by: Christophe Simonis <chs@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2022-07-21 01:53:44 +02:00
William Braeckman 11938424c3 [FIX] website_sale: prevent adding archived products to cart
Prevents adding archived products to the cart.

TaskId-2925397

closes odoo/odoo#96483

X-original-commit: 623014802e643e19eb61966c5f639e2b04ff9e81
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-07-21 01:53:41 +02:00
William Braeckman 42f0dd02ae [FIX] website_sale: fix test_05_google_analytics
This commit increases the timeout for some steps in the
`google_analytics_view_item` tour.
The step would time out semi-regularly due to a timeout.

TaskId-2925407

closes odoo/odoo#96454

X-original-commit: 8e6eae7b2a3e6da195e4283a008a14d8296539b4
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-07-21 01:53:35 +02:00
Alexandre Kühn ac39fe6768 [MOV] im_livechat, *: Refactor JS Public Livechat (step 8)
*: website_livechat

This commit is a step towards refactoring the JS of public livechat,
so that it reuses the same architecture as the code of Discuss.
This implies code that uses JS models and OWL components.

Task-2925850

closes odoo/odoo#96447

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-07-21 01:53:32 +02:00
Alexandre Kühn 8840b37989 [IMP] im_livechat, *: Refactor JS Public Livechat (step 8)
*: website_livechat

This commit is a step towards refactoring the JS of public livechat,
so that it reuses the same architecture as the code of Discuss.
This implies code that uses JS models and OWL components.

Task-2925850

Part-of: odoo/odoo#96447
2022-07-21 01:53:32 +02:00
Nguyen Hong Quang 53ebbf92b4 [FIX] web: fix ratio in many2many_avatar widget
Currently in many2many_avatar widget, image shrink with that container,
make avatar user looking weird. Specially with vertical portrait image
and 1:1 ratio image.

This PR will fix this kind of bug UI.

closes odoo/odoo#96439

X-original-commit: 486b7f92318e64242613a07ea5ff365748dd713b
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-07-21 01:53:28 +02:00
Nicolas Bayet 3cc0fb8339 [FIX] web_editor: style qweb element in odoo editor
Before this commit, the styles for the qweb elements
(t, t-if, t-out, ...) were not applied.
This commit apply them except when converting html to inline
styling.

task-2892193

closes odoo/odoo#96433

X-original-commit: 4cc40661ed3287e15ea21cedf8e2a582e32be5c8
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-07-21 00:50:45 +02:00
Arnaud Joset 144377a016 [FIX] web: remove duplicated key in calendar view
https://github.com/odoo/odoo/commit/57dbfff2db9053276a293d9a20bd8636f10100cc introduced a duplicated key
in calendar view.

closes odoo/odoo#96426

X-original-commit: 4560beab43571454439a932c5f27082254104283
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Arnaud Joset <arj@odoo.com>
2022-07-21 00:50:42 +02:00
pedrambiria 8b6341c1ff [REV] google_calendar: not sending emails to existing event attendees"
There was an issue with this fix.

This reverts commit 8ebb44420c3e2dcc0d990d2646486654b4b2955d.

closes odoo/odoo#96421

X-original-commit: 29f0c7635c900324631fe3562399c3ced5bc15f7
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-07-21 00:50:39 +02:00
Simon Genin (ges) aba9f9d25b [FIX] base: restore partner's kanban badge hover effect
This commit fixes the background/text color inversion when hovering the
badge in the Partner's Kanban cards.

This was due to the missed conversion of `.badge-pill` class in BS5,
which removed it in favor of the more generic `.rounded-pill`. For
simplification, the selector is adapted to the more generic `.badge`
(independantly to its form).

closes odoo/odoo#96360

Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2022-07-21 00:50:23 +02:00