Commit Graph
10240 Commits
Author SHA1 Message Date
Christophe Simonis 072fe9bdba [FIX] web: rpc queries should always be shorted out when the widget is destroyed 2018-10-23 14:03:09 +02:00
Christophe Simonis 0fcb28c97b [MERGE] forward port branch saas-11.3 up to d82a907728 2018-10-19 14:32:09 +02:00
Aaron Bohy d82a907728 [FIX] web: kanban quick create when grouped by selection
Rev. 42e1efded5 aimed to disable the quick create feature when
grouped by date(time) fields, by only enabling it for char, boolean
and many2one fields. However, the selection case is quite important
and must be handled as well. This is what this rev. does.

Task 1878254
2018-10-19 13:15:31 +02:00
Aaron Bohy 120709f807 [FIX] web: kanban quick create with correct default values
When a kanban view is grouped by a char or a boolean field, and the
quick create option is enabled, the correct default value for the
grouped field (i.e. the value of the column in which the record is
created) should be given (either in the context if that field isn't
in the quick create form view, or as a default value in that form
view otherwise).

Before this rev., it wasn't the case, as it was only working when
grouped by a many2one field.

Task 1878254
2018-10-19 13:15:30 +02:00
Christophe Simonis f2ada1560e [MERGE] forward port branch 11.0 up to 22a13073f0 2018-10-19 12:25:17 +02:00
Aaron Bohy 22a13073f0 [FIX] web: kanban quick create properly disabled
when grouped on field types for which it isn't supported.

Rev. 42e1efd disabled the quick create feature when the view is
grouped by date(time) fields. However, it hasn't been correctly
forwardported to 11.0 (with the new views). Indeed, the check was
done only once, at the initilization of the view. So if the user
selected another field to group by afterwards, the quick create
feature wasn't enabled/disabled accordingly.

Moreover, we didn't check if it was available when the user clicked
on CREATE in the control panel. So even if it wasn't (and thus if
there were no '+' icon in the columns), when the user clicked on
CREATE, the quick create widget was inserted in the first column.

This rev. fixes both issues.

Task 1878254

closes odoo/odoo#27867
2018-10-19 06:56:40 +00:00
Christophe Simonis 54db75396f [MERGE] forward port branch saas-14 up to ef670016e6 2018-10-18 15:30:59 +02:00
Christophe Simonis ef670016e6 [MERGE] forward port branch 10.0 up to b8b33c6363 2018-10-18 14:52:51 +02:00
Denis Ledoux b7937ab6b7 [FIX] web: re-introduce on_change="0" to prevent onchanges for customization
In 10.0, adding on_change="0" allowed to prevent
default onchanges to occur for the field on which was added this attribute.

In 11.0, the rev. eaa66d1156
added a regression by removing this possibility.
It was an oversight, it was not an expected change
in the web client.

In 10.0, it's this line which bring this possibility:
https://github.com/odoo/odoo/commit/e8a00bc50da435d3859118ca127d20a2eb9a0cab#diff-ff0e90fb0eb4418a7f66e618e4b51323R444

opw-1883366

closes odoo/odoo#27952
2018-10-18 15:37:42 +00:00
Christophe Simonis 2c0a76fc7a [FIX] web: correct attribute name
Oversight of previous forward-port.
2018-10-18 17:32:11 +02:00
Christophe Simonis 9c3ec026c5 [MERGE] forward port branch saas-15 up to 54db75396f 2018-10-18 17:16:03 +02:00
Christophe Simonis e744241d83 [FIX] web: trim tooltip text before comparison
The error is triggered at least on Chrome 69 on macOS.
2018-10-22 16:53:21 +02:00
Christophe Simonis 6abd8364cf [FIX] web: avoid object duplicated key
Oversight of previous forward-port
2018-10-17 18:53:29 +02:00
Mathieu Duckerts-Antoine 7fb7522cfe [FIX] web: JournalDashboardGraph widgets appear at kanban views updates
closes odoo/odoo#27892
2018-10-17 13:01:56 +00:00
Christophe Simonis 5e055a2afd [MERGE] forward port branch saas-11.4 up to f6ca72b3ce 2018-11-02 10:52:55 +01:00
Adrien Dieudonne 94b82bce6d [FIX] web: remove debug in timezone_mismatch test
Before this commit, a blank page was shown when tests
were running in /web/tests.

closes odoo/odoo#28319
2018-10-31 14:21:48 +00:00
David Monjoie fb204253bb [FIX] web: fix save search in search more modal
When searching for records in a modal (ex: m2o "Search More"),
clicking on "Save current search" had no effect.

Task 1894915.

