Commit Graph
8105 Commits
Author SHA1 Message Date
Khoi Nguyen 5854bb7d12 [IMP] web: Add disableDrop option to dragAndDrop
In some situations, it would be desirable to be able to attempt a drag
and drop, without actually triggering the dropping action. As an
example, we would like to see whether dragging a new field in studio
ensures that a class 'o_web_studio_nearest_hook' be assigned. This can
only be tested *before* the new field is dropped.

This commit adds an optional argument 'disableDrop' to the
dragAndDrop method, and sets it by default to false. The dropping action
will then only be triggered if the aforementioned parameter is set to
false.
2017-07-06 11:50:35 +02:00
Khoi Nguyen 79c9f0a7a5 FIX web: clear cache after 'reload' client action
If the 'reload' action is triggered right after a view change, the
latter will only be effective if we refresh the page at the browser
level. To overcome this, we clear the cache every time the 'reload'
action is triggered.
2017-07-04 10:31:09 +02:00
Christophe Simonis dd43071638 [MERGE] forward port branch saas-16 up to 278e478d55 2017-06-27 14:19:31 +02:00
Aaron Bohy 05282fd434 [FIX] web: pyeval_tests: typo
Introduced by forwardport 34b432d528
2017-06-27 10:22:35 +02:00
Christophe Simonis 34b432d528 [MERGE] forward port branch saas-15 up to 4d79a1ff58 2017-06-26 19:19:39 +02:00
Christophe Simonis e1c74e374c [MERGE] forward port branch saas-14 up to 3bac72ba74 2017-06-26 14:04:04 +02:00
David Monjoie 99ce9e7c60 [FIX] web: fix duplicated tags at re-render 2017-06-23 16:36:38 +02:00
David Monjoie 378efa1444 [FIX] web: update filename correctly in binary fields
The update_field event is not used anymore so it needs to trigger
a field_changed instead.
2017-06-23 16:16:36 +02:00
David Monjoie 9d1744b797 [FIX] web: fix kanban view grouped on unset m2o
The previous code loading the tooltip data was sending a null value
to read as id, which resulted in an access error. This behavior was
not observable in the tests because of b8c1571 which was meant to
allow giving inexistant ids to mockRead but also ended up accepting
falsy values, which was not true to the actual server.

In addition, the title of the column was wrong for unset m2o, it
displayed false, the value of the field when unset, rather than
the default "Undefined" title.
2017-06-23 09:58:46 +02:00
David Monjoie 0236ac510b [FIX] web: update buttons in editable list view when no changes
When I introduced this line in 374295b, I was working on the form
view and didn't realize I would be breaking the editable list view.

The _setMode function only updates the buttons when given the id of
a record. Since I was working on a form view at the time, I didn't
need to give a recordID to make it work since the default ID of a
form view is the id of the record itself. However, in editable list
view, the id of the view is a list of ids, so the buttons would not
be updated in this case.
2017-06-23 09:58:45 +02:00
David Monjoie 3cbfc40303 [FIX] web: fix m2o with show_address
When the show_address option is enabled, the display_name of a
partner becomes a newline concatenated version of his name and his
address, so the internal value of the widget is this conglomerate.

However, if one uses a keypress that does not change the value of
the input in edit mode, say ESC for example, the keyup handler of
this widget will compare the value in the input with its internal
value. If the internal value is still the conglomerate, which is
the case if the user hasn't changed the input content since
switching in edit mode, we need to trim it to compare it to the
actual input value, which is the "standard" display_name, ignoring
the magic show_address feature which is only used in readonly.
2017-06-23 09:58:43 +02:00
David Monjoie 1192ca1048 [FIX] web: fix searching on datetime fields
Previously, one could not create a custom filter on a datetime
field without encountering a crash.
2017-06-23 09:58:42 +02:00
Sanjay Jamod acfb54055a [FIX] web: upgrade boolean fields in Settings
Before this rev., there was a traceback when clicking on an
upgrade boolean field's checkbox.
2017-06-22 20:48:59 +02:00
Martin Geubelle c62a4edcb0 [FIX] web: set 0 as default value for numeric fields
When creating a new record, the numeric field default value should be 0 in order
to avoid manually setting mandatory fields to 0.

