Commit Graph
7323 Commits
Author SHA1 Message Date
Christophe Simonis b7c7591bfb [MERGE] forward port branch saas-11 up to 71773e1f1c 2017-02-01 19:08:14 +01:00
Christophe Simonis 71773e1f1c [MERGE] forward port branch 9.0 up to a53063606a 2017-02-01 18:16:15 +01:00
Géry Debongnie a28405e469 [FIX] web: pivot view properly restores row groupbys
Before this commit, when saving the pivot state in a favorite filter,
then restoring it, the row groupbys were ignored.  This commit makes
sure that we take them into account if necessary.
2017-02-01 12:18:40 +01:00
Géry Debongnie b8922c964c web: pivot view properly updates measure list
Before this commit, when changing measures from the favorites menu (by
selecting a filter with some pivot_measures), the measures in the
dropdown menus were not correctly updated.

This commits make sure that we update the active measures in the menu after
each changes coming from a do_search.
2017-02-01 11:55:53 +01:00
Christophe Simonis ba8a1c7ec2 [MERGE] forward port branch saas-11 up to e86983112e 2017-01-27 18:20:28 +01:00
Christophe Simonis 047efcbd58 [MERGE] forward port branch 9.0 up to 838beb12de 2017-01-27 16:21:51 +01:00
Olivier Dony 6edb749534 [FIX] web: provide correct autofill browser hints
Modern browser implement the autofill specs as described at
 https://html.spec.whatwg.org/multipage/forms.html#autofill

