Commit Graph
10211 Commits
Author SHA1 Message Date
Xavier Morel a0bd33e0e5 [FIX] web: properly update qweb view state in reload
closes odoo/odoo#33822

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2019-06-03 09:49:53 +00:00
David Monjoie 494a2b2675 [FIX] web: log missing view warning rather than error
The point of this warning is to help a view developer realize that
his view is not loaded at all. However, console 'error' and 'warn'
are observed by the runbot clickall tour as meaningful errors
regarding a build resulting status. It makes sense, but it is an
issue for community modules which have a gantt view that only
exists in Enterprise. We don't want to create a bridge module
for each and every module which uses a view that only exists in
Enterprise, so we need to live with this warning. Since its
purpose is for developers only, they can read the log and notice
the error even if we use console.log rather than console.error,
and that will not alter the result of the runbot clickall tour.

closes odoo/odoo#33814

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-06-03 08:01:45 +00:00
Christophe Simonis cfe0523714 [MERGE] forward port branch 12.0 up to 8f21148e1a 2019-05-31 14:37:38 +02:00
Christophe Simonis 8d7ee39213 [MERGE] forward port branch saas-11.3 up to 8a0e819d0b 2019-05-29 14:06:12 +02:00
Christophe Simonis 8a0e819d0b [MERGE] forward port branch 11.0 up to 3e12f2ff56 2019-05-29 11:10:34 +02:00
Christophe Simonis cffd147cfd [MERGE] forward port branch 11.0 up to a20a31486c 2019-05-28 15:52:00 +02:00
Romain Derie e9350993ca [FIX] web: restore /apps/<app> controller
Since JS refactoring of ActionManager at 32b8cec536, the /apps/<app> controller
was not working anymore as the refactoring dropped the support of `sa` as URL
state.

closes odoo/odoo#33679

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-05-27 11:44:08 +00:00
Luis 0379c51be3 [FIX] web: refresh calendar if error
If an error is raised when saving a calendar event, the transaction is
correctly rolled back. However, the view is not refreshed and the
incorrect information is displayed.

We simply reload in all cases.

opw-2002186

closes odoo/odoo#33028

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-05-24 10:45:48 +00:00
Julien Castiaux 042966ccae [IMP] web: better logging of errors
When an error is raised server-side, the complete traceback is displayed
in the JS console. This traceback can be very useful since it might
contain information not recorded anywhere else by default. For example,
access errors due to record rules or SQL constrains do not have their
traceback displayed in the UI or recorded in the log [1], but it is
logged in the JS console.

However, the information is logged in the JS console as a stringified
version of the `result.error` object. The final result is a long and
non-formatted string which is unreadable.

We replace by a new format more convenient for technical teams. The
error is now formatted as:

Error code
Error message
Error data message
Error data debug

This will hopefully give a better starting point for debugging purposes.

[1] SQL constrains tracebacks are only recorded in the log in debug
mode:

https://github.com/odoo/odoo/blob/ec792da72b92b22349b6f325e53fd37d953c7db3/odoo/service/model.py#L122

closes odoo/odoo#33650

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-05-27 06:41:56 +00:00
Grzegorz Krukar 8869677669 [FIX] web: form: remove invisible fields spacing
Invisible fields in form view and group reserve space.
This looks bad with many invisible fields in a form.

Fixes: #29505 and #28370

closes odoo/odoo#33598

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-05-23 08:33:32 +00:00
Priyanka Kakadiya 5adb6b62d2 [FIX] web: update buttons in editable list
In an editable view when editing a row, then apply or remove any groupby or
filter the control panel buttons are not updated.

When record is in edit mode in editable listview and applying groupby then
control panel buttons 'Save' and 'Discard' buttons are always displaying, this
issue occurs because when applying or removing filters control panel buttons not
updated i.e. _updateButtons not called.

With this commit button are updated when _update of list controller is called,
_update of list controller is also called from search.

Task-1967278

closes odoo/odoo#33572

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-05-23 07:39:13 +00:00
Nicolas Lempereur e61639723d [FIX] web: resequence work w/ discardable lines
In 11.0 091c86c21 introduced the unselection of lines when line are
resequenced to solve some issue.

There seems to be a related issue in the following use case if:

- the one2many has a handle field
- the lines have same sequence (eg. adding 2 o2m lines on new record)
- there is an invalid o2m line (eg. empty line and required field)
- without blurring, a valid line is moved

