Commit Graph
12325 Commits
Author SHA1 Message Date
Nicolas Lempereur 98f5ab8489 [FIX] web: not loose footer in some case 08b2d1f9a
08b2d1f9ac was intended so margin on the top of the body worked (it
seems that wkhtmtopdf only started the body from the first visible
elements).

From a subsequent report, on some document template the CSS could have
adverse effect of not showing the footer.

With this changeset, the CSS is only applied on the body which was the
first intention.

fixes #31531
opw-1925894
closes #31533
2019-03-01 12:59:43 +00:00
Martin Geubelle e39bcae818 [FIX] web: avoid crash when clicking on colored m2m in list
With the BS4 update, a traceback occured when clicking on a m2m tag using colors
in a list view.

When using colors on m2m tags, the badge was wrapped inside a `dropdown-toggle`.
However, there is no `dropdown-menu` by default (it is only rendered in FormFieldMany2ManyTags
when clicking on the `.dropdown-toggle`, hence the traceback.

The `dropdown-toggle` class is now only set if necessary.

Task 1925313

closes odoo/odoo#31445
2019-02-27 11:39:52 +00:00
Nicolas Lempereur 08b2d1f9ac [FIX] web: margin-top on top of report
The margin-top/margin-bottom on a address on the top of the report does
not work because:

- display flex on an address in wkhtmltopdf is not perfectly implemented
  and seems to remove vertical margin
- margin-top on the page first visible element is removed

To fix this issue, this code remove the display:flex on the address
widget and add an empty "visible" element at the start of pages.

opw-1925894
closes #31184
2019-02-18 10:46:41 +00:00
Lucas Perais (lpe) 6530f1253d [FIX] web: list editable create then escape
Have an editable list that begins with a date/time field
create a line.
The first field is focused and the datetimepicker is popped up

Now, stroke ESC key

Before this commit, there was a traceback because the datetimepicker received an erroneous
BLUR/INPUT event

After this commit, there is no traceback as we detroy the widgets of the line
(including the datetimepicker) before removing the row from the DOM

OPW 1932409

closes odoo/odoo#31342
2019-02-26 07:07:09 +00:00
Odoo Translation Bot 917ad03026 [I18N] Update translation terms from Transifex 2019-02-24 01:37:50 +01:00
Aaron Bohy 7ffe3ce5c6 [FIX] web: kanban: rendering of async widgets
This rev. fixes 3 issues with async (field) widgets in the kanban
view.

From rev. 5faec34a, widget'$el doesn't exist before start. This
means that for async widgets, one can't interact with the widget's
$el right after calling appentTo. In KanbanRecord, this is exactly
what we did for both field widgets (<field name=.../>) and widgets
(<widget name=.../>).

Moreover, when the kanban view was updated (e.g. when the user
refined the search using the search view), and the rendering was
async (because of the presence of an async widget), the renderer
didn't wait at all for the widget to be ready before updating the
view. This caused flickering, mostly, but also a crash in
accounting with the JournalDashboardGraph widget (because
on_attach_callabck was called before the widget was ready). To
reproduce this particular issue, go to accounting, add a filter
that doesn't match any record and save it as favorite (default),
press F5 (no record is displayed), remove the filter.

opw-1925079
opw-1925479

Fixes #30087
Closes #31254

closes odoo/odoo#31327
2019-02-21 13:54:47 +00:00
Odoo Translation Bot e2afb0755d [I18N] Update translation terms from Transifex 2018-11-01 02:44:41 +01:00
Christophe Simonis 21eb31d804 [MERGE] forward port branch 11.0 up to a587325ca7 2018-10-31 19:22:21 +01:00
Julien (juc) Castiaux 60d519b890 [FIX] web: format function missing in percentage widget
The format function was missing for the percentage widget type, so
`field_utils.parse[this.formatType]` (see [1]) resolved as
`undefined` which is not a function and so raised an error when
the user was trying to update the field.

This PR add that parsing function. Both `xx%` and `0.xx` are
understood by the parser and resolve to the correct float value.

opw-1895979

[1] https://github.com/odoo/odoo/blob/e220721a8ee80c02fe5aba5ed8c9f3f4ae54ea97/addons/web/static/src/js/fields/abstract_field.js#L399

closes odoo/odoo#28431
2018-11-08 09:51:38 +00:00
qsm-odoo 566cece592 [FIX] website, *: review auto light and dark colors
* web, web_editor

The logic which chose if the user text color was supposed to be used as
bootstrap "dark" text color or bootstrap "light" text color
(https://github.com/odoo/odoo/commit/8b2dbd1441d6713d9072db03e8d3cb6c2246410f)
was fine when using the default theme with default bootstrap but was not
working as intended in some themes.

This commit also introduces a more accurate and complex method to
determine the correct contrasted color in most cases.

closes odoo/odoo#28468
2018-11-07 17:41:08 +00:00
Christophe Simonis 3b3a65bef0 [MERGE] forward port branch saas-11.4 up to dc35de9d30 2018-11-06 14:12:51 +01:00
Géry Debongnie baeb1a1938 [FIX] web: accept field name as a groupby descriptor
In some cases, and for historical reasons, the groupby property can be
expressed as a string (for example, 'stage_id') instead of a list of
strings (for example, ['stage_id']).

However, the support was not complete. A crash could happen in some
cases. For example, if there is a group_by: 'stage_id' property in the
context of an action, it works in list view, but adding that view to the
dashboard would result in a crash, without this commit.
2018-11-06 08:53:21 +00:00
Mohammed ShekhaandPriyanka Kaakdiya 006c31b955 [FIX] web: re-evaluate column_invisible after onchange
Let's assume a form view with field A and B (a one2many list), with
a column with attrs column_invisible depending on A.

If the user sets A manually, everything works fine (the column is
hidden/shown directly). However, if A is updated by an onchange
(e.g. depending on the number of rows in B), it doesn't. This
rev. fixes that issue.

Related to Issue: 1851451

Co-authored-by: Priyanka Kaakdiya <pka@odoo.com>
2018-11-05 13:57:39 +01:00
Christophe Simonis f6ca72b3ce [MERGE] forward port branch saas-11.3 up to 21eb31d804 2018-10-31 20:43:03 +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 b106b7ce0b [MERGE] forward port branch 12.0 up to dd70c68426 2018-11-06 16:40:07 +01:00
Christophe Simonis a299517f83 [MERGE] forward port branch saas-11.3 up to 6136f0c02e 2018-10-29 11:56:32 +01:00
Christophe Simonis 6136f0c02e [MERGE] forward port branch 11.0 up to e18ed24c07 2018-10-26 22:00:04 +02:00
svs-odoo e10fd34682 [IMP] web: load tags in kanban view in one batch
Add an 'enableRelationalFetch' option in _readGroup who force to make
only one rpc for x2m and reference fields.
Usefull to avoid useless (and blocking when too numerous) rpcs (tags
field in a kanban view for example).

Task #1878113 (2/2)

closes odoo/odoo#27731
2018-10-30 12:58:36 +00: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
Christophe Simonis cc8e8237bf [MERGE] forward port branch 11.0 up to 84500c27b1 2018-10-25 13:59:45 +02:00
Géry Debongnie 5ab5ccba40 [REF] web: remove useless code
The utility function xml_to_json, which is mainly used by the views to
parse their arch (from string to xml tree) had a peculiar behaviour: it
tried to process some attributes as json.  If by chance, these
attributes are valid json, then they are replaced by their parsed value.

It is difficult to say why it could be useful.  Maybe this was done to
prevent using pyeval many times later on.  But if that is the case, it
should be done by the view code and not the utility function (the view
can precompute all attributes once).

Also, this behaviour is annoying for code later in the chain, which
needs to check if what it gets is an object or a string.  With this
change, attributes are always returned as string (at this point).

closes odoo/odoo#28133
2018-10-25 07:56:30 +00:00
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
Odoo Translation Bot c2c88f359d [I18N] Update translation terms from Transifex 2018-10-25 10:21:44 +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
Odoo Translation Bot 98ee84e976 [I18N] Update translation terms from Transifex 2018-10-21 03:22:16 +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
Odoo Translation Bot 790bd62f14 [I18N] Update translation terms from Transifex 2018-11-04 01:27:12 +01: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
Odoo Translation Bot 29dc21ae4b [I18N] Update translation terms from Transifex 2018-10-28 01:25:21 +02: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 dd94d06727 [FIX] web,base: report body rtl/ltr of language
Currently, the RTL/LTR direction of a report is the language direction
of the current user printing the report.

So for example a customer invoice in french can be RTL and a customer
invoice in arabic can be LTR.

With this changeset we keep a reference to the body language and use it
to choose direction later on.

opw-1890833
closes #27878
2018-10-23 15:51:16 +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