This commit refactors the patch function in order to simplify its code
but also and most of all remove the `this._super` bound on each patched
method call.
The patch function now supports the javascript keyword `super` to
get the parent's property.
This removes constraints we had with `this._super`. We had to create a
rather complicated intermediate function to bind `this._super` and this
function was called each time before we called a patched method.
It was annoying for debugging but necessary. Because of this
intermediate function `this._super` was also had to re-bind each time
we entered a patched method which was annoying with async method, we
had to save the parent method in the patch before awaiting its
execution. Finally, not a big issue but still, objects could not have a
`_super` property as it would be hidden in the patch.
task 3410198
Part-of: odoo/odoo#125716
This commit focuses on fixing the UX for managing avatars and badges
within `tagsList` in edition mode. The changes include:
For Avatars:
- Implemented an overlay effect on :hover, making it clearer which entry
is currently selected, providing a visual cue for users.
- The "remove" button now appears on :hover only, reducing visual
clutter and improving visual scanning.
For Badges:
- Added visual feedback when hovering the "remove" button, making it
more apparent and user-friendly.
task-3439555
part of task-3326263
closesodoo/odoo#130485
X-original-commit: 649a58cd88c4d74cdd62f47c1c0c354ced143481
Related: odoo/enterprise#45028
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
The goal of this commit is to complete the list of activeFields for
an x2many in list mode when a record is opened with the fields present
in its form view. This ensures that there is always an activeField
for all the data in a record. Before this commit, when the x2many's
form view was not inline, when the form view was closed, the fields
not present in the list view no longer had an activeField, which could
cause crashes.
closesodoo/odoo#130453
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Before this commit, in some cases (many2one invisible) unity returned
an integer as value.
Now, to be consistent, unity always return an object for many2one.
Note that, web_read_group still returns an array as value for many2one.
part-of task-id~3179751
closesodoo/odoo#130340
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
*: im_livechat, web.
Since [1] the messaging service is added to the livechat embed
bundle. As a consequence, the bus service is started even when
it is not needed. This is wrong since it would lead to lots of
useless connections to be made.
This PR prevent mail services from starting the bus eagerly in
this context and adds a tour in order to prevent further errors
on this matter.
closesodoo/odoo#130059
X-original-commit: b2bcef3c3b57061ef0694a5fc3c326cc8babc818
Related: odoo/enterprise#44782
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This commit adds the "show weekends" functionality to calendar which
allows the user to choose whether weekends should be shown in the calendar
or not (defaults to false).
task-3425523
closesodoo/odoo#129107
Signed-off-by: Luca Vitali (luvi) <luvi@odoo.com>
Steps to reproduce: (on Safari only)
1. Install Email Marketing and Mass mailing on sale orders
2. Open Email Marketing and try to open 'Our last promotions, just for
you!'
3. An error is thrown
Solution:
Ignore errors raised in Safari
Problem:
Error "ResizeObserver loop completed with undelivered notifications." is
raised by the ResizeObserver in
`mailing_mailing_view_form_full_width.js`. However in Safari (and
desipte the ResizeObserver flow being exactly the same than in other
browsers), the error message is "Script error." so we are not able to
correctly discard it in the error listener of `error_service.js`
opw-3339673
closesodoo/odoo#130389
X-original-commit: d00144d1198131ba7c68466b514518ca056ceef0
Signed-off-by: Francois Georis (fge) <fge@odoo.com>
Signed-off-by: Guillaume Merlin (megu) <megu@odoo.com>
In odoo/odoo#120893, the mail team changed their test utils so that they
would always start all services. This can cause issues because services
do not have any built-in destruction/cleanup mechanism, as in a
production application they are only supposed to be started once. Some
services add event listeners on global objects, in particular, the
tour service adds an event listener on the tour registry which is
global. If this event listener is not cleaned up, every time the tour
service is started, a reference to the environment in which this tour
service is being started is leaked. Since the environment contains all
started services, it is typically a pretty heavy object, especially
since in this context, all services are started instead of a select
subset.
This commit fixes that by patching the EventBus class to automatically
remove event listeners that were added on an event bus after the test,
in a similar fashion to what we do for some global objects like window
or the document's body.
closesodoo/odoo#130373
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Now that most of the webclient codebase (fields, views, client
actions...) has been converted to owl, the legacy extra next tick
used in a lot of tests is no longer necessary. This commit removes
the helper and its usage. At some places, a real tick was needed,
but we didn't see it because of the use of the legacy extra next
tick.
Part of task~3439226
closesodoo/odoo#130236
Related: odoo/enterprise#44869
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
This commit aims to minimize a very annoying issue that comes up
frequently: it is often necessary to go in debug mode to configure odoo
for a demo. Then, if we don't explicitely remove debug mode, it will
persist (because it is stored in the session). As a result, technical
tooltips will be visible during the demo, which may be distracting and
give a bad impression, because these tooltips are designed to provide a
lot of technical information.
It is not clear how we could solve the problem. Many questions arise
when discussing the issue:
- splitting technical and debug mode
- removing debug mode from the session
- but still making sure tests works
- what information should be displayed in ui?
- if debug mode is not persistant, find a way to make it temporarily
active
There are a lot of different opinions and needs that are not easily
solved. This commit does not pretend to solve them, it is just a quick
way to reduce the issue mentioned above, by changing the JS code to only
use debug mode if it is explicitely set from the url.
Concretely, it means that the "js" specific debug features are
configured only with the debug parameter in the url:
- technical tooltips
- owl props validation
- displaying the debug menu
The rest will keep working as before:
- debug=assets
- debug=tests
- additional menu items/fields
Again, this commit is just a quick fix, until someone can find a spec
that get enough traction.
closes odoo/odoo#130060
Taskid: #3255925
X-original-commit: 59f49d6a8c856a5d8ca28dcfd7840baaa1c7672f
Related: odoo/enterprise#44783
Signed-off-by: Géry Debongnie <ged@odoo.com>
In a previous commit 8bfa76a, _lt() returns _t().
So, in this commit, all usages of _lt() are replaced by _t().
task-3292454
closesodoo/odoo#130179
Related: odoo/enterprise#44906
Signed-off-by: Luca Vitali (luvi) <luvi@odoo.com>
This commit removes a function from the Record datapoint, and
replaces it by an option to checkValidity, as we want Record to
have a few public methods as possible.
Part of task~3179751
closesodoo/odoo#130170
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
Since the relational model was rewritten (PR 114024), the record id is
no longer present in data by default. The correct way to access the id of
a record is to do record.resId.
closesodoo/odoo#130061
Related: odoo/enterprise#44785
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Since the relational model was rewritten (PR 114024), it is now reactive,
so it is no longer necessary to use model.notify() to render the view.
closesodoo/odoo#130058
Related: odoo/enterprise#44781
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Previously, we have accidentally made some core modules depend on some
modules outside of the core folder (eg views), this is undesirable as it
can make assets bundle hard to write using globs, and can make it easy
to introduce circular dependencies, it also doesn't make sense from a
code-organisation perspective.
This commit introduces a QUnit test that checks the modules in some
folders only depend on other whitelisted folders.
closesodoo/odoo#129982
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
luxon and moment are both used in the solution,
but these two libraries facilitate the manipulation
of dates. It was decided to replace all uses of
moment with luxon so we can then remove
moment.js from the code and lighten the assets.
task-3391739
closesodoo/odoo#128752
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
Purpose
=======
Currently, when we want to add a properties selection option, we need
to focus another option and press enter. This will add the new option
at the end, but we want to add it just after the focused option.
Task-3338157
Part-of: odoo/odoo#123216
This commit allows the correct activeFields to be used depending on the
view used to open an x2many field.
Before this commit, if we had an x2many field with a list view and a form
inline view with the same field containing a different context depending
on the view. The context of the form view will always be used.
This is a problem:
If we have an inline form view with fields common to the list view,
the context of the activeFields in the form view will always be used
and we will try to combine the different modifiers (required, readonly, etc.).
We don't want to do this, we want to use the activeFields of the list view
when we open the record in the list and the activeFields of the form view
when we open the record in the form view.
Solution:
When we create the activeFields, we'll use the activeFields from the
list view and complete them with those from the form view. We will
therefore no longer replace or merge them.
Then, when we open a record in form view, we'll use the activeFields
from the form view and when the form view closes, we'll restore the
activeFields from the list view.
closesodoo/odoo#129989
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
- open a grouped kanban view with progressbar;
- select a progressbar;
- the records are filtered and the count/aggregate is updated;
- change the filter/domain that will reduce/increase the filtered
records.
Before this commit, the records are correctly update but the
count/aggregate is not update.
Now, the count/aggregate of a selected progressbar is updated if the
domain changes.
task-3422009
X-original-commit: 95a94e0d928729bbbc80a627f816f9e575121f8d
This commit adds the possibility to see additional information about a
user with a card that appears when hovering avatar user fields for a
set amount of time. This card contains the following information:
- Avatar
- Chat status
- Name
- Email
- Button to send message
and with HR installed:
- View profile Button
- Job position
- Department
- Phone number
- Advanced chat status (when hr_holidays is installed)
Task-3167110
closesodoo/odoo#121943
Related: odoo/enterprise#44563
Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
The DataManager is no longer used as all views and models have
been converted to wowl.
Part of task~3439226
closesodoo/odoo#129725
Related: odoo/enterprise#44611
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
Steps to reproduce
==================
- Enable debug mode
- Go to Settings / Technical / Automation / Automated Actions
- Set "Action To Do" to "Execute Python Code"
- In the code editor, type really quickly
The code is briefly focused and when the next input is processed,
everything is erased.
Cause of the issue
==================
The AceField makes a debounced commit with the current editor value.
This triggers an onChange event, and upon receiving the results,
we update the editor value with the resolved value.
Although the editor value may have changed in the meantime,
we still revert it to the previous value.
Solution
========
There is no need to update the record every 10ms. We can simply to that
on blur. This is also what was done in 16.2.
opw-3379740
closesodoo/odoo#129694
X-original-commit: 4047ed03117fbcd5634843e29dc82e7ffb71b910
Signed-off-by: Luca Vitali (luvi) <luvi@odoo.com>
Release notes:
https://github.com/odoo/owl/releases
Commits:
[FIX] app: sync destroy everythig when app is destroyed
[FIX] tools: include proper version number in released build
[IMP] runtime: add support for Map and other iterables in t-foreach
[IMP] runtime: only destroy component in raf callback
[REF] runtime: simplify implementation of batched
[FIX] compiler: allow t-model.number to work with select
[FIX] devtools: Fix crash when no root node
[FIX] devtools: fix/imp env display
[FIX] devtools: fix symbols handling and display
closesodoo/odoo#129438
X-original-commit: b1a13ad11f7f59632dbfb7de6dae0e57b7d44b02
Signed-off-by: Géry Debongnie <ged@odoo.com>
Before this commit, autoresize input in Safari 16 had their
size underestimated, thus truncating the content.
For example, in the Discuss app, the header is a (disabled)
autoresize input, which becomes enabled when the thread can be
renamed. This is also used for threads that cannot be renamed
for consistency of style. So some screens like "Inbox" had its
name truncated to "In...".
This problem is only present in Safari, not in Chrome or Firefox.
Apparently the sizing of input and textarea is incorrect, and it is
fixed in Safari 17. Indeed, Safari 17 can be tested with Safari
Technology Preview where the bug is not present.
This commit fixes the issue by adding an offset to computing the
scroll width of autoresize input, so that it matches the Safari 17
behaviour that is correct.
closesodoo/odoo#129698
X-original-commit: cd9d900c93d22fec1c24dc3b1e77230f80191f04
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Instead of sho-horning full buttons inside a list view cell, use inline
buttons instead.
closesodoo/odoo#129679
X-original-commit: 76a4995b5037957bb5d7b1b2e04c44267273f7fc
Signed-off-by: Bouvy Damien (dbo) <dbo@odoo.com>
In commit c0b354e14a18667463451aa6fe768bffcbb9da9a the intention was for
the calendar navigation to look like the gantt one. The arrows have been
replaced by the same `oi` icons as the gantt view's navigation.
task-3410165
part of task-3326263
closesodoo/odoo#129568
X-original-commit: c9384d12b903850f9535ca7b82ea2ef0e04fd39b
Related: odoo/enterprise#44556
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
*: calendar, google_calendar, microsoft_calendar;
task-3410165
part of task-3326263
X-original-commit: b680a6ac5769bf8e02921a9548792c7696992955
Part-of: odoo/odoo#129568
Prior this commit, there was a problem with borders that were not
displayed on the kanban header when the stage was folded and the user
was trying to drag and drop in that stage.
This commit removes the background set on `.o_kanban_header` when the
stage is folded, so it doesn't overlap and hide the border set on
`.o_kanban_group`. We can do that safely because a folded stage
can't be scrolled
task-3423682
part of task-3326263
closesodoo/odoo#129560
X-original-commit: b6cb9fed6aa46591e692e67267a7419fe15f8c68
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
Prior to this commit, the `font-size` of the days and week numbers in
the Month view were very large.
There were also a couple of issues with the background circles
highlighting days on hover or "today". In both Month and Year view
they were oval instead of circular, and in the `ui-datepicker` they
would hide the number if they happened to be in the previous or next
month.
To fix the font issue the `font-size` styling on
`fc-day-number` and `fc-week-number` has been removed.
For the roundness of the circle, a `:before` element was needed, .
And for the `ui-datepicker`'s circle a simple `position-relative` on
both the `td` and the `a` or `span` fixed the issue.
task-3326564
part of task-3326263
closesodoo/odoo#129559
X-original-commit: 8fac3dd7dd6ffc69f989c9ec5cea225f3e919535
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
Before this commit, in a kanban view grouped on a x2m, when we created
a new column, we had a crash.
Why did this happen?
When a column is created, a resequence is triggered on the columns in
order to have the correct position. Currently, we always use the
DynamicGroupList handle field, which is not correct because if we are
grouped on an x2m we use another resModel, so we want to use the default
handle field (sequence).
closesodoo/odoo#129510
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Before this commit, discard management was incorrect when you had a
non-editable x2m. This could result in changes not being completely undone.
How to reproduce:
- Go to a form view with an uneditable x2m
- Click on a record in the x2m
- Edit the record in the form view dialog
- Click on save
- Reopen the same record
- Click on discard
- Click on the discard in the main form view
- Reopen the same record
Before this commit:
The change applied is still present
After this commit:
The applied change is no longer there. The original state has been restored.
closesodoo/odoo#129509
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This commit removes a lot of legacy code that we kept for the few
legacy client actions that were still to be converted to owl. Now
that the last one has been converted, we can finally get rid of a
lot of legacy code (ActionAdapter, ActionMixin, ControlPanel,
ActionMenus, DropdownMenu(Item), Pager, DomainSelector...).
Part of task~3439226
closesodoo/odoo#129314
Related: odoo/enterprise#44465
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
before this commit, the usermenu My Odoo.com account
was opening in the same tab
after this commit My Odoo.com account usermenu is
opening in a new tab
closesodoo/odoo#123627
Signed-off-by: Bouvy Damien (dbo) <dbo@odoo.com>
This commit adds a shortcut in the orm service to call the new
"web_read" python method and adapts the few calls to use it.
closesodoo/odoo#129502
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
With this commit, it is possible to load the web client in a language
different than the user by using the `lang=` query string in the url:
For example, `/web?lang=en_US`
This is useful when we need to quickly check something, without changing
the current user settings. Note that it will only work if the url lang
has been installed on the database (if lang does not exist, it will fall
back to en_us).
closes odoo/odoo#128121
Taskid: #3420252
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
Before this commit:
When attempting to open a dynamic placeholder in email marketing, a traceback
occurs.
After this commit:
Now the dynamic placeholder works properly.
Task-3373356
closesodoo/odoo#129415
X-original-commit: bb9fb402a135baf7e7b9da9bbb40888f5323ded9
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Prior to this commit,
```xml
<t t-elif="days gt 1">In <t t-esc="days" /> days</t>
```
resulted in two separate translations: “In” and “days”.
This commit fixes the problem by explicitly putting the full text in a
gettext.
closesodoo/odoo#129388
X-original-commit: d278fc234540120e86733c2131515a5223d92c87
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
The title of the “Developer Tools” section of the settings is not
translatable. This is because the extractor ignores nodes that are OWL
components. This commit solves the problem by moving the text to be
translated elsewhere.
closesodoo/odoo#129386
X-original-commit: e91370aed41847f9c89bb6ab590f929e6935ac12
Signed-off-by: Géry Debongnie <ged@odoo.com>
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
Set Document Layout to "Light" (the default)
Print an Invoice
Open in chrome (tested in Chromium Version 114.0.5735.198)
Issue: border right after table header is still visible
Note: It is reader dependent, as it may not occur with other browser or pdf
reader
opw-3324785
closesodoo/odoo#129275
X-original-commit: 28eedfeec2531c0ebfbdeb4024abad967d450a0d
Signed-off-by: Andrea Grazioso (agr) <agr@odoo.com>
_askChanges doesn't apply on a single record, it asks all fields
of all records of the current model to send their changes, so it
makes more sense to have this function on the model instead.
Part of task~3179751
Part-of: odoo/odoo#114024