apply new control panel styling from sri
remove o_dropdown_menu_right (looks unused)
remove o_dropdown_inline (this is a regression for small screens, apparently we would like to have this possibility on smaller screens. This does not break mobile usage but Mobile styling is still a bit weird though)
fix systray activitymenu in mobile (issue was introduced with 29731b40)
fix subdropdown flickering (before this commit, parent dropdown was in absolute positioning, making the position hook generate flicker, now it it fixed from the beginning)
Part-of: odoo/odoo#73311
Both "__count__" and "__count" can be encountered as measure notations
in reporting views. Typically, "__count__" is used in legacy views and
"__count" in new views. The problem is that both can now be found on
legacy or new side (think of favorite contexts for example). It is thus
necessary to write some compatibility code on each side. Here me
introduce an helper to help in that task.
Part-of: odoo/odoo#73311
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
The reporting views (cohort, graph, and pivot) currently compute and show
the measures in similar but slightly different ways. The present commit
brings some tools that will be used to harmonize their behavior and
factorize the code via a common template and a utility function.
Part-of: odoo/odoo#73311
A simple High Order component that is able to get the actual
Field class in the category "fields" registry
It takes as minimal props:
- record: an object containing the fields key: a meta description of fields
- name: the field name
- type: the widget type name that xould select the right key in the registry
closesodoo-dev/odoo#1018
Related: odoo-dev/enterprise#206
Signed-off-by: Mathieu Duckerts-Antoine <Polymorphe57@users.noreply.github.com>
Part-of: odoo/odoo#73311
The component ViewWidget allows to deal with the "widget" attributes on view arch's nodes
It retrieves the actual widget component via the registry's category "view_widgets"
It is roughly equivalent to _renderWidget in legacy.
Part-of: odoo/odoo#73311
This commit introduces lib-like functions to help transforming
a view arch to an owl template.
compile_lib contains standalone functions that for the most part
can be applied on individual XML nodes to retrieve information
or to apply standard behavior on them.
compile_nodes contains standalone function that transform a arch node
into a viable Owl template one.
Part-of: odoo/odoo#73311
The ControlPanel now supports being passed an object "bottom-content" in its display props.
That Object is constituted by a component and by props to pass to it.
The bottom content of the Control panel is rendered as a Slot within that component
If not present, the ControlPanel continues to display its bottom part as usual
Part-of: odoo/odoo#73311
We refactor the action service and allow the legacy and new views to share
a global state within a same action.
We introduce two new components View and WithSearch along with
the search infrastructure: ControlPanel, FilterMenu,...
Part-of: odoo/odoo#73311
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: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Michaël Mattiello <mcm@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Lucas Perais <lpe@odoo.com>
Co-authored-by: Jorge Pinna Puissant <jpp@odoo.com>
Co-authored-by: Stefano Rigano <sri@odoo.com>
This commit adapts the "old" Owl Datepicker to work with the new Owl
web client. The behaviors have been mostly preserved (i.e. working
with the bootstrap datepicker) and simply adapted to make use of the
new services and registries.
The previous datepicker template and tests have been marked as "legacy".
Part-of: odoo/odoo#73311
HumanNumber now correctly rounds the number according to decimals (bug with value < 1000 eg: 0.02)
It also correctly keeps `decimals` significant figures whatever powers of 10^3 it should keep
The monetary formatter now passes the currency's digits to human number
Part-of: odoo/odoo#73311
This commit re-introduces the date formatter to go along with its
datetime counterpart, as well as a few tests.
It also refactors the date parsers to make proper use of the arguments
passed to the functions, namely to alter the timezone.
Part-of: odoo/odoo#73311
Before this commit readGroup was actually calling web_read_group.
With this commit, readGroup calls read_group, and webReadGroup
calls web_read_group, as expected.
Part-of: odoo/odoo#73311
Reintroduce the SampleServer class with some modifications:
- it uses luxon instead of moment
- it uses the registry from core folder instead of a dedicated one
A util function is also provided to help the construction of a fake orm
using the sample server in order to get sample data.
Part-of: odoo/odoo#73311
Co-authored-by: Samuel Degueldre <sad@odoo.com>
Co-authored-by: Lucas Perais (lpe) <lpe@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Jorge Pinna Puissant <jpp@odoo.com>
This function must be used to parse boolean attributes from archs.
If returns false if the attribute is set to "False", "false", "0"
or "", true otherwise.
Part-of: odoo/odoo#73311
This hook automatically generates custom tooltips (instead of
native ones) for all elements with the "data-tooltip" attribute
set, inside the component using it. The optional attribute
"data-tooltip-position" can be used to enforce a specific tooltip
position.
This commit also makes the WebClient use this hook.
Part-of: odoo/odoo#73311
Co-authored-by: Lucas Perais (lpe) <lpe@odoo.com>
This is actually not what we want. It changes the behavior of
the favorite menu: when the user deletes an item, a confirm dialog
opens, but we want the dropdown to remain visible.
Part-of: odoo/odoo#73311
Before this commit, the new webclient 'Domain' module only supported
arrays for domains constructed with an 'in' operator.
Now, it also supports any primitive, that will then be wrapped in an
array.
Part-of: odoo/odoo#73311
Partially revert b0c325 removing rules defining '<a>' children as
exceptions. Indeed, to have a child wrapping the entry's content (either
<a> or <span>) is now considered the norm.
This commit will extend bootstrap 'dropdown-item' design to any
'o_dropdown_item' child rather than on 'o_dropdown_item' itself.
Part-of: odoo/odoo#73311
With this commit we passes messageIsHtml as a prop while calling notification
service when links is available, so that if message has html content then it is
displayed well formatted.
For example: Inventory -> Operations -> Replenishment -> click 'Order Once' button
it will show notification but the link is displayed as string like <a href=.../>
if message has HTML then it should properly displayed.
task-2591451
closesodoo/odoo#74571
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Steps to follow
- Install web_dashboard,website_sale
- Go to the eCommerce Dashboard
- Click on Favorites
- Click on Add to my dashboard
- Go to the Dashboard app
- Click on orders
-> A traceback occurs
Cause of the issue
`this.subscriptions.update` is undefined
opw-2630849
closesodoo/odoo#75984
X-original-commit: 8ab700fc8e51631663443b6c8e81db9669375d82
Signed-off-by: Hubert Van De Walle <hubvd@users.noreply.github.com>
When using profiling on a fresh test database, it can be tedious to
access settings to enable the feature. This commit adds a wizard to help
enabling profiling without accessing the settings when trying to
activate profiling on a administrator session.
closesodoo/odoo#75967
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
Currently, if a test fails there's very high chances the DOM will not
be clean, because qunit doesn't have good cleanup APIs. This means a
test failure will always be prefixed by a dump of the page DOM which
is just confusing and makes it hard to find the actual error.
This change updates the OdooAfterTestHook handler to:
* Receive the `Test` itself, instead of adding more information to the
synthetic object it currently receives.
* Only show the leftover DOM if the test otherwise succeeded.
* Do the entire reporting via `pushFailure`, rather than having
duplication between an explicit `console.error` and a test failure.
* Update the QUnit.log handler to
- not show `undefined`
- try to improve readability by removing the bracketing and quoting
closes odoo/odoo#75951
Forward-port-of: #75939
X-original-commit: 8bceac8032f48ae77e8a2c0c038f3bc26489e0ac
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
On my system in chrome 92 there are issues of chrome's hitboxes (and
rounding) being off leading to tests failures, something which given
the adjustment in `triggerMouseEvent` had been an issue in the past.
The first test failure was / is in the "correctly display year view"
calendar test, where the very first event dialog would fail to open
when clicking on the `2016-11-16`.
After tracing through fullcalendar, it turned out fullcalendar was
told to hit `2016-11-*09*`, suspiciously 7 days before the cell we
were looking for in a monthly calendar, hinting to an incorrect
vertical offset / hitbox.
Fix by offsetting the top coordinate in `triggerMouseEvent`, but
rather than just increment by one update the entire thing by trigger
the event right in the middle of the element being targeted, that
seems more reliable long-term, though it could be slightly confusing
for events like mouseenter/mouseover/...
The second issue was with a list test, where two cells are supposed to
be sized equally. Apparently the offset sizes are supposed to be the
rounded version of the actual size (which can be fractional), but
dumping the information of `foo` and `text` I'd get real widths (via
getBoundingClientRect) of respectively 480.46875 and 480.5, and
offsetWidths of 481 and 480 (the smaller of the two in "real size"
is rounded higher than the other one).
In Python we might use `assertAlmostEqual` for this, but we've
apparently not introduced this in JS take the real width and round up
by hand, this fixes the issue as both end up at 481.
Aside 1:
Before finding out the actual root cause I landed in
`_onYearDateClick` with missing data in the events so looked at the
API to figure what I was looking at, and turns out fullcalendar's
event object has documented properties to get the date-converted start
and end bounds of the event, so use that directly instead of doing the
same thing by hand.
Aside 2:
The attributes passed to `triggerEvent` in `triggerMouseEvent` are
pretty much nonsensical, we're getting the element's location using
`getBoundingClientRect` which is based off of the viewport, but
setting the keys
* `screen(X|Y)`, which should be the location of the hit relative to
*the physical screen*
* `page(X|Y)`, which should be the location of the hit relative to the
page / document (so takes in account the content scrolled off-screen)
* `layer(X|Y)`, which is the position of the hit relative to the
nearest positioned (non-static) element, falling back to page if
there isn't one
The one attribute which matches the semantics / reference of
`getBoundingClientRect` we didn't even set, instead it would be
automatically copied from `pageX`/`pageY` by the events mapping.
Fix that by just providing `clientX`/`clientY` and updating the
mapping functions to not overwrite it.
If the others are needed they should be computed properly based on the
document's bounding client rect and scroll information, as well as the
window's screenX/screenY (and offsetParent for layerX/layerY though
that seems unlikely to be necessary).
closesodoo/odoo#75953
X-original-commit: d26a4edffd6bdaed46143a30e99f17eb91f44e7e
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Since we change the editor for the comments on invoices,
The layout was a bit broken with some unwanted spacings.
task-2586137
Part-of: odoo/odoo#75863
The service is called `notifications` when mocked in tests,
instead of `notification`
closesodoo/odoo#75859
Related: odoo/enterprise#20554
Signed-off-by: Vincent Schippefilt (vsc) <vsc@odoo.com>
In the spreadsheet app, we need the exact same values which are saved
for "ir.filter" records.
This commit refactor a bit things to allows getting those values without
actually creating the "ir.filter" record.
Task 2572184
Part-of: odoo/odoo#75859
Co-authored-by: LucasLefevre <lul@odoo.com>
Purpose
=======
Time Off : New Dashboard, Accruals feature, Public holidays, New time off type configuration view.
- Review of Dashboard
- Accrual feature : Currently, when you create an allocation, it's possible to create an
Accrual, but there is no appraisal Plan. An Appraisal plan is use to define steps of accruals
for each employee.
In Belgium, we use accrual Allocation for European Leaves, or compensatory hours, it's a
simple use case. But in USA, it's possible to change the calculation mode each year.
Also, in USA, it's possible to deal your accrual plan when you arrive on the company. It's a
HR Officer task to create the right Accrual allocation for each new employee.
- Public Holidays :
Improvement of global time off feature located on Working hours calendar. Now, Time off
application have to manage Public Holidays.
- Review of Time Off type configuration
COM PR: https://github.com/odoo/odoo/pull/72511
ENT PR: https://github.com/odoo/enterprise/pull/19157
UPG PR: https://github.com/odoo/upgrade/pull/2791
TaskID:2475413
closesodoo/odoo#72511
Related: odoo/enterprise#19157
Related: odoo/upgrade#2791
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Co-authored-by: William Braeckman <wbr@odoo.com>
Co-authored-by: Xavier BOL (xbo) <xbo@odoo.com>
Co-authored-by: Laurent Stukkens (LTU) <ltu@odoo.com>
Co-authored-by: Yannick Tivisse <yti@odoo.com>
Before this commit, when loading a view containing a searchbar on a
tablet, the device's keyboard is appearing once the searchbar's field is
autofocused.
Thanks to the backport of the mobile OS detection (see PR
odoo/odoo#75455 ), we are now able to properly target mobile OS
(independent of the screen's resolution) instead of only small screens.
closesodoo/odoo#75880
X-original-commit: b1a7296f060811153039ef73140e78ea702088a1
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Signed-off-by: Pierre Paridans <pparidans@users.noreply.github.com>
During the refactor of the comparison feature, the pie_chart widget was forgotten
(commit: be5a51a345)
Before this commit, the pie_chart widget did not support timeRanges any longer
After this commit it does again.
closesodoo/odoo#75878
X-original-commit: 4f64cd724ad2a58a35dadf382b10dab74e1c0559
Related: odoo/enterprise#20564
Signed-off-by: Mathieu Duckerts-Antoine <Polymorphe57@users.noreply.github.com>
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Change the command palette shrotcut from CTRL+K to CTRL+M,
in order to avoid conflict with link creation shortcut in editor.
task-2635043
closesodoo/odoo#75828
Signed-off-by: Bruno Boi <brboi@users.noreply.github.com>
* = crm_livechat, hr, hr_holidays, im_livechat, mail_bot, purchase, sms,
snailmail, survey, test_discuss_full, test_mail, web_editor, website,
website_livechat
- Create new model `mail.guest` for guests.
- Rewrite some RPCs to target routes rather than model methods so that
guests are able to use them.
- Patch JS and python models to support guests.
- Create a stand-alone page and boot the channel in it.
task-2494829
closesodoo/odoo#75496
Related: odoo/enterprise#20417
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Before this commit, every view had to have its own rules to avoid
breaking the control panel when there was an horizontal scroll.
a) We now always use 'overflow-x: auto' to be able to scroll the content
of the view if there is not enough space available.
However, we doesn't want double vertical scroll; one for the page and
another one for the content. It's why we added visible to the previous rule:
"overflow-x: auto visible".
b) overflow: visible; is the default value. We simply deleted this line.
c) We need to set height: 100%; to allow the pivot view to grow when a
dropdown pops out. Otherwise, it will be cutted.
Steps to reproduce:
* Go to Sale
* Select the 'Pivot' view
* Add 'Customer' to group horizontally
* Scroll to the right => BUG
Task ID: 2232265
closesodoo/odoo#75826
Related: odoo/enterprise#18121
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Following commit 118ddcace0.
a few console.log escaped the attention of the reviewer.
This commit removes them.
closesodoo/odoo#75832
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
This commit enables the zoom on mobile.
To avoid any issue in website, we first only activate it in the backend.
Note that it's not, strictly speaking, a zoom. It only shows the
original size of the picture.
Steps to reproduce:
* Open Employee
* Select an employee
* Touch on the photos
closesodoo/odoo#75785
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
ISSUE ADDRESSED
- Open Project > Tasks > Gantt view
- Click the ADD button to open the form dialog
- Fill the form and click on SAVE&NEW button
- Fill again the form and click on SAVE&CLOSE button
- Both tasks are created, but only the first has been planned, because the second one has lost a part of the context (plan dates...)
BEFORE
Opening a form view dialog without passing a _createContext method (see commit c14b17c485 where it was introduced) was still passing an empty object additionalContext argument when save&new was hit.
This was leading to not take into account the full context (see BasicModel._getContext).
AFTER
If no _createContext method is passed to a form view dialog, then no empty object additionalContext is passed to evaluate the context, resulting in the full context being used.
closesodoo/odoo#75807
X-original-commit: 3fe5961988220b2864db005ae9d79474de608fc5
Signed-off-by: Mathieu Duckerts-Antoine <Polymorphe57@users.noreply.github.com>
Signed-off-by: Bruno Boi <brboi@users.noreply.github.com>
Adapt css to allow a nice display of ribbon widget on kanban.
Task-2634805
PR odoo/odoo#72298
Co-Authored-By: David Beguin <dbe@odoo.com>
Co-Authored-By: Mariska Archielli <ram@odoo.com>
The kanban view allows to instantiate widgets but not to give attributes as
options. Fine tuning some widgets require to be able to control them directly
from XML declaration using options and attributes.
Task-2634805
PR odoo/odoo#72298
Co-Authored-By: David Beguin <dbe@odoo.com>
Co-Authored-By: Mariska Archielli <ram@odoo.com>
Before this commit, the sync buttons refactored in https://github.com/odoo/odoo/pull/68700 would appears in all calendar views (sale,time-off,...).
This commit only displays them in the calendar event view.
closesodoo/odoo#75702
Taskid: 2633415
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>