Commit Graph
8817 Commits
Author SHA1 Message Date
Christophe Simonis efe7ca16b7 [MERGE] forward port branch 11.0 up to bb6f6c57f9 2018-11-28 17:44:46 +01:00
Lucas Perais (lpe) 2e109db01b [FIX] web: context orderedBy not propagated to x2m
Have:
- Model A with a x2m to model B
- Object A with multiple objects B in x2m (that will be sorted)
- On the list view of model A, click on a column to sort by a field
- this field shall not exist in B
- open a record A (towards form view)

Before this commit, the sorting of the x2m crashed, because the key orderedBy was propagated
Due to commit e713ed2a69

After this commit, it doesn't crash

OPW 1913133

closes odoo/odoo#29094
2018-11-28 09:35:39 +00:00
Christophe Simonis b09f624f20 [MERGE] forward port branch 11.0 up to 263b388c50 2018-11-22 17:52:57 +01:00
Christophe Simonis 15f686eef6 [MERGE] forward port branch 11.0 up to 468dab6748 2018-11-15 20:39:10 +01:00
Mohammed ShekhaandTejas Shahu f3f20653d3 [FIX] web: update renderer when _callButtonAction failed
Before this rev., the following scenario didn't work:

Open manufacturing order and click on Produce button (note that
bom product should have Serial number enabled) then add quantity
in Done field in o2m and press Record Production button in wizard,
it will produce UserError and after then if you change Lot number
field in wizard's o2m then the many2one value doesn't get selected.

This occured because the renderer wasn't updated after the RPC fail
and thus still got an outdated version of the state.

The issue raised after commit: 02eef78bbd which was done to remove
useless rpc call, it's OK to remove rpc call but let's keep
updating renderer.

Related to task ID: #1852715

Co-authored-by: Tejas Shahu <tsh@odoo.com>
2018-11-15 09:37:22 +01:00
Lucas Perais (lpe) 7525455534 [WIP] looking good babe 2018-11-13 16:40:30 +00:00
Lucas Perais (lpe) 3a0f9da0eb [FIX] web: load SubViews without previous' view _view_ref context keys
On a form view (of model A), define a many2one (model B) with a [form|tree]_view_ref context key
In that view, have a x2m field (model C) with a different [form|tree]_view_ref context key

Before this commit, the second load_views (i.e. on the model C) crashed because
the wrong context key was sent to the server, which returned the view to which the _view_ref points
i.e. the view of the model B

After this commit, we clean the context of subviews loading, because those keys are only useful for the python
and one shot. Hence, there is no crash

OPW 1903780

closes odoo/odoo#28260
2018-11-13 09:02:24 +00:00
Lucas Perais (lpe) 293f9d27ad [WIP] another testable solution 2018-11-12 16:12:29 +00:00
Lucas Perais (lpe) bd83517fec [FIXUP] testable solution 2018-11-12 15:29:07 +00:00
Lucas Perais (lpe) c346428397 [FIX] web: search input date in another timezone
Put the browser in timezone Sao Paulo (Or like West of UTC)

Trigger the autocomplete (and the subsequent search) on a date field
by writing a date (in the locale format) in the search view

Before this commit, the domain sent to the server contained the date as the day
**before** the one asked for in the input

This is because, the string input is parsed and gives:
input = 12/02/2018
When creating the moment object:
> since there is no explicit time, moment will interpret it as 12am (midnight)
> We force moment to consider the string as being UTC (function: moment.utc())
> the moment contains, as output the time ** 2018-02-12T00:00:00 UTC **

When getting the facet value for making the domain
> we call toDate on the moment object, which, according to the browser is UTC and will
be converted to the locale timezone before formatting
> And the domain will use the date 2018-02-11T22:00:00 Brazil/SaoPaulo
which gives the day before the one we asked for

After this commit, this issue doesn't arise, because we use the string representation of
the moment object in search_inputs (i.e 2018-02-12T00:00:00 UTC), to create a new one
*BUT* we create it with a date format that excludes the time from being interpreted.
Also, the resulting moment object in this case is not flagged as UTC anymore

OPW 1903224
2018-11-12 14:07:36 +00:00
Lucas Perais (lpe) e713ed2a69 [FIX] web: implement filter orderedBy
related to: #28446

On a pure list view, click on a column to sort the records by that field.

Save the filter as favorite

Reload, now apply the filter

Before this commit, there were two issues:
1. The order of the list was never propagated to search view, which couldn't save
the filter with its attribute "sort"

2. There was no mechanism to load the attribute sort from a loading Filter