closes odoo/odoo#27931
2018-10-29 14:40:44 +00:00
Adrien Dieudonne 497dfb6917 [MOV] web, base_import: mobile tests should be in mobile suite
This fix some inconsistent error on runbot.

In mobile, some views* depend on 'jquery.touchSwipe' library which
is lazy loaded. As a result, the views become asynchronous...
It's why this library is already loaded before running tests in the
mobile test suite. So we can continue to use synchronous views whether
in mobile tests or not.

But some mobile tests weren't in mobile suite...
In desktop, 'jquery.touchSwipe' is lazy loaded and the first test will
load it for others. It's why the first one has to be asynchronous:
https://github.com/odoo/odoo/commit/da7b59045d246c159f93bc75e3f19c6b1221d31c

The inconsistency comes from the fact that all tests are sequential but
we can't garantee the execution order. So, if the test mentionned is not
the first executed one, an error will occur because the view is not
asynchronous.

Now, all mobile tests are moved in mobile suite to be sure that
'jquery.touchSwipe' is loaded.

We also set the default value for size_class because we want a
coherent environment. It is very rare to find mobile devices with
more than 474px wide.

*: form_view, kanban_view, res_config_settings

closes odoo/odoo#28195
2018-10-29 10:25:05 +00:00
Lucas Perais (lpe) eaedfe4074 [FIX] web: display of timezone mismatch select widget
On the user's preference, change the timezone to one that is different
from the browser.
Save the form.

Go back to the user's preferences.

Before this commit, every timezone was displayed inside the span that contain
the warning icon, and leaked everywhere on the form view.

This was because of the joint action effects of commits:
86897ca167
4dfabb8f7a

Which provoked the field to be re-rendered in edit mode,
but with an $el on which a span was added. `<option/>` elements
were then added to both `<select>` and `<span>`
This did not happen before v12.0

After this commit, there is no display glitch

OPW 1895088

closes odoo/odoo#28108
2018-10-29 08:36:33 +00:00
Nicolas Lempereur 378ce8c447 [FIX] web: copy traceback in firefox
Same issue as in 902e484f1. In some browser (eg. firefox) the container
parameter of ClipboardJS is needed if the focus is inside the modal so
the copy work.

See information on:
https://github.com/zenorocha/clipboard.js/pull/368

opw-1902040
closes #28117
2018-10-24 15:56:23 +00:00
Nicolas Lempereur a03b967aa9 [FIX] web: restore CSS kanban AttachmentImage field
Modification in 60aa9ffd0 of web module kanban_view.scss contained
unused CSS style and style that affected usage of AttachmendImage field
in a normal kanban view.

The correct code was added in commit 6e12372 in composer.scss of mail
module.

opw-1892053
closes #27923
2018-10-23 11:33:53 +00:00
Christophe Simonis b81c2bce84 [MERGE] forward port branch saas-11.4 up to 3c108977c1 2018-10-22 16:59:51 +02:00
Mohammed Shekha a4bcbecff1 [FIX] web: keyboard overlay with position absolute
Before this commit, when an element with access key has a CSS
position absolute , pressing the key 'ALT' to show the access
key overlay may break the position of the element.

This is due to altering the CSS position of the element which the
overlay is attached to: it becomes `relative`, so that the overlay
takes the whole size of the attached element.

In case of an absolute element, it should not become relative,
otherwise its position on the document may be completely different.
Since the overlay has position `absolute`, if its parent has also
position `absolute`, then keeping both with position `absolute` will
let the overlay take the size of the parent, without changing the
position of the parent.

Task-ID 1885445
2018-10-19 09:23:21 +00:00
TWA 972c8e9ff5 [FIX] web: File upload input on_clear event not propagated
The handler function was used directly in the code. The MouseEvent wasn't provided in that case.
This FIX split the handler function and the processing function so that it doesn't interfere.

closes odoo/odoo#27929
2018-10-18 08:55:07 +00:00
Christophe Simonis e9ae419fca [MERGE] forward port branch saas-11.3 up to 0de06a4132 2018-10-17 10:54:19 +02:00
mgh-odoo cb8dcb5913 [FIX] web: avoid margin on top of list view in mobile
When header was too long, the text was breaking into next line.
We want to avoid this behavior in mobile because it causes
a big margin on the top of the list view.

This issue was probably caused by the upgrade of Bootstrap.

task-1878252

closes odoo/odoo#27927
2018-10-18 08:44:22 +00:00
Christophe Simonis 41bf8ce6d9 [MERGE] forward port branch 11.0 up to b29b545fe8 2018-10-16 17:53:26 +02:00
Aaron Bohy 7063c50924 [FIX] web: FieldMany2one: don't ignore tabindex in readonly
opw 1889710
2018-10-16 10:58:49 +02:00
Martin Geubelle 70560d1f11 [IMP] web: add showSearchInput option on ModelFieldSelector
The option `showSearchInput` has been added on the ModelFieldSelector to allow
the user to easily filter the displayed fields. An input is displayed in the
popover title.

