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>
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
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
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
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
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
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
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
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
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
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
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
*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>
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>
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
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
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
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
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
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
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
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
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
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
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
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
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.
closesodoo/odoo#96419
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
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/commitsclosesodoo/odoo#96111
X-original-commit: 7a5e9b280ad10f52f5412505aa7fb250011a12ef
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Josse Colpaert <jco@odoo.com>
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
closesodoo/odoo#96477
X-original-commit: ca933667e2b5e1633f08555b2852dcf30a4a11ab
Signed-off-by: Masereel Pierre <pim@odoo.com>
Signed-off-by: Yolann Sabaux (yosa) <yosa@odoo.com>
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.
closesodoo/odoo#96497
X-original-commit: c725c3fbb29eff49eff3794aff9d407175599e63
Signed-off-by: Xavier <xbo@odoo.com>
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
closesodoo/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>
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
closesodoo/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>
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
closesodoo/odoo#96484
X-original-commit: 31ac34816e61d66479dbd11ebb9c5348c3f12886
Signed-off-by: Christophe Simonis <chs@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
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
closesodoo/odoo#96454
X-original-commit: 8e6eae7b2a3e6da195e4283a008a14d8296539b4
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
*: 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
closesodoo/odoo#96447
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
*: 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
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.
closesodoo/odoo#96439
X-original-commit: 486b7f92318e64242613a07ea5ff365748dd713b
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
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
closesodoo/odoo#96433
X-original-commit: 4cc40661ed3287e15ea21cedf8e2a582e32be5c8
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
There was an issue with this fix.
This reverts commit 8ebb44420c3e2dcc0d990d2646486654b4b2955d.
closesodoo/odoo#96421
X-original-commit: 29f0c7635c900324631fe3562399c3ced5bc15f7
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
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).
closesodoo/odoo#96360
Signed-off-by: Pierre Paridans (app) <app@odoo.com>