This behaviour has been removed with the new views but one wants to restore it.

The `mockRead` function has also been adapted in this commit because the server
returns 0 for unset numeric fields.
2017-06-22 10:52:26 +02:00
Martin Geubelle 3de0715f12 [FIX] web: basicController: stop translate event
Before this fix, a traceback occured when we clicked on the translate icon
in a form dialog.

The `translate` event wasn't stopped and was thus handled by the dialog's form
controller and by the main controller.
2017-06-21 16:42:56 +02:00
qsm-odoo 44d8255ee7 [FIX] web: make datepickers visible in modals
Following commit 3741603495:
Datepickers are indeed able to overflow their parent which scrolls.
However, they were not put above modals anymore.
2017-06-21 15:49:43 +02:00
Adrien Dieudonne 5fa51c5201 [FIX] web: basic_controller: avoid multiple name_create
Before this fix, multiple records were created if you clicked
on the quick create of a many2one in a modal.

The 'mutexify' event wasn't stopped and was thus handled by
the dialog's form controller and by the main form controller.
2017-06-21 13:30:40 +02:00
qsm-odoo 85d1e76ddb [IMP] web, *: reorganize our libraries' extensions
* web_editor, web_tour, website_event_track

Before this commit, one JS file was responsible for all the library
extensions and fixes. There were two main problems with this system:

- The file was only available in the backend (as some extensions are
  made on backend-only libraries).

- Some other modules were doing library customizations.

This commit creates one file per library to regroup their associated
customization and adds them in the right asset. These are placed in
the web module and every other module should avoid doing customizations.
This allows to have libraries consistency accross all modules and
between the backend and the frontend.
2017-06-21 12:56:13 +02:00
Martin Geubelle e921f14d24 [FIX] web: disable phone test with voip
The module `crm.voip` alters the focusable behaviour of the phone
widget by overriding the `canCall` method.

We thus disable this test if the module is installed.
2017-06-21 11:44:53 +02:00
Nicolas Martinelli 6aa94a5eea [FIX] web: remove "Edit Workflow"
Since all workflows have been removed, remove the menu to edit it, since
it generates a traceback and confuse users.
2017-06-21 08:20:01 +02:00
Prakash Prajapati 8f099d4528 [IMP] base_automation: Improve field labels naming in automated action
Purpose
=======

Some field labels are not very explicit

Specification
=============

- Rename "Base Model"  into "Model"
- Change "Trigger condition" (Condition Frist char(C) uppercase)
- Rename Domain into  Apply on
2017-06-20 11:19:02 +02:00
Martin Geubelle 28b67ee7dc [FIX] web: properly handle tab navigation with widgets in edit
Rev. https://github.com/odoo/odoo/commit/c5f8f35747b4ca9633c664d6be74614c5ce22fcd
introduced a regression: the input of widgets 'email' and 'url' was not correctly
focused anymore with tab navigation.