The search method is fuzzy for optimal results.

closes odoo/odoo#27788
2018-10-15 11:59:33 +00:00
Aaron Bohy 03fe95d6af [REF] web: small refactoring pass on some web components
(mainly views and ActionManager)

- add missing docstrings
- fix typos
- correctly order functions and imports
- put functions in correct sections
- stop using 'event' as argument of handlers
- don't call handlers directly
- remove trailing spaces/tabs
- move module created in stable version to its own file
- follow js guidelines in general

closes odoo/odoo#28024
2018-10-23 10:56:12 +00:00
Christophe Simonis 9dbb7d199c [MERGE] forward port branch 12.0 up to b81c2bce84 2018-10-22 17:57:08 +02:00
Vincent Schippefilt 2b0642d09e [IMP] web: remove es5 shim
The library es5 shim was usefull for older browsers that do not implement
completely the es5 specifications, like IE9.

As we do not support browsers older than IE11, that fully supports all
the features of es5, the library has become useless.

Removing this library will remove a little bit of noise in the callstack
when debugging.

closes odoo/odoo#27877
2018-10-19 08:49:56 +00:00
Géry Debongnie d91f0ce95d [IMP] web: log error when module crashes at loading
Before this commit, if a JS module caused an error while being
evaluated, the error was silently swallowed (and only logged in debug
mode, in the extra information about the state of all modules).

With this commit, we always log the error in the console.  Note that
this only applies to JS execution errors.  If a file has invalid
javascript structure, then a parsing error will happen, even before the
module system has the possibility to do anythin.

closes odoo/odoo#27836
2018-10-16 08:44:29 +00:00
Christophe Simonis 1ade6675c3 [MERGE] forward port branch 11.0 up to 717f458394 2018-10-11 16:29:46 +02:00
Aaron Bohy a781083186 [FIX] web: close m2o (in o2m) dialog with ESCAPE
Let's assume a one2many editable list containing a many2one field
(e.g. in a sales order, the product_id m2o in order_line o2m), and
the scenario where the user clicks on 'Create and Edit' in the o2m,
and then presses ESCAPE in the opened dialog.

Before this rev., it crashed because the 'navigation_move' (cancel)
event wasn't stop propagated by the form renderer (the one of the
dialog), and thus bubbled up to the list editable renderer, which
asked its basic model to discard a record it didn't know.

Note: same fix as in 8445baa (done in saas-11.3), but with a
simpler test.

Task 1878254
2018-10-11 11:21:57 +02:00
Christophe Simonis 32b19115e9 [FIX] web,mrp: move test to adequate module 2018-10-10 18:50:37 +02:00
Martin Geubelle f249c5ef2a [FIX] web: restore broken datepicker input behavior
In Firefox, the input behavior and visual representation (navigation, caret
placement, value selection, etc.) was broken when using a datepicker (easily
reproductible on date and datetime widgets).

This was due to the `focus` event being stopped on the input, which doesn't
seem to be correctly supported by Firefox.

The deleted code was supposed to toggle the picker when the field was clicked
(see odoo/odoo@89093a1) (toggle on click and disable focus) but the lib
correctly supports on focus without extra code.

This also fixes the fact that the datepicker was not open on focus (only on
clicked). In some tests where the field was the first in the form view, it is
now correctly autofocused.

Forward-port: not useful from 12.0 because the code has changed with BS4 and
this has already been applied in odoo/odoo@6692919 and odoo/odoo@c63630d.

Closes #23438

closes odoo/odoo#27657
2018-10-11 08:41:48 +00:00
Christophe Matthieu 4aec0b7740 [FIX] calendar: notifications may appear
Following the transformation into notification service, performed by
commit 07cd24b1ec, calendar has been
forgotten.
2018-10-10 16:29:28 +02:00
Christophe Simonis 7415f40fbd [MERGE] forward port branch 11.0 up to a69f117bbf 2018-10-10 14:40:01 +02:00
David Monjoie ea1ad98354 [FIX] web: css fixes for Firefox
- fix statusbar overflowing on the right and triggering a scrollbar
- fix background of the trash icon of the editable list remove
  button which was white rather transparent
- fix cursor that was not properly displayed as pointer when on
  top of the trash icon, while it properly transformed in the td