This means that there is now a way to tell the browser when a password
field is supposed to be filled with the user's own password (e.g. on a
login field), and when it's supposed to be used to input a new secret
value (e.g. when changing someone else's password).

This can be distinguished by setting the autocomplete attribute
to `current-password` or `new-password`.

In addition, many browsers have decided to entirely disregard the
autocomplete='off' attribute value, because it is felt that using
a secure password manager (as provided by those browsers) is a net
gain for security, allowing users to pick stron passwords.
See also https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion

Based on this, the framework should generally consider that
password fields in the backend are meant to be used for *setting*
new values (autocomplete="new-password", i.e. no autocompletion!),
whereas the password field on the login page can indeed be autofilled
with the user's current password (autocomplete="current-password").

In addition to making the above changes, this patch also
lets developer specify their own `autocomplete` attribute on
text input fields.
2017-01-27 14:44:36 +01:00
Christophe Simonis 6804085b8c [MERGE] forward port branch saas-11 up to b9374d5c21 2017-01-23 13:56:18 +01:00
Christophe Simonis b9374d5c21 [MERGE] forward port branch 9.0 up to 0997a1cf6d 2017-01-23 13:39:09 +01:00
Nicolas Lempereur b9db65aa73 [FIX] web: display warning message for o2m modal
Be a little less strict when not showing o2m list view warning so if the
o2m is not editable (a modal is open instead of editing inline) we still
show warnings.

Also have warnings over modal overlays so they can be used for modals.

opw-702333
2017-01-19 16:46:33 +01:00
Nicolas Lempereur 734d9b56da [FIX] web: conserve /id for saved export list
With 003d85b instead of getting the name of the relation
field_relation we get field_relation/id.

But the data about the related fields are not gotten all at once when
opening the export modal. They are gotten by clicking on the arrow of
the related record.

So we need to have these /id information saved in the export list,
otherwise for example the related records can be missing when exporting
from an export list, whilst everything was OK without using the saved
export list.

With the previous change, an export list could contain an id and .id
fields for the same relational field, so a change must also be done in
fields_info method used when getting a saved list.

opw-665994
opw-693535

note: adapted forward-port of 8.0's 29be9ae80 which was lost when
merging web enterprise onto web community.
2017-01-19 16:24:53 +01:00
Nicolas Martinelli 4cb94c9019 [FIX] web: date < 01-01-1900
The Python method `strftime` raises an error when the date is older than
01-01-1900 ("The datetime strftime() methods require year >= 1900"). If
the user mistyped the date (or was expecting 01-01-16 to be converted
into 01-01-2016), this can lead errors since the ORM uses this method
frequently.

opw-702313
2017-01-19 10:13:51 +01:00
Nicolas Martinelli 94f7f6aa22 [FIX] web: date < 01-01-1900
The Python method `strftime` raises an error when the date is older than
01-01-1900 ("The datetime strftime() methods require year >= 1900"). If
the user mistyped the date (or was expecting 01-01-16 to be converted
into 01-01-2016), this can lead errors since the ORM uses this method
frequently.

opw-702313
2017-01-19 09:52:44 +01:00
Christophe Simonis f0a5618e61 [MERGE] forward port branch saas-11 up to 6169018c33 2017-01-18 16:21:55 +01:00
Nicolas Lempereur 2d753ab5ec [FIX] web: handle widget order and custom sequence
An editable list can be drag-and-drop sorted by:

- displaying a sequence field,
- displaying a field with the `handle` widget

At first it was only working if the list was not specifically ordered,
but with 26bf35260 it also worked if the list was ordered on `sequence`
or `sequence ASC`.

This commit changes this so it works:

- if the list is not ordered (same as the original intention),
- if the list is ordered by the sequence field (widget `handle` or sequence)

This allows to have a custom model (on which we can't define _order) to be
ordered on a custom field.

This also remove a far-fetched oddity such as having the view ordered by
sequence but having a custom sequence field before `sequence`.

opw-704612
2017-01-18 14:30:57 +01:00
Christophe Simonis 482fd04167 [MERGE] forward port branch saas-11 up to f1583504ce 2017-01-10 13:46:17 +01:00
Christophe Simonis f1583504ce [MERGE] forward port branch 9.0 up to 3f7b1f6083 2017-01-10 12:07:44 +01:00
Nicolas Lempereur d40edd7052 [FIX] web: wraparound no create editable list
In e0c4ec54ca a change was done to improve the behavior in some
editable list instances, but this introduced a small issue for
list with line creation disabled.

With this change, doing tab or enter at last line should keep the
previous behavior of wrapping around and not creating a new line.

opw-703748
2017-01-09 15:03:29 +01:00
Christophe Simonis 98c71b23d3 [MERGE] forward port branch saas-11 up to 9073ecb6f5 2017-01-06 18:06:14 +01:00
Christophe Simonis de6aaeb546 [MERGE] forward port branch 9.0 up to e0d33ce07d 2017-01-06 17:37:33 +01:00
Nicolas Lempereur 4cec6fa77e [FIX] point_of_sale,web: stupid amend before merge
Introduced by 07bf7bf4f3.
2017-01-06 14:24:59 +01:00
Nicolas Lempereur 07bf7bf4f3 [FIX] odoo-bin: server UTC timezone on windows
On UNIX, the timezone modules conversions can be reset by using
`time.tzset()`. On windows this is not available and the timezone (TZ)
environment variable must be set before the first import of time module.

If not, all datetime gotten in python without specifying UTC (such as
datetime.datetime.now) could be wrong.

This was fixed with 4a77c6a0 in 2013, but has come back since 389c2ba97b
imported pkg_resources (which do  a `time` module import) before that.

closes #14926
opw-693764
2017-01-06 14:19:09 +01:00
Nicolas Lempereur 678c42aeb0 [FIX] web: FieldCharDomain wrong count if other lang
The number of records selected by a FieldCharDomain was only computed
with the base language.

But when selecting the domain with a modal window, or when sending a
mass mailing restricted to a domain, the current user language is used.

With this commit, the number of records is computed with the current
user language.

opw-693836
2017-01-05 19:18:06 +01:00
Nicolas Martinelli 35b79e30b2 [FIX] web: select completion no result
When a search is performed and the completion feature is used (search on
a many2one field), clicking on a '(no result)' item causes a crash.

opw-703557
2017-01-05 13:45:06 +01:00
Nicolas Lempereur a988653157 [FIX] web: error if chart with only zero values
We could get an js error if the chart contained zero values.

opw-703245
2017-01-02 17:31:06 +01:00
Nicolas Martinelli bb2a948216 [FIX] web: y-axis width in graph view
Simplifies the left margin calculation logic with a pre-defined width.
In practice, more use cases should be taken into account, and that could
just make the logic overkill.

opw-697626
2016-12-22 16:14:34 +01:00
Nicolas Martinelli a67ba328d7 [FIX] web: y-axis precision
In graph view, the y-axis always uses the standard float precision with
2 digits. This might not be enough if the precision was defined
differently for a given float type.

opw-697625
2016-12-22 11:25:59 +01:00
Nicolas Martinelli a552a74f4f [FIX] web: rotate graph label
When there are too many labels to display on the x-axis, they overlap
and it simply becomes unreadable. By slightly rotating them, this can be
avoided in most cases.

opw-697625
opw-697626
2016-12-22 10:06:19 +01:00
Christophe Simonis e91a8d428f [MERGE] forward port branch saas-11 up to 2a6e077f4a 2016-12-16 16:10:03 +01:00
Christophe Simonis 2a6e077f4a [MERGE] forward port branch 9.0 up to 1246a470df 2016-12-16 15:55:13 +01:00
Christophe Simonis 5f63878ff6 [MERGE] forward port branch saas-6 up to 2317801ddb 2016-12-16 14:44:42 +01:00
Christophe Simonis 2317801ddb [MERGE] forward port branch 8.0 up to 638989b84e 2016-12-16 12:45:13 +01:00
Christophe Simonis 6817134796 [FIX] web: correct display of binary field in list views 2016-12-16 11:52:21 +01:00
Jordan Vrtanoski 450f7df00d [FIX] web: transfer context to underlying many2one in reference field
Fixes #11955 (loss of context in many2one subwidget)
Closes #11957
2016-12-15 09:34:32 +01:00
Nicolas Lempereur c9cd40d0f4 [FIX] web: possible traceback when removing list row
Fix and issue is similar to odoo/odoo@1f06cc416

When clicking on delete icon before saving current list row edition (by
clicking outside the editable field), it could lead to traceback in some instances
because the deletion and saving are done concurrently.

closes #627
opw-695743
2016-12-14 19:14:50 +01:00
Denis Ledoux 487c612f0c [FIX] web, orm: allow 0 as key for selection fields
Before this revision,
using a selection field with as possible keys `0`,
such as `require_payment` in `website_quote`,
resulted to the records field values to be stored
as `NULL` instead of `0` in the database.

This leads to the inability:
 - To distinguish records with this selection field not set
   or set to `0` (as both are stored as `NULL`)
 - To search for records with the field set to `0`
   (as they are considered not set)

For instance, while having `website_quote` installed,
search for sales orders with `Payment` set to
`Not mandatory on website quote validation`: It won't
return any result, even if you have some.

opw-697454
2016-12-12 18:18:51 +01:00
Géry Debongnie 44c1fa7138 [FIX] web: prevent crash in line chart with 1 record
Since commit 8625242884, the graph view crashed when
displaying a line chart with only one record.  The reason is that the
method display_line can return undefined (if no line chart can be
displayed).  In that case, there is no reasy to try to display its
tooltip.

This commit simply protect against the case where it is undefined.
2016-12-08 10:11:24 +01:00
Christophe Simonis 5dc1c57601 [MERGE] forward port branch saas-11 up to 7842498 2016-12-01 16:59:33 +01:00
Christophe Simonis 7842498934 [MERGE] forward port branch 9.0 up to 5bed95f 2016-12-01 15:33:21 +01:00
Nicolas Martinelli e5cad9a45e [FIX] web: date autocompletion
When a user fills partially a date or datetime field, the system will
somehow autocomplete the value entered. For example, if the user enters
"11//11" then clicks on the Tab key, it will be completed as
"11/11/0000".

However, the year 0000 is not recognized in Python, and this causes a
crash upon saving.

opw-695035
2016-11-30 13:56:20 +01:00
Jeremy Kersten fee6015964 [FIX] website_sale: format amount according to currency client side
This commit closes #1103, closes #11553
2016-11-29 16:40:15 +01:00
Christophe Simonis 6a18e31cee [MERGE] forward port branch saas-12 up to c56cf85 2016-11-22 17:54:22 +01:00
Christophe Simonis c56cf85a3a [MERGE] forward port branch saas-11 up to 2633bb4 2016-11-22 17:50:41 +01:00
qsm-odoo 131a16525e [FIX] web: pivot cell clicking when no current list/form view
When clicking a pivot cell, an action is triggered using the cell data
and current action list view and form view. If no list view and/or form
view exists for the current viewmanager, the action chooses the default
list and/or form view.

The fallback when there is no list and/or form view was broken with
commit https://github.com/odoo/odoo/commit/002660a9b05cf8620e1c5287a8538ac5e806d59e#diff-9e64efee6e4d81d03c04c0aad259d99cL280,
when the views internal data were restructured.

Fixes #14392.
2016-11-22 14:44:29 +01:00
Christophe Simonis 457a705bf0 [MERGE] forward port branch saas-12 up to d1fddd2 2016-11-22 14:02:03 +01:00
Christophe Simonis d1fddd24dd [MERGE] forward port branch saas-11 up to 659fb5d 2016-11-22 13:28:15 +01:00
Christophe Simonis 42aaa68d10 [MERGE] forward port branch 9.0 up to b73518f 2016-11-22 12:41:06 +01:00
Olivier Dony b73518fe57 [FIX] web: do not cancel edition on o2m list when pressing Enter
Rev. 3f7d350fe21d9e2afb35a9ce3e2652940e3f259d1 introduced
auto-cancellation of the edit mode when the user clicks
outside the edited line.

The unfortunate downside was the auto-cancellation of the
edit mode also when the user presses ENTER while the
line is not valid.

This is especially annoying when using barcode scanners to
fill in values, as scanners usually send an ENTER keystroke
at the end of the input sequence.
When a many2one field is focused this event will often occur
before the autocompletion popup has a chance to open. At that
point the line is considered invalid, and the edition mode
is cancelled! If no field is considered dirty yet on the line
this simply drops the whole line, otherwise it will open a
navigation confirmation popup. Both results equally prevent
the use of barcode scanners.

This patch makes sure the edit mode is only cancelled when the
user indeed clicked outside the line, and not for other cases
where save() is requested, such as an ENTER keystroke.
2016-11-22 12:33:08 +01:00
Jeremy Kersten 59e816f17f [FIX] web: don't set monokai as theme for widget 'ace'
It was already working without it since commit e01837d2f4
2016-11-18 10:03:48 +01:00
Christophe Simonis 13dc7041a6 [MERGE] forward port branch saas-12 up to 1ef4061 2016-11-17 15:24:36 +01:00