The method `getFocusableElement` on their common parent (`InputField`) has not been
correctly overriden because `_super``was not called in edit mode.
2017-06-20 11:17:35 +02:00
fka-odoo 30783c7a43 [IMP] web: Time(hours,minutes,seconds) should be calculate using timedelta with datetime on web client, added test cases for pyeval datetime.timedelta 2017-06-20 10:00:12 +02:00
Martin Geubelle c5f8f35747 [FIX] web: properly handle tab navigation in readonly
The tab navigation was only working in edit mode. Entering a readonly form
view with input fields was causing a traceback.

As the default browser behaviour has been overriden with custom navigation,
we need to specify which widget can be focused (e.g.: url, many2one, etc.).
2017-06-19 16:47:34 +02:00
Martin Geubelle 21fca784dc [FIX] web: Kanban: avoid ghost records when moving record
In an empty kanban view, when moving a freshly created record from
the second column to the first one, then moving it back again in to
the first one, the record was mysteriously duplicated.

When moving the record, it should be removed from the old column.
In this case, the second column was not found (and thus the record
not removed) because the iteration was on `parent.count` (which is
the count of records in this datapoint (1 in our case)) and not
parent.data.length (the number of columns).
2017-06-19 16:47:33 +02:00
qsm-odoo f92b1a2e96 [FIX] web: failed forward-port of https://github.com/odoo/odoo/commit/c4c9347b9986f60f1b8a534b805e248b25e3eef8
The mentioned commit exposed a `Dialog` instance thanks to a return and
an event triggering. The forward-port failed in saas-14 as the code
landed in the wrong function.

As the event trigger seems to be useless code without any context and
that this code has been hugely refactored in recent versions, this
commit simply removes it.
Feel free to expose variables again in version 11.0.

opw-748027
2017-06-19 16:14:00 +02:00
qsm-odoo caa4cd2063 [FIX] web: use 'o_input' class on search view elements
Since the new views, the 'o_input' class has to be set explicitely on
<input/> and <select/> elements to have the proper styling.
2017-06-19 11:32:42 +02:00
David Monjoie b8c1571d94 [FIX] web: prevent crash when giving wrong id in url
The mock server had to be modified in order to test this behavior
since it used to throw an error for invalid ids, while the actual
server just ignores it and continues forth with the other ids.
2017-06-19 07:56:42 +02:00
David Monjoie 584c60f1ba [FIX] web: display buttons without icon in list view
Previously, the button was completely invisible when no icon
was given, which is a regression from saas-15 where the string
attribute is used to write the button label.
2017-06-19 07:56:41 +02:00
Aaron Bohy 8859d25bc5 [FIX] web: FieldWidgets: use correct format/parse functions
Field widgets must format and parse values according to the widget
type, not to the field type. For example, if a monetary field is
inserted in a form view with widget="float", the field's value must
be formatted with the float formatter, not the montetary one. This
wasn't the case before this rev.
2017-06-16 11:14:16 +02:00
Aaron Bohy 1fa67917ba [FIX] web: allow to move cursor in inputs with arrows
Commit 9966e4b added calls to preventDefault() on the keydown event
for left, right, up and down arrows, to prevent the page from
scrolling. However, it also prevents the cursor from moving inside
the inputs. Since the initial issue only concerned checkboxes, this
rev. moves the preventDefault() calls from AbstractField to
FieldBoolean.
2017-06-16 08:00:24 +02:00
Christophe Simonis ed2ddeccdf [MERGE] forward port branch saas-16 up to 1b50c829ef 2017-06-15 18:46:47 +02:00
Christophe Simonis 1b50c829ef [MERGE] forward port branch saas-15 up to 9713dc2e1f 2017-06-15 18:44:16 +02:00
Martin Geubelle 0c2e018d4c [FIX] web: display dashboard graphs in full-width
With the new views, the class `o_field_widget` is added on every field widget
and is styled with `display: inline-block`.

The dashboards used to display graphs in full-width so this behaviour is
restored.
2017-06-15 13:22:08 +02:00
Martin Geubelle d88d1abcf0 [FIX] web: reimplement group_by_tooltip option in kanban
This option hadn't been implemented in the new views.
It allows to display informative explanations as tooltips on column over.

It can be set on a many2one field in the kanban view, e.g.:

```<field name="stage_id" options='{"group_by_tooltip":
    {"<tooltipFieldOnStageModel>": "<ABeautifulTitle>"}
}'/>
```

An extra RPC needs to be done on the many2one relation to fetch these additional
fields and the data are stored in the datapoint under the key `tooltipData`.
2017-06-15 13:22:07 +02:00
Martin Geubelle 46751de506 [FIX] web: correctly style o_status class
The `o_status` style has been moved in a previous rev. in `fields.less` which
is only for `o_field_widget` nodes.

This class however is used in other context than a field (e.g. on a label in
the project.task.type form view) so its style needs to be placed at an upper
level.
2017-06-15 10:59:35 +02:00
Aaron Bohy f6525c6b6c [FIX] web: BasicModel: onchanges: send all values
Since commit ebd17217c4, values of readonly fields inside x2many
fields weren't sent for onchanges, whereas they should. This was
for example an issue on the stock.picking form view (which is in
state 'draft' by default). If the user added a stock.move, the
state field on the move wasn't sent for the onchange, and thus the
state field on the picking was set to false.
2017-06-15 08:39:50 +02:00
Aaron Bohy a3bea9a62b [FIX] web: Form: delete the correct record
When the user duplicated a record 'A', and deleted the new record
'A (copy)' directly, the wrong record was deleted: 'A' was deleted
instead of 'A (copy)', because de id of 'A' was bound to the delete
handler, and it wasn't updated after the duplication.

Also correctly updates the record's offset after the deletion, so
that it doesn't produce a warning when deleting the last record of
the dataset.
2017-06-14 10:15:37 +02:00
Aaron Bohy 70624772b2 [FIX] web: Pivot: allow to click on a cell
Before this rev., when the user clicked on a data cell of a pivot
view, it crashed. This was due to several problems, fixed by this
commit.
2017-06-14 10:15:37 +02:00
Christophe Matthieu 83115b2a10 [FIX] web: SelectCreateDialog uses the domain of the view when searching
before this fix: the domain is used when opening the dialog but it is not
used if the user update the filter or the group_by.
2017-06-13 15:47:47 +02:00
Aaron Bohy 708c1c2915 [FIX] web: false id should remain false in evalContext
'id' is a particular field that should not be considered like other
integer fields. For instance, in the evalContext, its value should
not fallback to 0 if it is false. This would break domains in attrs
like ['id', '=', False], which is supposed to be true on new (not
saved yet) records.

This was for example the case in the Product form view: go to Sales
Orders form view, add a line, on the product field choose 'Create
and Edit', try to save the product -> error: field Product Template
is required but not set (actually it is invisible), as its required
modifier says ['id', '!=', False], which was always the case.
2017-06-13 09:26:40 +02:00
Aaron Bohy ebd17217c4 [FIX] web: BasicModel: don't write on readonly fields
Ultimately, it seems that sending the value of readonly fields
when saving is not such a good idea. Suppose that there is a
computed field displayed as readonly in a form view. This field is
computed from other records, e.g. from a one2many field which is
editable in the form view. Finally, the inverse function of the
computed field creates the one2many records. If the user adds some
records to the one2many, then saves, the readonly computed field's
value is sent to the server as well, and thus the inverse function
is executed, which isn't what we want.

This commit essentially reverts 0494d61274, except that we now take
into account the readonly modifier to determine whether or not a
value is sent to the server, and not only the readonly attribute of
the field (which can be seen as a default). Before rev. 0494d61274,
we made a difference between write and create RPCs, for an unclear
reason. We don't do that anymore: readonly fields are never sent to
the server (same behavior as before the new views).
2017-06-13 08:24:59 +02:00
Aaron Bohy 5c4485d182 [FIX] web: Many2one in X2Manys: quick create then save line
A problem occured with a required Many2One inside an X2Many (e.g.
order_line field in sale.order form view). If the user clicked on
'Add an item' to add a row, then typed some text in the Many2One,
then clicked on 'Create ...' to quick create a new product, and
then directly clicked on 'Add an item' to add another row (before
the name_create returned), the first row was discarded.

This was because before the name_create returns, the Many2one still
has no value, and as it is required, the row was considered invalid
and then discarded.

This rev. ensures to wait for the name_create to return before
trying to save the row and to create a new one.
2017-06-13 08:24:59 +02:00
Christophe Simonis a47a95cde0 [MERGE] forward port branch saas-16 up to 76262f2043 2017-06-12 20:41:44 +02:00
Christophe Simonis 76262f2043 [FIX] web: handle correctly deactivation of duplicate option
This new behavior has been introduced by previous forward-port.
2017-06-12 20:10:11 +02:00
Christophe Simonis 50d8ea1d58 [MERGE] forward port branch saas-15 up to aae12c2bad 2017-06-12 19:37:28 +02:00
Christophe Simonis aae12c2bad [MERGE] forward port branch saas-14 up to 62fec71568 2017-06-12 19:19:42 +02:00
Christophe Simonis 62fec71568 [MERGE] forward port branch 10.0 up to fcc33f3e09 2017-06-12 18:55:24 +02:00
Christophe Simonis fcc33f3e09 [MERGE] forward port branch saas-11 up to 6ceecffcad 2017-06-12 18:52:53 +02:00
Christophe Simonis 6ceecffcad [MERGE] forward port branch 9.0 up to d9d455bea3 2017-06-12 18:18:05 +02:00