then this happen:

- the sequence of lines are computed
- the invalid line is removed
- the computed sequence of lines are applied

=> this break next onchange, because we try to apply an onchange to data
that does not exist anymore (the invalid line).

With this changeset, the invalid lines are discarded before sequences
are computed so the computation is still correct before being applied.

Without the change, the added test fails with:

5. one onchange happens when lines are resequenced (expect: 3, res: 2)
7. one onchange happens when a line is added (expect: 4, res: 2)
8. onchange worked there is 2 lines (expect: 2, res: 1)

opw-1966589
closes #33591

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-05-28 13:25:05 +00:00
Christophe Simonis 2c68df0ab4 [MERGE] forward port branch 11.0 up to 82c901c937 2019-05-02 10:59:21 +02:00
Hetal DhanakandPriyanka Kaakdiya 84130174df [FIX] web: make calendar toggle full width work
toggle full width of calendar not working, this is because getItem of
localstorage service now returns parsed value, AbstractStorageService now
return JSON.parse(value)

this commit fixes that.

task-1975004

closes odoo/odoo#33570

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>


Co-authored-by: Priyanka Kaakdiya <pka@odoo.com>
2019-05-24 11:19:34 +00:00
Varun Raval 57bb236c24 [FIX] web: fix tags field which looks weird on kanban view
For many2many_tags widget 'o_tag_color_0' class apply box shadow, in form
view it looks good but in kanban view, it does not look good so I have
removed box shadow from kanban view.

Before this commit in kanban view when no attributes are used in the field
at that time tags will be in box-shadow but after this commit even if no
attributes are used in the field, tags will be without box shadow.

Task ID: 1963188
Closes: #33503

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-05-23 08:55:43 +00:00
Nicolas Lempereur b09d20ab29 [FIX] web: no ResizeObserver video error on chrome
When displaying a video, with the browser window at a certain size, or
resizing it (or opening developer tools) we could the following error:

 "ResizeObserver loop limit exceeded"

This can be reproduced in chromium just with this JS code:

  window.onerror = function(e){ console.log(e); };
  document.body.innerHTML = '<div><video controls src="v.webm"/>';

The issue only happen if:

- the video server does not support HTTP range requests
- the controls are displayed on the video
- browser size is in problematic size/resized to problematic size

And the error is raised in window.onerror but not displayed in the
developer console.

With this change, we ignore these errors until fixed in chromium.

chromium bug tracker: https://crbug.com/809574