After this commit, those two issues are corrected
Unfortunately, complex search view flows are not testable in v11.0

OPW 1906968

closes odoo/odoo#28766
2018-11-20 13:53:52 +00:00
Nicolas Martinelli 7e840a39a6 [FIX] web: External Link
In the case of a One2many list view in a `<group>` tag, the 'External
Link' button of a Many2one field (which allows opening the form view) is
not visible.

The `flex: 1 0 auto;` should not be applied in the list view.

Corresponding PR in v12: #28741
opw-1903158

closes odoo/odoo#28812
2018-11-19 19:21:38 +00:00
Nicolas Lempereur cac9173122 [FIX] web: m2o+o2m in o2m onchange no lose data
Steps:

- open a modal form view from tree view first line and make a change
- open a modal from the second line and make a change
- open the second line back: the change were lost

In a given number of conditions (a many2one inside the form view, there
is a one2many in the form view not inside the tree view, ....) this
happened because:

- when we save the first line, we get onchange data for the second one
- this onchange data can't be applied before second line is loaded, but
  it is saved so it can be applied if second line is ever opened
- when the second line is opened the saved change is applied => OK
- when the second line is opened a second time the saved change is
  applied again, possibly overwriting posterious change => BAD

With this changeset, when the record with unapplied onchange is loaded
for the first time, the unapplied onchange is applied only once.

Added test without the change failed with:

- only 1 turtle for second partner (result: 0 not 1)
- second partner turtle is Michelangelo (result: "" not "Michelangelo")

opw-1846820
closes #28644
2018-11-19 12:57:52 +00:00
Lucas Perais (lpe) 23313583b2 [FIX] web: progressbar updates on field reset
Have a form record with a progress bar
Modify the max_value of the progress, as well as the current_value bar through an onchange

Before this commit, the new max_value was not taken into account

After this commit, it is.

closes odoo/odoo#29056
2018-11-27 08:53:17 +00:00
Lucas Perais (lpe) ac5a1662f2 [FIX] web: propagate can_create into the search popup
When creating a SO line and clicking on search more for product_id

Before this commit, every user had the button "Create" to create a product.product

After this commit, only user in groups that actually can create a product have the button

OPW 1910371

closes odoo/odoo#28924
2018-11-26 14:54:21 +00:00
Lucas Perais (lpe) c9e32872c0 [FIX] web: list default_sort with multiple fields
Define a x2m tree view with a default_sort including more than 1 field to order the list against

Before this commit, the second field was never used

After this commit, it is used

OPW 1909785

closes odoo/odoo#28840
2018-11-26 09:28:55 +00:00
Christophe Simonis 21eb31d804 [MERGE] forward port branch 11.0 up to a587325ca7 2018-10-31 19:22:21 +01:00
len-odoo 180f528528 [FIX] web: reload many2one data if the context has changed
When a view is loaded, it checks which fields it has to load.
In the case of a many2one, it could be the case that a context key is present in
one view and not in the other; if it happens, we should reload the data, as a
name_get result could vary.

opw 1891295

closes odoo/odoo#28298
2018-10-31 12:52:36 +00:00
Rémi Rahir a219bdb85e [FIX] web: consider correct viewtype when loading data
Before this commit, when loading the data and calling the prostprocess,
the viewType was not correctly passed which could lead to broken
behaviour. For example, if one was to load a record from a list view
embedded in a form view, the viewtype passed was the list which
prevented to load the data from the form view.

OPW 1891295

closes odoo/odoo#28279
2018-10-30 09:24:39 +00:00
Julien (juc) Castiaux 854208370c [FIX] web: creating a record in a grouped empty kanban view crash
When creating a record in a grouped kanban view, it tries to add
the record to the first column but if no column exist, it fails
to find the first one and raise an exception.

This PR correct that bevahior by checking it exists a column and
fallback to the view form when it does not.

opw-1902851

closes odoo/odoo#28262
2018-10-30 07:17:40 +00:00
Christophe Simonis 6136f0c02e [MERGE] forward port branch 11.0 up to e18ed24c07 2018-10-26 22:00:04 +02:00
Yannick Vaucher e968d1de7e [FIX] web: typo in docstring
The parameter would not be correctly detected by doc extractors

