The progress bar was pretty broken before this commit.
> It was not possible to input the value as text
> Moving the progress bar to modify value and saving crashed
> modifying the max value crashed
> The whole feature was ill-defined
With this commit, we fix the crashed. It is now possible to write the field
behind the progress bar by moving it in RO mode
or by typing the input in RW mode
*if it is the value we want to write on*
It it is the max value that the field targets, we can do it in RO and RW mode,
only with the input as text
Note that this works *only if* the editable option on the widget is set to true
OPW 2061846
closesodoo/odoo#36928closesodoo/odoo#36970
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Go to CRM/Sales/Team Pileline. Place your cursor on the chart, a tooltip
appears, move your cusror away, the tooltip disappear. Now clic anywhere
on the interface so the page change (i.e. on "x Open Opportunities") and
quickly while the page loads place your cursor on the tooltip, it
appears but when the page change it doesn't disappear.
The problem here is that the graph element is removed from the DOM which
prevent the correct handling of the `mousehover` event used internally
by nv.d3 to show/hide the related tooltip.
The solution is to manually hide the tooltip when the graph element is
removed from the DOM.
opw-2042286
closesodoo/odoo#35172
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
when image field cannot load an image, it will default to the placeholder image.
If this placeholder image also cannot be loaded it was creating an infinite loop errors
After this commit, we only show one error if the original image cannot be downloaded
and if the placeholder cannot be downloaded, we don't show anything else.
closesodoo/odoo#35226
Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
When uploading a file to a binary file, then clicking on the
"clear" button, then reuploading the same file...
Before this commit:
The actual input of the field was only changed on user input.
This means that the "clear" action didn't reset the actual value
of the input, and the browser's default behaviour when getting
the same path twice is not to change anything. In the use case,
you couldn't upload the same file until you uploaded another one.
After this commit:
The "clear" action now also clears the value, allowing reuploading
the same file over again.
closesodoo/odoo#33843
Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
Before this commit, both config and session were aliases to odoo.debug.
Now, config.isDebug() should be call, with possibility to pass a parameter to
check if we are in a specific debug mode such as 'tests' or 'assets'.
task-1934445
Coming with https://github.com/odoo/enterprise/pull/4281
Closes https://github.com/odoo/odoo/pull/33213
The pdf_viewer widget fails to load file and hence shows error.
This is due to the wrong controller called(wrong URI passed),
while loading a file using pdfjs.
For files other than images, /web/content controller should
be called since since odoo/odoo#31811.
This is similar to the enterprise fix 793c76298a2b301a2
task-1932190
closesodoo/odoo#33354
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
* = partner_autocomplete, point_of_sale, web_editor,
website_forum, website_slides
This can be used for example to preview an image from a file input field.
It can also be used to send the base64 content of the input by RPC instead of
having to rely on form submit as POST with multipart/form-data.
Technically wrap FileReader.readAsDataURL in a Promise.
This will also be used in task-1930726
PR: #33508
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
- when refresh a kanban dashboard page which contains graph, there is some extra div appends to the graph.
- so if svg is there in the dom, no need to append it again. simply use the existing svg
Related to Issue: 1943483
closesodoo/odoo#32279
Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
Rev. odoo/odoo@5dc971b introduced a `description` attribute on AbstractField.
Sadly, the attribute was already used for something else (in `handle`
and a widget in asset, to hide the column name). So the widget new
description is now displayed in the list header (instead of the field
name).
A new attribute `noLabel` has been now added on AbstractField (currently
only used in list) to fill the same purpose as the previous `description`.
Task 1981757closesodoo/odoo#33060
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Before this rev., widgets were absolutely positioned in table
cells. This cause an undesired effect with text fields, as their
textarea overflowed and overlapped the next lines.
With this rev., wigdets are now statically positioned, and the cells
height and width don't change when switching a row to edit mode.
Part of task 1915702
This rev. changes the layout of *editable* list views to a fixed
layout. This means that we are now responsible of the width of
each column. To do that, we associate with each field type a
factor, and the higher the factor is, the larger the column will
be (w.r.t. the others). This default value can be overriden in the
arch.
The fixed layout allows to remove the absolute positionning of
widgets inside editable lists (done in the next commit).
Part of task 1915702
Co-authored-by: Martin Geubelle <mge@odoo.com>
Have a timesheet uom per Day
Have a language with a different number format than English
Click on grid cell to change its value
Before this commit, the value was stuck on the highest value in range
This was because the parsing of the value into float was not taking into account
the real format of the float
After this commit, it works in all languages
OPW 1964657
closesodoo/odoo#32581
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Since f4fbaf1efa the structure of checkboxes has been improved, now we
have something like:
```
<input type="checkbox" id="checkbox-18" class="custom-control-input">
<label for="checkbox-18" class="custom-control-label">​</label>
```
With the first input invisible (whilst before it was visible and the
clickable element).
This cause an issue in an editable list view:
- we have a boolean readonly field in a cell
- we are on focused on a line (not in the boolean field cell)
- we click on the boolean field
=> the check mark is toggled
This is because when we switch cell, we try to activate the widget of
the other cell. Before f4fbaf1efa this issue did not happen since the
browser do not generate a click event when clicking a disabled checkbox.
With this changeset, a disabled FieldBoolean is not focusable as is the
case for other fields, so we can't "activate" it.
Without the fix, the added test fails with:
[clicking disabled checkbox did not work]
opw-1958433
closes#32652
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
The widget has been moved in rev. odoo/odoo@15f3bbe but was not very generic.
In particular, there was a traceback when clicking on the button if the field
had no value (the button was displayed for readonly fields in create mode).
The button is now only appended in readonly mode (a `button` inside an `input`
or a `textarea` is not very DOM friendly) if the field has a value.
Task 1941996
closesodoo/odoo#31635
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Add a new widget for binary fields. It open a dialog box and the user can sign manually,
or an signature can be draw automatically or he can upload a picture of his signature.
Move fonts, controller, scss,templates about signature from portal to web to avoid redundance
closesodoo/odoo#30222
Since rev. odoo/odoo@f4d541e the `session_id` cookie uses the `httponly` flag so
it cannot be accessed through client side script. But before this rev. the
`session_id` was still provided by the server to the webclient (in session_info,
mostly) and was stored and accessible. This made XSS injection more
dangerous than they should be as it was very easy to steal the `session_id`.
As the browser automatically set the `session_id` on every request to the server,
the webclient shouldn't need any explicit reference.
During the unit tests, I have noticed that the test window was doing a
lot of work after the test were completed, it was using CPU and using RAM
in jigsaw pattern. Eventually after being left alone for a few hours,
the window would just crash.
This was due to an unlimitted chain of deferred running when an image
field had a load error.
The situation is as such:
1. The image is put in the DOM with an onError handler
2. There is an error, as the image is a dummy text for the tests
3. The onError is called, it clears the image field, then calls _render
4. _render re-adds an image with the same onError handler <----------
5. The onError is called - again - it clears the image field - again |
(wich does nothing this time because the value is the same) - |
then calls _render - again |
6. The second time _render is called, go to step 4 --------------------
... In the meantime, the widget has been destroyed by the test,
so it should not do anything anymore.
This fix breaks the loop, as well as bind the onError handled with 'one'
instead of 'on'.
closesodoo/odoo#30716
The current implementation of the state_selection widget always makes it
editable even if the field is readonly.
We improved this behavior by removing the handle of click on the widget
when the field is readonly, but keeping it even if the view is not in
edit mode, because it used for example in project to change state even
when view is not editable.
closesodoo/odoo#29218
A `description` key has been added on AbstractField and all generic
field widgets ; it is used to display a more user friendly name (both in
the webclient and in Studio).
Non-generic field widgets have an empty string as description.
Related task 1918327
closesodoo/odoo#30131
Signed-off-by: Martin Geubelle (mge) <mge@openerp.com>
Co-authored-by: Mohammed Shekha <msh@openerp.com>