backport of 12.0 535da9e (in pr #30239) since video loader was in 11.0
opw-1928512
closes #32983

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-04-26 11:53:38 +00:00
Nicolas Lempereur c1f354beb8 [FIX] web: date field in calendar no tz issue
The calendar should send to server:

- for an all day event (all_day field on view): the date in UTC (ie. if
we are on 22 august 2018 on UTC+2, not send 21 august 2018 22:00)
- for a datetime event not all day: the UTC datetime corresponding to
UTC (for 03:25 with UTC+5 timezone, we send 22:25 the day before)
- for a date event: the date in UTC (ie. same as all day)

The current code was alright for datetime, but there was a missing case
if the start_date was a Date field (eg. project task calendar view uses
a date_deadline Date field) and not a Datetime field.

This changeset apply the same behavior as an all_day event to a calendar
with a start date that is a Date field.

Note: the issue happen since 11.0's 03d74f4 (26th march 2019) that
solved a similar case but for datetime (a datetime event at 8:00 with
timezone UTC+9 would be moved the previous day when drag and dropped on
the month view).

opw-1969876
opw-1971106
opw-1971019
closes #32796

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2019-04-24 09:37:29 +00:00
qsm-odoo c5bab6e240 [FIX] web: restore color of card bodies with row class
Following https://github.com/odoo/odoo/commit/ddf2d2dd666c6e3fa2b6b7f943575657a42d6d8b,
the card bodies received a background color.

The 'row' class should not be used on a 'card-body' element but if it is
done, our custom bg color would overflow the card. As a fix for those
cases (normally only one at the time this fix is made), remove the
background color.

opw-1946124

closes odoo/odoo#33710

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-05-28 08:59:54 +00:00
Christophe Simonis 5ac0c7960c [MERGE] forward port branch saas-12.1 up to 9bcc0498c0 2019-05-28 12:25:14 +02:00
Priyanka Kakadiya 9bcc0498c0 [FIX] web: add test for the fix update buttons in editable list
The test for the fix in 5adb6b62d2 can only be implemented in 12.1
because that is the version that contains the createActionManager helper

Task-1967278

closes odoo/odoo#32817

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-05-23 11:39:48 +00:00
Christophe Simonis d785adba6c [MERGE] forward port branch 12.0 up to c545783b95 2019-05-17 15:50:59 +02:00
Christophe Simonis dd90919c19 [MERGE] forward port branch saas-12.1 up to d785adba6c 2019-05-17 16:32:26 +02:00
Christophe Simonis cc3a2c1bf3 [MERGE] forward port branch 12.0 up to e11bacfe51 2019-05-09 21:07:44 +02:00
Nicolas Martinelli d809b47681 [FIX] web: month view drop
- Install the 'Maintenance' app
- Create a maintenance request, set a day and a duration of 6 hours
- Go the calendar view, month mode
- Move the maintenance request from one day to another

The duration is changed with a non-sense value.

In month mode, the hours are not represented in the calendar so it is
not possible to compute the `date_delay`. Moreover, when a record is
moved from one date to another (`_onDropRecord`) in month mode, there is
actually no point recomputing the duration; the `date_start` is enough.

Note that `date_delay` is used (at the time of writing) in 2 views and
absolutely not tested.

opw-1984637

closes odoo/odoo#33193

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-05-06 15:59:13 +00:00
Lucas Perais (lpe) ddb8fc1f62 [FIX] web: checkbox in favorites menu: don't close on click
Following f4fbaf1efa
which changes the label/checkbox structure into:
```
<div class="custom-control custom-checkbox">
    <input type="checkbox" class="custom-control-input" id="customCheck1">
    <label class="custom-control-label" for="customCheck1">...</label>
</div>
```

So, before this commit, there may have been multiple input with the same Id.
The consequence is that, when clicking on a label, the browser would take the first Id it found
which was erroneous, because all checkboxes in Favorites menu had the same Id
In reality, the use case goes as:
- open a x2m,
- search more
- Favorites > Save current search
> click on one the two checkboxes
> The dropdown closed, without checking the box

After this commit, when clicking on the checkbox in the favorites menu
the checkbox is toggled and the dropdown stays. Also, the checkboxed have now unique ids

OPW 1974587

closes odoo/odoo#33032

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-05-06 15:33:48 +00:00
Aaron Bohy 32d696ec43 [FIX] web: blurry menu dropdown on chrome when zoom != 100%
This rev. disables Popper.js 3d transformation for positioning
bootstrap dropdowns in navbar, as this transformation causes a
rendering issue on webkit-based browsers (the text in the dropdown
is blurry).

See https://github.com/twbs/bootstrap/issues/23590

Note that it has already been disabled for the other menu dropdowns
(user menu, debug menu) by rev. 5373db1.

Another solution would have been to override the default value in
our bootstrap.js extension file, but for dropdowns that aren't in
the navbar, the dynamic positionning could be interesting.

Fixes #33096

closes odoo/odoo#33174

Signed-off-by: Martin Geubelle (mge) <mge@openerp.com>
2019-05-06 13:07:09 +00:00
Julien Castiaux baf3d39bf0 [FIX] web: Use Noto as fallback to Lato
Arabic customers are complaining the Lato font is very odd looking for
Arabic scripts. Furthermore, since #32312 Noto is used as the prefered
font to display arabic scripts.

The classes are used by the "Company Tagline" configured along with the
template in use in the general settings.

opw-1946109

closes odoo/odoo#33141

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-05-03 12:47:16 +00:00
Christophe Simonis 62017de41e [MERGE] forward port branch 12.0 up to d7c0c5c127 2019-05-03 09:16:50 +02:00
Julien Castiaux 81877310bc [FIX] web: ignore field message_attachment_count in debug menu
Open a record with a chatter (ie an opw task), add an attachment, enable
debug mode and click on "Set Defaults" in the debug tools, traceback.

The `message_attachment_count` field is a special view added by the
chatter on the form view. This field exists on the view but is absent on
the list of field listed by the XML file. Setting a default value on
that special field is not supported.

opw-1972372

closes odoo/odoo#33044

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2019-05-02 07:25:13 +00:00
Christophe Simonis 243a4ae5cb [MERGE] forward port branch saas-12.1 up to 330b99f60c 2019-05-10 15:20:01 +02:00
Christophe Simonis 3ca58705c9 [MERGE] forward port branch saas-11.3 up to 2c68df0ab4 2019-05-02 13:16:27 +02:00
Denis Ledoux b11930047f [MERGE] forward port branch 12.0 up to c9913152ec 2019-04-26 18:14:18 +02:00
Goffin Simon f67200fe9f [FIX] web: Invalid Date warning
Fine tuning of 5ef86ef6c874ab4dc78402493d05b2460c69e7f6

Steps to reproduce:
Set a custom language settings for date by switching the %m and %d.
Create a sales order

Current behavior:
Invalid date error boxes was raised two times

fixes #33408

opw:1998971

closes odoo/odoo#33415

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-05-16 07:26:28 +00:00
Julien Castiaux 43295c2a37 [FIX] web: mark as read trigger notification
Install discuss, change the general setting in dev mode to disable the
"Show Effect" checkbox. Change the preferences of the user to let odoo
handle notifications. Ask another user to ping you on a chatter then go
to discuss and click the "Mark as Read" button. Traceback.

The `notification_manager` agent has been replaced by another agent in
07cd24b1ec, the code has been updated to use the new agent.

opw-1986844

closes odoo/odoo#33363

Signed-off-by: Julien Castiaux <Julien00859@users.noreply.github.com>
2019-05-15 07:35:36 +00:00
Goffin Simon 9ed9710b2b [FIX] web: Error on invalid date format on date field input
Steps to reproduce the bug:

- Go to any field Date
- Enter wrong date

Bug:
A traceback was raised.

Now a warning is raised and the wrong value is removed.

opw:1974747

closes odoo/odoo#33362

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-05-15 06:36:08 +00:00
Aaron Bohy 3c40d732bf [FIX] web: crash in editable lists with date field
Backport of 7bc53ac30e.

Assume an editable list view with a date(time) widget, click to
edit a line, focus the date field (the datepicker opens), press
ESC: there is a crash in the lib, and the datepicker remains open
forever.

This fix is twofold:
 - we added a check in the lib to prevent it from crashing (it is
 easily reproducible: it crashes when an opened datepicker is
 removed from the DOM).
 - we added an event handler of ESC keydown event to hide the
 datepicker before the field is removed from the DOM.

closes odoo/odoo#32647

Signed-off-by: Martin Geubelle (mge) <mge@openerp.com>
2019-04-23 06:58:16 +00:00
Christophe Simonis 15b8d353c7 [MERGE] forward port branch 12.0 up to 2830b93a3a 2019-04-17 19:47:37 +02:00
Martin Trigaux 60d6c5402b [FIX] web: change bootstrap fonts only for reports
Commit 42530b02fe was fixing a bug in reports that were using the standard
bootstrap fonts instead of the changes we made in $font-family-sans-serif

To solve this, 42530b02fe replicated the change in the file
web_editor/static/src/scss/bootstrap_overridden.scss
which is imported in report_assets_common **before** web._assets_bootstrap

This was solving the issue for the report but had also the side-effect of
changing body font-family in enterprise as the bootstrap_overridden.scss file
is also used in web_editor._assets_backend_helpers and
web_editor._assets_frontend_helpers
42530b02fe had effect only on enterprise where the desired font is Roboto/Noto

Create a new bootstrap_overridden (6th of the name) file only for report

closes odoo/odoo#32902

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-04-30 08:19:38 +00:00
Lucas Perais (lpe) 7bf25cc333 [FIX] web: search view handles JSON parsable domains
Before this commit, a domain that had been written in order to be
JSON parsable, would trigger a JS crash when activated in the UI
It happens when adding custom filters through the edition of the search view with studio

This was because, Odoo developers write, in the XML of a search view
domains python style: `[('field', '=', 'value')]`
When parsing the view in JS, this doesn't get altered by `xml_to_json`
Then, the search view code evaluates it python style
This commit considers that behavior fortunate, but not really clear or conceptually correct

But, when customizing a search view with studio, the domain is written by the code, in JS
JSON parsable format `[["field", "=", "value"]]`

This should be supported too, as so many customizations may have been done before hand

After this commit, both expressions are supported by the filters menu

OPW 1957297, 1960732, 1965649 (at least)

closes odoo/odoo#32690

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-04-15 12:41:26 +00:00
Christophe Simonis efa90f78e5 [MERGE] forward port branch 12.0 up to 385342b575 2019-04-12 16:28:18 +02:00
Christophe Simonis af313858b4 [MERGE] forward port branch 12.0 up to c1c322dd40 2019-04-09 20:43:35 +02:00
Lucas Perais (lpe) c150ab367a [FIX] web: FieldFloatToggle cell multi language
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

closes odoo/odoo#32581

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-04-10 12:33:45 +00:00
Martin Trigaux 02a321cffb [FIX] web: use specific font for Arabic, Hebrew and Cyrillic alphabet
The basic font-family offered on Odoo do not support a large set of characters
and rely on the system fonts for non-latin languages
On a system without specific fonts installed, the characters were replaced by �
For Hebrew, the system sans-serif font (at least on Windows pc) was too small.

Rely on the unicode-range range CSS descriptor to load a font only for a
specific range of unicode code.
https://developer.mozilla.org/en-US/docs/Web/CSS/%40font-face/unicode-range
This way, the fonts are ignored for English text (and you don't have to load
the fonts of every possible language).

Add Noto fonts that covers many charsets.
There is an heavy version for many charset and lighter ones for Arabic and Hebrew
More ranges can be added later

Serve the fonts on our CDN to avoid shipping several MB of fonts for everyone
but lazyload it when needed.

Fixes odoo/odoo#32228
Fixes odoo/odoo#21781
2019-04-15 12:14:14 +00:00
Aaron Bohy 7d31b863ca [FIX] web: list: re-evalute modifiers depending on id
In an editable (main) list view with modifiers depending on the
record id, add a new record. While the record isn't created yet,
the modifiers were correctly evaluated. However, they weren't
re-evaluted when the record was saved (thus getting an id), and a
reload of the view was necessary for the modifiers to be correctly
applied. With this rev. they are now correctly re-evaluated when
the record is saved.

closes odoo/odoo#32483

Signed-off-by: Martin Geubelle (mge) <mge@openerp.com>
2019-04-08 11:32:18 +00:00
Aaron Bohy 8d34eb1328 [FIX] web: editable list: shift-tab and readonly fields
Before this rev., navigating with shift-tab didn't produce the
expected result when there were readonly fields on the way. For
instance, pressing shift-tab on a field:
- to the right of a readonly field: the focus was kept in the
  current field, whereas it should have been moved to the first
  editable field to the left of the readonly one
- in the editable first cell of a row, with a readonly field in
  the last column: the focus was moved to the previous line,
  which is ok, but on the first editable cell of it, whereas it
  should have been on the last editable cell.

@KangOl this commit needs to be forwardported up to saas-12.2, not
later (the code slightly changed in saas-12.3, and we did another
version of the fix).
2019-04-08 11:32:18 +00:00
Nicolas Lempereur 58c64558a9 [FIX] web: checkbox readonly is RO in list editable
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">&#8203;</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>
2019-04-12 11:42:15 +00:00
Christophe Simonis d32420397d [MERGE] forward port branch 12.0 up to 251021796c 2019-04-04 11:20:03 +02:00
Priyanka Kakadiya b2df3c7f30 [FIX] web: removed extra space from graph
- 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

closes odoo/odoo#32279

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-04-03 11:23:24 +00:00
Nicolas Lempereur 0539dde576 [FIX] point_of_sale: background layout header iframe
When a report with header is displayed in iframe with layout
"Background", part of the header maybe outside of the page.

For example on /my/invoices portal show of an invoice, the max width
report iframe can set at 210mm (+/- 793.7px normally), the header in
background layout has `min-width: 900px` so is wrongly centered and may
have content outside of shown page (eg. company tagline).

The same issue happen when using HTML rendering of the report in
backend, but depends on the viewport width.

This may be the expected configuration when printing (wkhtmltopdf should
unzoom if something was too large to fit) but not when displaying html
directly.

opw-1915807
closes #32373

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-04-03 10:05:53 +00:00
Priyanka Kakadiya fc01f72271 [FIX] web: remove comfiguration panel without page refresh
- This issue occurs after the upgrading latest bootstrap library
  While there is an action with data-toggle="collapse" on anchor tag and also any parent function which returns false, it will prevent the click event from bubbling to parent elements.
  Hence, It will not call the click event in bootstrap library, and configuration panel will not be removed unless you refresh the page

- so, removed return statement as no need to return anything from the event function.

Related to Issue: 1943483
2019-04-02 11:26:58 +00:00