closes odoo/odoo#28169
2018-10-26 07:56:50 +00: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
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 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
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
Christophe Simonis 1ade6675c3 [MERGE] forward port branch 11.0 up to 717f458394 2018-10-11 16:29:46 +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 Simonis 7415f40fbd [MERGE] forward port branch 11.0 up to a69f117bbf 2018-10-10 14:40:01 +02: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
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
len-odoo 52d779007d [FIX] web: use read to update record values after resequence
Commit:
https://github.com/odoo/odoo/commit/818c18e55d0718286ff5bf332186a10f4d7a58ef
Updated the resequence logic in a way that was almost falser than before.
The added test however did work by coincidence, as index values were equal to
the sequence field values.
To be sure that we synchronize with what happens on the server, we do a read
after the resequence.
Additionnally, we take into account the result of the server resequence return;
if it is false, it means no resequencing happened, so we should not do a read.

opw 1867049

closes odoo/odoo#27184
2018-10-12 07:51:12 +00:00
8445baa08d [FIX]web: do not crash when dismissing a modal with escape
stopPropagation of navigation_move event for where direction=cancel,
currently if navigation_move event throws error when user press escape
in dialog where dialog is opened from editable list record

Scenario: Install website_sale -> Open Product form(variant enable) ->
open variant tab -> open Attribute m2o form popup and press Escape on dialog
Result: Error
Expected: It should close dialog and keep editable list view record open,
btw m2o field should also be focused when dialog is closed but that's
another issue, will be fixed in another ongoing task

Related to Issue: #1873919

Co-authored-by: Vincent Schippefilt <vsc@odoo.com>
Co-authored-by: Mohammed Shekha <msh@odoo.com>
2018-10-09 09:46:39 +02:00
svs-odoo 078b31dc7f [FIX] web: Make datetimepicker configurable in datetime fields
The datetimepicker option was introduced to be able to customize the
datetime picker widget in date/datetime fields. However, due to the way
the _makeDatePicker function was coded, it did not work in datetime
fields.

Thank to Yajo for the initial fix

closes odoo/odoo#27541
2018-10-09 12:34:23 +00:00
Lucas Perais (lpe) 1bd7adcc8b [FIX] web: debug_manager set defaults
On a form view, click on set defaults, select a value for a field,
then save

Before this commit, there was a traceback because the model on which we apply
the defaults was not found

After this commit, it works as expected

OPW 1887032
OPW 1888715

closes #27148
2018-10-01 09:31:15 +02:00
Martin GeubelleandAaron Bohy f4b2060af5 [FIX] web: handle lazy load with previous actions
Before this rev. the lazy loading of views was correctly handled if there was
only one action in the action stack (which is usually the case when performing a
F5, the main use case of the view lazy loading).

Nevertheless, it might happen that the lazy-loading is used in top of other
actions (when performing a `doAction` with a form view for an action with
another view as first view, i.e. when leaving Studio while editing the form view).
The controller was `unshift` in the case (put in the first position of the
controller stack), which is not correct.

This causes the breadcrumb to be misordered and a traceback occured when trying
to access a breadcrumb element.

Co-authored-by: Aaron Bohy <aab@odoo.com>
2018-09-27 12:34:04 +02:00
Vincent Schippefilt 9960e48e86 [FIX] web: on MAC, remove access keys activation interference
On MAC, some characters can only be typed using the ALT+Number that was
reserved for the menu access keys.
There is a system in place to collect the ALT+Number keys and force the
activation of the shortcut to make the experience better for all users
across all machines.

This fix remove this system that collects ALT+Number or other keys on MAC

Ticket number : 1887171
2018-09-21 10:55:38 +02:00
Christophe Simonis 0942a57b5a [MERGE] forward port branch 11.0 up to f2b8caff07 2018-09-17 18:03:41 +02:00
Alexandre Kühn a6516c3533 [FIX] web, website: root.widget defined even without website
Revision on https://github.com/odoo/odoo/commit/0de5c1f076d7e7d0e5361e08c810c727bd41d9e0

With the commit above, the following error was shown in the devtools
when accessing a frontend page without website that is installed:

  missing module "[root.widget]"

This is caused by the fact that there is no root widget in the frontend
bundle without website installed. This may prevent executing tours
in some cases, because the tour manager needs a root widget to run.

This commit solves this issue by ensuring a root widget in the frontend
even when website is not installed, so that tour manager can run.
2018-09-17 15:22:30 +02:00
Martin Trigaux 14a9b988f4 [FIX] web: graph_renderer: check graph data before rendering
cherry pick of 634de21b76
Before this commit, we had two different errors when data was
unavailable:
The first one is generated by Odoo: "No data to display, try to[...]"
The second one is generated by nvd3: "No Data Available".

We always want the same message.
So now, we always make some checks before rendering
the graph by calling _render.

opw-1874349
2018-09-14 16:15:43 +02:00