519555054a mitigated an issue of being
able to try and download files which don't exist yet, make the fix
more reliable by clearing out the field completely and hiding the
content if the (readonly) field has no value *or the record is not
saved yet*.
Also clean up the code:
* an old-style forward port created a duplicate fixprovement
(a8d01cbf4e) which seems less correct
as it applies conditionally
* and the code is branchier than necessary, we can make it simpler by
judiciously leveraging jquery's API
closesodoo/odoo#77856
X-original-commit: 05db9be15d75dc0794095aad75c80d0c2e540808
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
The commit 590d0ca8 tried to center the o_cp_actions_menu but instead it
was spreading every direct child of the o_cp_bottom_left zone.
This commit puts the bottom left zone back to a left aligned flex layout
and puts an automatic left margin on the actions menu zone.
closesodoo/odoo#77852
X-original-commit: 4d5e64f04c421af554abbbde29d98278a6c27a1f
Related: odoo/enterprise#21457
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Signed-off-by: Bruno Boi <brboi@users.noreply.github.com>
Before this commit, absolute notation was not supported.
weekday, yearday and nlyearday were not supported either.
Some other computations did not work, or weren't tested for.
This commit re-introduce the support for all those features.
closesodoo/odoo#77851
X-original-commit: c423326a97060fb9132abcaf997ffba41a63b5fe
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
The goal of this commit is to remove the menu fade-in effect
on page load since we can now call the initAutoMoreMenu in
non-lazy JS code.
When 'initAutoMoreMenu' called, images won't be loaded yet,
that's why we add a class: '.o_menu_image_placeholder'
to set a default size on images and once all images are loaded,
we reupdate the menu.
task-2618929
X-original-commit: 6be166df24dedbe4729e1e7bfe6a302713932b74
Part-of: odoo/odoo#77843
The goal of this commit is to make initAutoMoreMenu fully
non-jquery and totally independant of other odoo utils.
task-2618929
X-original-commit: 7be1bb9083c786064fa140c811952e7735ce5539
Part-of: odoo/odoo#77843
Steps to reproduce :
- Install Sales
- Modify the report, use the theme "Clean" and the font "Open Sans"
- Modify the company phone to: +41 26 322 01 02
- Print a quotation
Issue :
Company phone is on 2 lines
Cause :
CSS issue with wkhtmltopdf.
Solution :
Replace CSS display value `inline-block` by `inline`.
ref commit: https://github.com/odoo/odoo/commit/5b022f433a44e627541d30ae21d7a867f4a3a6ff
opw-2567836
closesodoo/odoo#77647
X-original-commit: d462f13e0c1c04e792895bba9f2edfb35d9ee9d3
Signed-off-by: bon-odoo <nboulif@users.noreply.github.com>
Previously, the land page of Time Off was month view. When you select a leave from Month's view, you can edit/delete it directly.
Now, the land page is Year's view, and you can open the modal form of the leave, but it's not possible to delete it.
Add a delete button on the form view of the leave from the year's view of the dashboard
task-2638305
closesodoo/odoo#76080
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Let us assume we have a slow network and a (new) search bar with two
items, one of them expandable.
Before this commit, click to expand that item and then hover the other
item quickly would not end in a situation where the item is expanded.
This was due to a naive concurrency management in the (new) SearchBar
component.
In this commit, we allow to focus another item (via the mouse or the
keyboard) without cancelling an ongoing asynchronous operation.
closesodoo/odoo#77655
X-original-commit: 6fc0c5ee2d1d68bf82a034fe1744ac5673e522c9
Signed-off-by: Mathieu Duckerts-Antoine <Polymorphe57@users.noreply.github.com>
This commit removes all the 'extend' initially introduced to avoid code
repetition and ensure visual consistency across Bootstrap and Owl dropdowns.
Despite achieving the desired results, using 'extend' in this context
was seriously impacting the bundle generation time, probably due to an
underestimated amount of Apps' legacy-code applied on these elements.
In order to achieve the same results, the chosen strategy is to add
Bootstrap default classes directly into Owl dropdowns.
Also, it moves code related to bootstrap dropdown in 'webclient.scss',
leaving 'core/dropdown/dropdown.scss' for Owl code only.
Due to the discrepancies between Bootstrap and Owl html
structure, the '.dropdown-item' class could not have been added
directly to Owl's '.o_dropdown_item' itself, without refactoring
the Dropdown component structure.
// ==== Bootstrap 4.6 default Structure ================================
<div class="dropdown-menu">
<button class="dropdown-item" type="button">Action</button>
<a class="dropdown-item" href="#">Another action</a>
</div>
// ==== OWL default Structure before this commit =======================
<ul class="o_dropdown_menu">
<li class="o_dropdown_item">
<span>Action</span>
</li>
<li class="o_dropdown_item">
<a href="#">Another action</a>
</li>
</ul>
// ==== OWL Structure after this commit ================================
<div class="o-dropdown--menu dropdown-menu">
<span class="dropdown-item">Action</span>
<a class="dropdown-item" href="#">Another action</a>
</div>
// ==== web.assets_backend.css Bundle Generation Comparison ============
With all modules installed (enterprise edition over runbot):
Before this commit, bundle took ~2.5s and ~4s to generate and weighted ~322kB (~2.5MB uncompressed)
After this commit, it takes between ~1.2s and ~1.6s and weights ~257kB (~1.6MB uncompressed)
closesodoo/odoo#77649
X-original-commit: 84715436d87bb05b421bc9ccaacda67d07571690
Related: odoo/enterprise#21370
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Co-authored-by: Stefano Rigano <sri@odoo.com>
Co-authored-by: François Georis <fge@odoo.com>
Co-authored-by: Bruno Boi <boi@odoo.com>
Since commit a1f286916d o_cp_action_menus is not centered
anymore as justify-content: space-between; was removed from scss.
with this commit we are making o_cp_action_menus centered again.
task-2628050
X-original-commit: 590d0ca81382d4c3d6007bdf9bf65ed3a0ed795e
Part-of: odoo/odoo#77649
In some contexts, an error caught by the error service has no stack,
trying to annotate the stacktrace of this error with the Stacktrace
library crashes, masking the original error which is unwanted.
closesodoo/odoo#77421
X-original-commit: 347ddcc06e23d8f1a94c06379b2bfe104b116d90
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
This commit rewrites the pivot view template to make use of the view
layout component.
X-original-commit: ebb046c5b9b6b629fd6731a419c5b7daf57a9f7d
Part-of: odoo/odoo#77463
This commit rewrites the graph view template to make use of the view
layout component.
It also removes a duplicate test in the graph test suite.
X-original-commit: a9a65fd51a2317adc07bf3742f7edc360236d32e
Part-of: odoo/odoo#77463
This commit introduces a new component: the layout component.
Its purpose is to make abstraction of most generic components and
classes when writing a view template or an action.
To make use of this component, we also needed a new system to pass slot
from the parent of the layout to the control panel. This was done in a
hacky way and is meant to be replaced as soon as Owl provides a built-in
way to pass slots.
The control panel has also been slightly tweaked to default its props
from an environment's newly introduced key: the 'config'. This has been
done to reduce the amount of props passed to the layout and search
subcomponents.
X-original-commit: 3b29dd230acd961a72fb0cb971f9363958f65b60
Part-of: odoo/odoo#77463
Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
Before this commit, the search model would consider displaying a
search panel regardless of whether it had any sections.
Now, the search panel is considered non-displayable when there is no
sections.
X-original-commit: d3b191600b50fb052a956d1199730453789674e2
Part-of: odoo/odoo#77463
The identification of timedelta with relativedelta was wrong.
Here we define a class PyTimeDelta used by py.js to evaluate most
expressions in which datetime.timedelta and some operations producing
timedeltas occur.
The class PyTimeDelta allows to:
- create a timedelta
- add/substract two timedeltas
- multiply (divide) a timedelta by a float (resp. an integer);
- take opposite of a timedelta
- evaluate equalities between timedeltas and other expressions
- decide when a timedelta is "false"
- get total_seconds of a timedelta
In relation with that, we have improved the implementation of PyDate
and PyDateTime to allow most manipulations of datetime.date and
datetime.datetime producing/using timedeltas. It is now also possible to
evaluate equalities between dates/datetimes and other objects.
closesodoo/odoo#77453
X-original-commit: fcd4959a65a92e34ce986575c7fc279c195e9a11
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Signed-off-by: Mathieu Duckerts-Antoine <Polymorphe57@users.noreply.github.com>
The pivot and graph views have been rewrote in owl in [1]. However,
the former implemention has been kept as it is still used in some
cases (e.g. board application, studio, PieChart widget), but they
are lazy loaded [2].
Before this commit, both the new and former implementations mostly
shared the same DOM (in particular, their root element had the
same classnames). It means that the scss rules of an implementation
might interfer with the other, and vice versa.
This commit adds the "legacy" keyword in the root classnames of
those views, and properly namespaces the scss rules of legacy views
to properly dissociate the style of new and legacy views.
For the pivot view, we re-used the same scss file, so in this
commit, we duplicate it (one for the new view, the other, lazy
loaded, for the legacy view).
[1] 0134495ba5
[2] bd3cf85c841168dfd87f7166b545dd00d9b38bf4
closesodoo/odoo#77323
X-original-commit: 3862d5aae1df72d3585f915e8a2a2626322e74ad
Related: odoo/enterprise#21223
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Steps to follow
- Add an HTML field in the sales order line view
- Create a sales order
- Add a product
- Add a table with multiple rows in the HTML widget
- Add a new product
-> The new product isn't selected
Cause of the issue
The CSS selector used for finding the record to edit was taking all tr
element into account
Solution
Only select direct descendants of the tbody
opw-2632817
closesodoo/odoo#77380
X-original-commit: a8a0f38f5f45f18bc8221bf835d6e54ddabc471d
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Signed-off-by: Hubert Van De Walle <hubvd@users.noreply.github.com>
The option was available before but was forgotten when the graph view
was refactored.
closesodoo/odoo#77330
X-original-commit: 624fd812c5d6b01c0cc11e8620dc703dc0370f73
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Before this commit, the clickbot test failed when switching from
a dashboard view to a pivot, graph or cohort view, because the
condition to wait before toggling the filters in the next view was
wrong. As a consequence, we started to toggle the filters for the
next view on the dashboard view, so when we actually switched to
that view, the filter menu was closed and the tour was blocked.
The previous condition used the `.o_{view_type}_view` classname,
targetting the root node of the view (which appears in the DOM when
the view is loaded). Unfortunately, since [1] and the new
implementation of the graph and pivot views, we added root
classnames to graph and pivot (o_graph_view and o_pivot_view),
whereas it wasn't the case before. So when leaving a dashboard
view to a graph or pivot view, the former condition was directly
true (if the dashboard contained those views), and we didn't wait
for the next graph or pivot view to be loaded.
Note that the former implementation of the cohort view already added
the "o_cohort_view" classname on its root node, but it didn't make
the clickbot test fail because we don't have cohort views next to
dashboard views in standard actions.
This commit changes the condition to use the view switcher icons
instead.
[1] 0134495ba5closesodoo/odoo#77324
X-original-commit: bc53eebc8b9cd9f6e949bbe7e91ec2f98e5a0dfc
Signed-off-by: Mathieu Duckerts-Antoine <Polymorphe57@users.noreply.github.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Jinja as a templating engine was problematic in differents respect:
- introduce external dependency to Odoo (less controll)
- add another templating mechanism in the stack
- specific feature in qweb cannot be reused
- difficulty in rendering easily editable templates
- more knowledge required with no betterment
By replacing jinja with qweb we can now build tools to edit a qweb
that will work with the previously jinja encoded document
(essentially `mail.template` records).
There is a catch however. Some email fields (eg. email_to) used jinja
syntax for rendering dynamic variables (ie. ${object.something} and
${object.something_that_should_not_be_escaped | safe}).
We still want user to use dynamic variables for some char fields (eg.
subject, from, to, ...). We made a new rendering engine called
"inline_template" that will render an expression enclosed by `{{` and
`}}`.
To be able to edit the templates from the backend interface, a
plugin to the Odoo editor has been made for seamlessly edit the
document.
This qweb plugin includes:
- make dynamic variables (eg. `<t t-out="variable"/>`) not editable
(for preventing the user to shoot himself in the foot)
- group and hide related logical branching (ie. t-if, t-elif, and t-else)
in order to see only one at once
- a floating select input to switch visibility of a particular logical
branching
Task-27033
X-original-commit: odoo/odoo@68182baff4
Part-of: odoo/odoo#77377
Root components register a listener on env.qweb's "update" event (component.ts:constructor).
This means that every legacy ComponentWrapper does this and it proved to cause memory leaks.
This fix is two fold:
- the owlCompatibility code unregisters the handler on destroy, so that the production run is not impacted by the leak.
- the legacy test infrastructure also forces the unregistration. This is necessary because even though components are destroyed, the qweb singleton in legacy tests holds on to destroyed components' reference.
closesodoo/odoo#77285
X-original-commit: 89034cf597a418bfd35fdd71324415cdbf046a16
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Before this commit the scroll position in mobile mode were not kept.
This was because the scroll element was the body node.
After this commit, the scroll is saved and reused correctly as the reference
node is the html node.
This commit makes no sense without its enterprise counterpart. (https://github.com/odoo/enterprise/pull/21150)
closesodoo/odoo#77232
X-original-commit: 4957fd2ceec51ba3907a968bd0fce0512a57f3ac
Related: odoo/enterprise#21196
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Steps to follow
- Go to the variant tab of a product
- Add an attribute and click search more
- Select the checkbox at the top to select all records from the current page
- Click on Select all
- Click on Select
-> Only the records from the first page are added
Cause of the issue
`getSelectedRecords` doesn't return the record from all pages
but only from the current one
Solution
If the domain is selected, use all the records
opw-2586877
closesodoo/odoo#77228
X-original-commit: 963ccf1b4f3bb82c974af2ac0e47344c0ce060ac
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Hubert Van De Walle <hubvd@users.noreply.github.com>
In javascript, Error.stack is not standard so it could be undefined on
some browsers.
This commit fixes possible crashes when we perform some operations
on error.stack.
closesodoo/odoo#76917
X-original-commit: f8bc701e78b31f90a30baebe734290f6202a0af9
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
These helpers and component should be moved to web_dashboard, which is the only
place they are used. Also, we want to avoid setting a precedent by putting these
in web.
closesodoo/odoo#76912
X-original-commit: 7f4bc27702844cf9b9f010a4ab3c1ac077442ecc
Related: odoo/enterprise#21042
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Before this commit, the positioning of the dropdown (which is powered as a poppover)
was executed all the time.
This commit prevents this behavior in mobile, assuming there is not enough space anyway
to have a proper fixed position and that we should use scrolling instead.
closesodoo/odoo#77206
X-original-commit: 1271ef80fafa4438271af0919dcca229aa20bf81
Related: odoo/enterprise#21191
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Before this commit, using a do_action that throws an error opened two
error dialogs.
To solve this, in the compatibility layer, we check that the error has
not already been thrown.
To reproduce the problem, you can execute an action using do_action
which will return an error. For example, an action performing an rpc
and the server returns an error.
You can find an example scenario to test the problem on the 2618694.
closesodoo/odoo#77148
X-original-commit: 582604990e28c329348475f373b03295903ed77e
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Before this commit, the useTooltip hooks didn't call clearInterval
when the component using it was unmounted/destroyed. In practice,
it wasn't an issue because the only component using it was the
webclient, and it is never destroyed. However, for this hook to be
usable in other contexts, it is important to remove this leak.
closesodoo/odoo#77113
X-original-commit: d076afd035ad8fadc5a0774c6c0eec15acb15026
Related: odoo/enterprise#21147
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Allowing to specify components inside tooltips to obtain dynamic
and/or html content was a bit overkill and unnecessary: a template
can do the trick and it is easier to define.
This commit thus renames attribute "data-tooltip-component" into
"data-tooltip-template" (the name of the qweb template) and
introduces the "data-tooltip-info" attribute (its value is then
available in the template under the "info" variable).
X-original-commit: 8683a8d762339451e3d9f8706aac86da80510b37
Part-of: odoo/odoo#77113
In [1], we rewrote the effect feature in the wowl infrastructure.
However, we lost something in the process: the "type" of effect
(basically "rainbow_man" as it is the only implemented effect)
became a mandatory param, whereas before it simply defaulted to
"rainbow_man" when not set. As a consequence, previously defined
effects in views could crash.
This commit fixes that issue, and reworks a bit the feature by
introducing a registry of effects, which easily allows to add new
effects from the outside. An effect is a function that may return
a Component (and its props) to display.
Most of the diff in the tests is about moving files where they
should be (the effect feature being in core/, the tests must be
in core/ as well, and not depend on the webclient).
[1] 0573acae23
Task 2652927
closesodoo/odoo#77109
X-original-commit: 74dc3f654ee5849982b494e46eefb1fc2b4e0c74
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
current_date was absent from py_builtin. For that reason, it was
impossible for the search model to evaluate a dynamic domains like
"[('date_deadline', '<', current_date)]"
We add current_date to py_builtin.
closesodoo/odoo#77035
X-original-commit: ade082c5ad9221c82de90ddbe68b814b1487753d
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
The class PyDateTime did not have a method to_utc. For that reason, it was
impossible for the search model to evaluate a dynamic domains like
"[('date', '>=', (datetime.datetime.combine(context_today(), datetime.time(0,0,0)).to_utc()))]"
We implement that method.
X-original-commit: 3ad9a3be64da78d596ee3dc435d4b224728a9e76
Part-of: odoo/odoo#77035
In order to be able to easily patch Date in py_date_tests and elsewhere,
we refactor the code of the legacy and new patchDate functions.
X-original-commit: 0e697c82be80cae9cc993b4be179fec42b8dae83
Part-of: odoo/odoo#77035
Before this commit, the translation alert might briefly appear in
form views displayed in dialogs (on new records), just before the
dialog closes.
Task 2639227
closesodoo/odoo#77002
X-original-commit: c9aa20160cd8b1bc9c9bdcd34bb996b8dfefc291
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This commit replaces the control panel dropdowns with the new <Dropdown/> component, in order to get consistent through the new/legacy views (because the current Odoo version is in a state where some views uses the new infrastructure and some others are still not converted - see odoo/odoo#73311).
The diff seems massive, but it is mostly due to tests adaptations.
closesodoo/odoo#77001
X-original-commit: d679cd0d8ba9a2420e81a42a698763e9be2327e1
Related: odoo/enterprise#21077
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
This commit deploys some of the new OWL infrastructure services to the
legacy OWL environment.
The deployed services are the UI and hotkey ones.
These are needed because they are the only prerequisites for the new <Dropdown/>
component to get instanciated with the legacy OWL environment.
As the new reporting views infrastructure has been merged (see odoo/odoo#73311),
the current Odoo version is in a state where some views uses the new
infrastructure and some others are still not converted.
So instanciating the new <Dropdown/> component in the legacy OWL env is
something we chose to do in order to get consistent within the control
panel dropdowns behaviors.
X-original-commit: 6f1ab1cd861549484f94a8d40a16ccf338d7dffe
Part-of: odoo/odoo#77001
Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Since commit 0134495ba5 the reporting
views pivot, graph, cohort are written in full new framework.
Some applications still need the legacy ones, so this commit just implements
the lazy loading of those views.
In stock, report_stock_forecasted has been adapted in order to avoid having
a GraphView override: we now modify the canvas' height in pure JS.
*: board, stock
closesodoo/odoo#76931
Related: odoo/enterprise#21054
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
When an event is currently being inspected by the user, i.e. the popover
is displayed and the user clicks somewhere else on the calendar, we do
not wish to open the quick create menu, only close the popover.
However the code that handled that case was not adapted to the regular
calendar view, only the one from the calendar app and would remove all
data currently displayed.
This commit fixes that issue.
TaskId-2652219
closesodoo/odoo#76939
X-original-commit: ea5c7b643be8c902b03a2ae175c051c479e45ed9
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Since https://github.com/odoo/odoo/commit/344d82ca251bbba8f54e85d6b881cc92f8823f13 :
The `web_editor` module is no longer installed by default in default
databases since it now depends on the `mail` module. This caused a few
bugs inherent to the base modules to surface:
- in the `mock_server` file: performRpc was synchronous and threw
uncaught errors;
- in the webclient scss: the body did not have an assigned with and
height of 100%, which caused some positioning issues.
This commit fixes these problems in the base modules.
closesodoo/odoo#76921
X-original-commit: bc1b14ff8a7d412fbbc5987ed57e2d4cdd00a0a0
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Consider the following scenario on a slow network in a graph view:
- add a filter (triggers a reload)
- toggle a measure (triggers another reload, before the first one
completes)
Before this commit, the new searchParams coming from the first
reload were lost, even though they were still displayed in the
search view.
This commit ensures that we keep the last searchParams when
reloading the graph view.
closesodoo/odoo#76918
X-original-commit: 1719de73099eca0b765237cb47caf44813157b94
Related: odoo/enterprise#21046
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
By convention, views pass the model instance in props to the
renderer. Moreover, when the renderer needs to perform actions
outside of its natural scope, those callbacks have to be given in
props as well, s.t. the renderer can call them directly (instead
of triggering an event, listened by the parent).
This commit also adds the props validation on the PivotRenderer.
X-original-commit: 0ca538eba780aacca44ab4e34c56d8eed22fa333
Part-of: odoo/odoo#76918
This commit simplifies the props of the GraphView. We only keep
props that are necessary (e.g. for the dashboard view), and for the
others, we find the information in the arch. That way, there's only
one way to do, which is easier to understand.
We also remove the "display" and "title" props from pivot as they
weren't used.
X-original-commit: c26953ef15b0846282bbeccd7cf0de25e1a47392
Part-of: odoo/odoo#76918
The debug item "Edit ControlPanelView" is only available if there is
a control panel in the current view.
closesodoo/odoo#76862
X-original-commit: 68cb8d23e2011ed359fc54f3deed6c84290d5c3b
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>