closes odoo/odoo#27806
2018-10-15 14:18:05 +00:00
David Monjoie 3ed45466f1 [FIX] web: fix menu app button when menu_id can't be inferred
There used to be no processing done at all when loading the client
from an url missing a menu_id and from which the menu could not
be inferred from the action_id. This resulted in the app name
button in the menu being empty but still present and not bound to
any action. Clicking on it triggered a traceback.

This commit stops ignoring the case when the menu cannot be
inferred from the action and hides the entire menu and submenus
for this particular action. They will be restored when entering
an action from which a proper menu can be inferred.

closes odoo/odoo#27791
2018-10-17 11:39:41 +00:00
Adrien Dieudonne 59b7dec69c [FIX] web: line chart x ticks labels overlapp
Before this commit, we tried to hide some labels depending
of the available size of the graph.
However, it doesn't worked when the graph is updated.

A much simpler solution is to use the scale’s automatic tick
generator implemented in D3.
So, in this commit, we realized that 'tickValues' is unnecessary
because data are passed correctly (see 'svg.datum(data);') and
labels are defined in 'ticksLabels'. There is nothing else to do.

We had to remove the skipped test because 'renderEnd' is not triggered
for line chart. We need to update nv.d3.

We already tried to fix this issue in the following commit:
https://github.com/odoo-dev/odoo/commit/c4937132a38873761fa0ac0b41c983b917cb52f1

Documentation:
https://github.com/d3/d3-axis#axis_tickValues

closes odoo/odoo#27828
2018-10-16 06:37:27 +00:00
Alexandre Kühn 661483c026 [FIX] web: no duplication function for change_menu_section
Revision on https://github.com/odoo/odoo/commit/b7cf456560dc4fd7c1217ba90f0b5609466ede50

The commit above assumed the function `change_menu_section` was
mistakenly removed. However, it was turned into a handler function
and renamed according to our JS guidelines `_onChangeMenuSection`.

This commit removes the duplicated logic by removing the
function `_onChangeMenuSection` and using `change_menu_section`
as the handler for the bus event `change_menu_section`.

closes odoo/odoo#27809
2018-10-15 14:37:21 +00:00
Sébastien Theys c73efc27b7 [FIX] web: stabilize sequence for new records on last page
Before this commit, the compute sequence was relying on the fact the ID was used
as a secondary order key to get the right result.

This is necessary when adding items between pages because we don't resequence
the following elements.

However this was not necessary when adding new elements on the last page since
there are no following elements to resesquence in that case.

PR: #27639
2018-10-12 14:29:51 +00:00
Lucas Perais (lpe) cba5f7a98f [FIX] web: fetch dependency fields in x2many
Image field widget need the __last_update field alongside them
for caching purposes, though that field should never be present explicitly
in the views

Before this commit, the dependencies of field widgets were not merged into
the model's fields definition, creating a traceback when adding an image field widget
into a x2many list

After this commit, there is no traceback and the image field works properly

closes #27545
2018-10-09 14:16:56 +02:00
Alexandre Kühn 5c12a664d5 [FIX] web: click on href inside kanban record
Before this commit, when clicking on a link in a kanban
record having `href` that is set, it was opening the record
and accessing the `href`.

The intended behaviour is to not open a record if any children
component of the record contains either a click event or is
a link with `href`. The former was correctly handled, but not
the latter.

This commit fixes the issue by preventing opening the record
when clicking on a inner link with href from a kanban record.

Closes #24664

closes odoo/odoo#27529
2018-10-09 08:39:50 +00:00
Lucas Perais (lpe) 62cbc5f240 [FIX] board: translate custom views according to current user
Have a user in English, put a sale report as "favorite" (pinned to dashboard app)
Change the user's language

Before this commit, the pinned view was in English (because it was recorded that way)

After this commit, the pinned view is in the user's language.

OPW 1890664

closes odoo/odoo#27574
2018-10-12 08:36:19 +00:00
Sébastien Theys 57ae9428b4 [FIX] web: prevent URL click from opening a record
If we click on a link, we only want to open the URL,
and not the record when the button is on a list.

PR: #27230
2018-10-12 12:45:38 +00:00
Benoît Fontaine 347a3bd948 [FIX] web: use correct context attribue
Disable the possibility to create partner from calendar's sidebar
The option "can_create: false" was present but badly referred

Fixes odoo/odoo#27666
2018-10-12 11:58:19 +00:00
len-odoo ad79cc09c6 [FIX] web: don't allow reference widget to be set on char fields
The reference widget is expecting a models list as selection attribute
in the field declaration.
It does not exist in the case of the char field.
Support for char fields was added to allow for external identifiers,
but it only works in readonly.
As a consequence, it tracebacks in Edit mode when used in studio.

We thusly remove char field from the list of supported fields.

opw 1892602

closes odoo/odoo#27708
2018-10-12 10:13:50 +00:00