Purpose:
Improve performance/reduce server load for the status bar widget when
the underlying field is a m2o.
Before this commit:
The status bar widget does two calls:
- a search_read request to retrieve ids and folds
- a name_get to retrieve names
With this commit:
The name_get can be avoided to save a call by fetching display_name in
the search_read.
This commit removes the name_get call to retrieve the name directly
from search_read.
task-2919535
closesodoo/odoo#98164
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Steps to reproduce:
- Switch language to french
- Refresh the page
- Create a new payment
- Select a partner
- Enter an amount of 100000,00
- Save the record
-> The following field is incorrect: amount
Cause of the issue:
Since https://github.com/odoo/odoo/pull/97425 ,
`parseMonetary` wrongly assumed that a currency was always passed in
the parameters
opw-2937403
closesodoo/odoo#97861
X-original-commit: 9d518f847d2204fc5159a92bc4e4de655acf88fa
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
Steps to reproduce:
- Switch odoo language to french
- Create a client bill for Azure Interior of $1 000 000
- Confirm it
- Go to the accounting dashboard
- On the bank, click on reconcile
- Select Azure interior
- Click on the correct bill
- Switch to Manual operations
-> $1 000 000 is not a correct monetary field
Cause of the issue:
Recently in https://github.com/odoo/odoo/pull/94126 , `formatMonetary`
switched from joining the currency and symbol from ` ` to a non
breaking space, NBSP.
To parse monetary values, the behavior was to split around NBSP to
get the symbol on one side and the value on the other which is then
passed to `parseFloat`.
For the following examples, NBSP is replaced with an underscore.
So `$_1000` becomes `$, 1000`
But some languages such as french uses the same char as thousands
separator.
In that case, `$_1_000` becomes `$, 1, 000` and then the parse fails.
opw-2937403
closesodoo/odoo#97513
X-original-commit: 9d36722797669498dfd1ad4659e5f29347ba30f3
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
Fields with widget `radio` and `boolean` can't be edited
Steps to reproduce:
1. Install Discuss
2. Connect as demo and go to your preferences (top right)
3. You can't edit your notification type
Solution:
Use widgetOptions' mode along with hasReadonlyModifier to disable the
fields
Problem:
This PR https://github.com/odoo/odoo/pull/88223 modified the value of
hasReadonlyModifier which is used to disable radio and boolean fields
opw-2898464
closesodoo/odoo#97106
X-original-commit: 6befccd7c8ac22fe4da2a741efeecde2d036a7b9
Signed-off-by: Guillaume Merlin (megu) <megu@odoo.com>
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>
- BS5 uses native inputs instead of pseudo-element for some
input like checkbox, radio, ...
in BS5 input checkbox don't have "virtual visual" checkbox anymore
(::before), so we remove the relative's rules
- removed `.custom-control` class
- `form-switch` use a new layout system in BS5 we adapt the code to
match the Bootstrap approach (inline SVG).
- In tests, we don't check the exact value of the background as it
change in community/enterprise, and it's difficult to check the value
of an SVG.
- Overflow in progressbar is now hidden.
-> we had to restore it.
- In BS5 margins in forms/inputs has been changed
-> we had to restore it (e.g. 'mb-3')
- .form-group, .form-row, .form-inline
> Dropped form-specific layout classes for our grid system.
> Use our grid and utilities instead of .form-group, .form-row,
> or .form-inline.
- .input-group-append and .input-group-prepend
> Dropped .input-group-append and .input-group-prepend.
> You can now just add buttons and .input-group-text as direct
> children of the input groups.
Ref:
[1] https://getbootstrap.com/docs/5.1/migration/#forms
Task ID: 2766483
Part-of: odoo/odoo#95450
- modal 'show' option doesn't exist anymore
-> We need to call .show()
- by default, show is not the default
-> we need to call .show() explicitly.
- generic close button for dismissing content like modals and alerts.
- BS5 modals needs `modal-dialog` class to work
- normally we need also to add `modal-content` class but as the original
XML don't have this nested level of div we don't use it, but instead
we add `pointer-events: auto` for all children `DIV` of `modal-dialog`
-> See DocumentViewer
Task ID: 2766483
Part-of: odoo/odoo#95450
* data('bs.popover') is not a jQuery data anymore
-> fetch data from the instance instead.
* use the new class name 'popover-arrow' instead of 'arrow'
* website_forum: offset is not a number anymore
-> Convert to string instead.
* BS5 event listener: 'focus' -> 'focusin'
* use `mouseover` event to show and `mouseout` to hide.
* disable at some point the animation to avoid remaining listener
in the DOM.
Ref:
https://getbootstrap.com/docs/5.1/migration/#popovers
Task ID: 2766483
Part-of: odoo/odoo#95450
This commit introduces the new kanban, list and form views written
in owl. Even though it contains the implementation of those 3 views,
only the kanban view is activated for now (the list and form views
aren't 100% ready yet, so they aren't added to the view registry).
Alongside the views, the fields (<field name="..."/> in archs) and
widgets (<widget name="..." in archs) of web/ have been implemented
in owl as well. Legacy ones remaining in other addons are supported
in our new views, thanks to a compatibility layer. The goal is to convert
them asap though.
Legacy views, fields and widgets are kept for now, which explains the
number of added lines in this PR (around half of them concern tests).
They are still extended by custom code in other addons, that still need
to be converted (a lot of them are already on the way). Moreover,
they are still used in Studio as well. The plan is to lazy load them in
the Studio bundle when all custom code extending them will be
converted. Studio will be converted for v17.
Part-of: odoo/odoo#92475
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>
When creating a custom datetime field (with date option type) with Studio and
that you edit the field manually then validates with the ENTER keyboard, the
date is changed (one day is removed - mm/dd-1/yy).
Since [1].
Step to reproduce the issue:
1. Put yourself in Europe timezone (e.g. BE)
2. Add a datetime field via studio (e.g. on the product form)
3. Put a date widget (no datetime)
4. Enter a date manually mm/dd/yy
5. Hit ENTER without clicking outside the box
You will see that the final date will be mm/dd-1/yy.
Solution: The path applied when clicking outside the box and cliking ENTER is
not the same. In the ENTER path, we check if the type of the field is a
`datetime`, if so, we remove the offset TZ to match 00:00:00 instead of
02:00:00 (if you were in GMT+2 zone). The issue is that we do this offset
if the customm field (via Studio) is a `datetime`. This check is incorrect: we
can have a `datetime` field but a date widget, in that case, if we are not on
GMT time we offset by some hours and we end up the day before (as we offset by
2 hours starting from midnight which results in 22PM the day before and when
rendered as a simple date we "loose" one day).
[1]: https://github.com/odoo/odoo/commit/08a423577f732b65ad5035e8f4662386a8631c5f
opw-2830843
closesodoo/odoo#93293
X-original-commit: 37a58832bc966f28fb2c1d627dfe28cef4fb5de7
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Desausoi Laurent (lade) <lade@odoo.com>
Step to reproduce:
- Open 'Sales'
- Open a SO
- Click on the product link in the OrderLine tree
Current Behaviour:
- Breadcrumbs are cleared
Since https://github.com/odoo/odoo/commit/cefd6ade293e6cfa8ec405f55c6d4d7194f36e7e the onClick is only triggered in form view
Behaviour after PR:
- Breadcrumbs are not cleared
Link are now trigger via another click action '_onLinkClick' and quickEdit does not trigger on URL click
Test provided by Anh Thao (pta)
opw-2748041
closesodoo/odoo#85203
X-original-commit: 8ba45fde9f248e5a2b76ff3e934d9784d5d57ff0
Signed-off-by: Damhaut Florian (flda) <flda@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
In some cases, we want to use the regular FieldMonetary widget (performing the amount rounding correctly) but without displaying the currency symbol since the currency code is displayed elsewhere.
This is needed because some currencies are using the same currency symbol like USD / MXN.
Task: 2555114
Part-of: odoo/odoo#91448
It is very common when using kanban view to need a way to declare what
action is executed when clicking on a record. The default action
(switching to form view) is sometimes not what we would like. For
example, clicking on a project kanban record should open the
corresponding tasks, instead of the project form view.
Until this commit, it was not possible to do this simply for a whole
kanban record, however it was possible to add a button with a name and
type attribute to specify the resulting action. This commit introduces
the same idea, but on the complete kanban record, instead of just a sub
element.
To specify the action that should be executed when clicking on a record,
one can now use the 2 attributes 'action' and 'type' (which corresponds
to the 'name' and 'type' attribute for the kanban record. 'name' was
also considered, but it was too weird). For example:
<kanban default_order="name" action="action_brand_model" type="object">
...
</kanban>
Part-of: odoo/odoo#92071
The boolean_toggle should only be disabled when there is a readonly
modifier, not when the view is in readonly mode.
Cause of the issue
The input was disabled but the `_onClick` was registered on the
widget root node.
Solution
- Listen for clicks on the input element
- Override the render method to set the disabled prop according to the
readonly modifier.
opw-2739468
closesodoo/odoo#91601
X-original-commit: 29a2402153dc95414dad8c833487e7dd18c8a222
Signed-off-by: Michaël Mattiello <mcm@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
Since https://github.com/odoo/odoo/pull/87584
with `date` field, pressing enter will removes 1 day to the value.
To fix it we have to ignore the offset suppression used for `datetime`
opw-2818927
closesodoo/odoo#90115
X-original-commit: 46e6475708c7ba8289345c4f7c125f60fc77d08c
Signed-off-by: Achraf <abz@odoo.com>
The problem is generally due to the use of `var`, this one
https://github.com/odoo-dev/odoo/blob/58a046d2146e884d467cde827f89fa603ed98a3b/addons/web/static/src/js/views/basic/basic_model.js#L1780 followed by an asynchronous call to a function using it
We can therefore summarize the part of the `_applyOnChange` function
that interests us by
```js
for () {
if (field. type === 'one2many' || field. type === 'many2many') {
var list;
...
//using list
...
promiseFunction(list).then(function(){
//using list
})
}
}
```
In the case where we have two one2many which follow each other,
this scenario occurs:
- `list` is initially the first o2m
- the `promiseFunction` is called with `list` (first o2m)
- before the promise is resolved the loop continues
- `list` is `Promise.then()` the second o2m
- the first call to `promiseFunction` with `list` (first o2m) is done
- we enter in `Promise.then()`
- `list` is currently worth the value of the second o2m because
`list` is a `var`
- the second call to `promiseFunction` with `list` is finished
- we enter the `Promise.then()`
- `list` is currently worth the value of the second o2m because
`list` is a `var`
Result: `Promise.then()` is called twice with the first o2m and never
with the second
We can see what happened with this code example:
```js
const array = ["a", "b"];
const asyncRead = async(value) => {
console.log("async function arg", value)
setTimeout(()=>{
return Promise. resolve(value);
}, 100)
}
const forFunction = () => {
for (let i = 0; i < array.length; i++){
var list = array[i];
asyncRead(list).then(function (){
console.log("then async function arg", list)
})
}
}
forFunction()
/*
async function arg a
async function arg b
then async function arg b
then async function arg b
*/
```
While if:
We use `let`
by replacing `var list = array[i];` with `let list = array[i];`
OR
We force the use of `Promise.resolve()` argument
by replacing `.then(function (){}` with `.then(function (list){}`
We will get:
```js
/*
async function arg a
async function arg b
then async function arg a
then async function arg b
*/
```
opw-2694855
closesodoo/odoo#89160
X-original-commit: 99cb2f52e109ccf94ac8bd735cd776e84ef04260
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
opw-2729810
closesodoo/odoo#87918
X-original-commit: 65f4c4f29a9c747f114eb6359d3ebb036efab9d6
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
When entering a date in a datetime field, it will be in the format
`08/01/2022 00:00:00`. If we place our cursor at the end of the
entry (after the hour) and each time we press enter, the timezone
offset is applied (so if offset is +1 it does +1 hour each time)
opw-2754116
closesodoo/odoo#87655
X-original-commit: 33e8540d64bb6e21debb7da9a121b706f551ab2e
Signed-off-by: Achraf <abz@odoo.com>
This commit fixes a bug present in FieldEmail and
FieldPhone where the handler on the click event was
triggered twice and was not preventing the field to
turn into quick edit mode appropriately.
A test has been added for EmailField to ensure the
correct behavior
PR enterprise: odoo/enterprise#25506closesodoo/odoo#87196
X-original-commit: 852e084c355e9be77c693b32bf1119570e4d49d0
Related: odoo/enterprise#25558
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Steps to follow
- Go to the product page
- Open studio
- Click on the picture and set the size to large
- Save and quit studio
-> The size doesn't change
Cause of the issue
Studio sets the size attribute on the field as `[0, 270]`
This means the picture should have a height of 270px and an unspecified width.
But for that to work, we need to handle the case were only one
dimension is set.
opw-2745625
closesodoo/odoo#87226
X-original-commit: 50368a9db8ac67986cf64ff84ee625cbf7a90a1f
Signed-off-by: Anh Thao PHAM <pta@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
Steps to reproduce:
- create a contact with a very long name
- create a quotation
- in customer, type the first letter of the very long customer's name
- try to use the horizontal scroll bar
Issue:
close window on horizontal scroll
Solution:
Discriminate an horizontal scroll from a vertical scroll
A test has been added as well as the triggerScroll utility function
to allow proper tests when scrolling on elements
opw-2777443
closesodoo/odoo#86744
X-original-commit: e0b26496196bd4ee39fa06e1a3274982d2c7fb12
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Iucapad <luvi@odoo.com>
All named arguments on the catch block must be used. If for some motive
the named argument on the catch block is not used, its name must begin
with '_'.
closesodoo/odoo#85569
Related: odoo/enterprise#24867
Related: odoo/design-themes#552
Signed-off-by: Géry Debongnie <ged@odoo.com>
For the moment we cannot star a product from the form of sales view
Steps:
-Sales/Quotation
- Create new quotation
- Add a new product in the order lines
- Open product form from External link
- Try to star product
Because of the quickedit the onClick is called when it shouldn't,
the solution would be to rename the onClick function so that it
doesn't interfere with the quickEdit.
opw-2759063
closesodoo/odoo#85242
X-original-commit: edafd9fe49b1e4c73ee1768efc3df26b463b2f14
Signed-off-by: Achraf <abz@odoo.com>
*: mail, mrp
Previously, to prevent images and iframes from making GET requests in
tests, we would listen for the DOMNodeInserted event. This event is
deprecated and should not be used. Additionally, we weren't listening
for attiribute changes for performance reasons, which would result in
some GET requests still being made when an src attribute was changed.
This commit changes the mechanism that is used to do this from mutation
events to a MutationObserver which is not deprecated, and now also
listens for attribute modifications as MutationObservers can be
configured to only listen for changes to certain attributes, greatly
alleviating the performance impact of listening for those.
This mechanism has also been enabled globally by doing it once in the
test setup code, instead of requiring one to call a specific helper, as
we never want to make real requests during tests.
Some tests have been adapted to this new behaviour.
closesodoo/odoo#85216
Related: odoo/enterprise#24665
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
When combining the context for an RPC, the
additional context is being added before the raw
context.
Because of this, a use case such as:
- A o2m field with a context {'field': 'a'}
with a tree editable view below it
- That view defines controls to create lines,
which would change the context key 'field' to
another value.
=> The field context key would take precedence on
the creates key, making it impossible to override
that key in specific circumstances.
closesodoo/odoo#83996
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Purpose of this commit to add format_type option in daterange
widget.
So, In this add format_type option in nodeoption which convert
actual formatType to given format_type in option and add test
case for that feature.
task:2710539
Closes: #81630
Related: odoo/enterprise#22994
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
In the next version of Owl, all exported terms are directly available
from the top level `owl` object. This commit aims to adapt existing
imports to this new system. This is done by importing any Owl property
used in files at the top, right after the `import` or `require`
statements.
closesodoo/odoo#82736
Related: odoo/enterprise#23609
Signed-off-by: Géry Debongnie <ged@odoo.com>
The purpose of this commit is, to add keyboard shortcut
to multiple actions.
So in this commit, added keyboard shortcut to several actions
in project, sale_project, web_calendar and added smart action
in command palette on statusbar.
task-2655790
closesodoo/odoo#79805
Related: odoo/enterprise#22267
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Prior to this commit, when we hover on any star icon (from a priority
widget field), we only get the label of a selection value linked with
particular icon. For example, if a 'Priority field is having a selection
values 'Low' and 'High', on hover of the start, we see 'Low' and 'High'
(in the same sequence as selection values).
But sometimes (for example in kanban view, where we don't display the
field label), it is not very clear what they indicate.
This commit improves the behavior by adding a field label also in the
title attribute of the star icons so that users can get a better
understanding of what each selection means. In our example, it will
now display the tooltip as 'Priority: Low' and 'Priority: High'.
Task-2691338
closesodoo/odoo#80213
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
In debug mode, the FieldDomain displays a textarea to allow the
manual edition of complex domains. However, when those domains
contain dynamic content (e.g. datetime stuff), the evaluated
version of that content was displayed, which isn't what we want.
We want to see the raw version of the domain as written in db,
and be able to edit it. This commit fixes that issue. Moreover,
we also ensure to keep whitespaces and new lines, which can be
useful for large domains.
closesodoo/odoo#80866
X-original-commit: 15301a1ddaf00e51688d8134b7cb19baf386577c
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
When changing a value for a o2m (list) within a form, the _setValue
returned a Promise that did not take into account the real rendering of
the list renderer.
The use case at hand is:
- enable product configurator
- have a product with options
- add that product in a SO
- add the option as well through the product configurator
- confirm the configurator
The configurator triggers an add_record event, with an onSuccess callback
Before this commit, the onSuccess callback was called too early, when the previous
rendering operations were not finished yet.
After this commit, the onSuccess is executed when the list renderer is really ready
opw-2580044
closesodoo/odoo#79591
X-original-commit: 8def0d103020aed4211fd22f2b917567fb06de1e
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Before this commit, the FieldDomain (using the DomainSelector)
didn't work well for manual edition of large domains (i.e. via the
"code editor"). For instance:
- the editor was an input, so limitated to 1 line
- the user friendly representation of the domain was redrawn each
time the input was blured (we don't need this, and it flickers)
- the count (search_count rpc) was recomputed at blur as well
(could thus freeze the interface)
This commit fixes those issues as follows:
- use a (automatically resizable) textarea instead of the input
- do not format the content of the textarea when it is blured
- do not update the user friendly part of the widget when the
textarea is blured
- do not recompute the count when the textarea is blured
- add a button to allow to manually re-compute the count
For both debug and non-debug mode, we also no longer wait for the
count to be fetched to render the widget. We display a spinner
until the rpc is done.
Task 2619505
closesodoo/odoo#79886
X-original-commit: f4e3a754a1b66dd95fa3bfb50ec1fb8ac98864ed
Related: odoo/enterprise#22295
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
before this commit: applying readonly attribute on toggle_button doesn't work,
toggle_button still clickable and value is still changed even though widget is
readonly, there is no effect of readonly attribute on toggle_button widget.
after this commit: if toggle_button widget has readonly attribute then it will
not be clickable, button of toggle_button will be disabled so that user can
easily understand that element is not clickable.
task-2339995
closesodoo/odoo#79012
X-original-commit: 74d42d4a328c517d0ced56d9e437fb40b00a14d0
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Currently markup-ification of the legacy notifications system
display the html content in notification layout for some of the
notification of document and planning from commit: https://github.com/odoo/enterprise/commit/ba44461fea337ed2e5adbdfa1e8eede00b036def
So here in this commit, we make the method `makeLegacyNotificationService`
always `_.escape(message)` and pass `messageIsHtml: true` to the owl
notifications system so notification with html content will be displayed
properly.
Task-2657391
closesodoo/odoo#78627
X-original-commit: 7ce6d8d70be79c9c626865598b898dce9a18b045
Related: odoo/enterprise#21782
Signed-off-by: LTU-Odoo <IT-Ideas@users.noreply.github.com>
before this commit: when m2o has can_create=false and user try to search
something that doesn't exist then it should show 'No results to show' in m2o
autocomplete, because of commit: https://github.com/odoo/odoo/commit/4f116a0f9be26b91d95e019cda1aa620faf6d620
this has been broken.
after this commit: if user can not create m2o record and if user searches that
doesn't exist in m2o model then it will display 'No results to show'
task-2376435
closesodoo/odoo#78329
X-original-commit: a9e14acc3785c972bd037a8d4ca303c10dad265a
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
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>
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>
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 reverts commit 2623b4591d.
The command+m shortcut on safari is not listenable. Safari prevents to
catch events of some shortcut reserved for OS actions. Command+m is
used to minimize the app. This makes it impossible to open the command
palette on safari. So we decided to use again the command+k (ctrl+k)
to open the command palette.
X-original-commit: ca0e37cc20da907d74245e935416d66a52976c5e
Part-of: odoo/odoo#76614
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>
This commit adds the smarts actions:
- Assign to... (many2one_avatar and many2many_avatar)
- Assign/unassign to me (many2one_avatar and many2many_avatar)
- Set priority... (priority)
- Set kanban state... (state_selection)
These smarts actions are commands with hotkeys accessible from
the form views containing the widget to which they are linked.
closesodoo/odoo#75312
Task-id: 2588238
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>