Commit Graph
10512 Commits
Author SHA1 Message Date
Odoo Translation Bot 348ba041d7 [I18N] Update translation terms from Transifex 2018-02-04 04:27:20 +01:00
Martin Trigaux 3e91cbf47d [FIX] web: wrong translation
Was making the web client crash in Chinese

Fixes #22748
2018-02-02 15:39:42 +01:00
Christophe Simonis f5e7b86686 [MERGE] forward port branch saas-16 up to 920aa6174c 2018-02-01 17:02:19 +01:00
Christophe Simonis 920aa6174c [MERGE] forward port branch saas-15 up to e0422bfd6c 2018-02-01 16:40:13 +01:00
Christophe Simonis e0422bfd6c [MERGE] forward port branch saas-14 up to 7d465aa56c 2018-02-01 15:39:39 +01:00
Lucas Perais (lpe) 9fa597c7ec [FIX] web: sequence handlers on modal's one2many list
From a form view (say Bill of materials)
Edit the form
Click on a bom line
Click on the external button that makes the product form pop up
change the order of suppliers on that product

Before this commit, a JS traceback was raised
This was because the changing object was not present in the localData that the Model object holds
or more accurately, it was not the **right** model object that was targetted
and this was due to the propagation of the resequence event

After this commit, no error is thrown, and the resequencing works as expected

OPW 807196
2018-02-01 13:53:52 +01:00
Goffin Simon 695bd75a13 [FIX] web: invalid domain in DomainSelector
Backport of this commit: c13c9e0b5c
Steps to reproduce the bug:

- install application MRP Maintenance
- open maintenance request form view, and from top right corner click Studio icon
- click on Equipment field while you are still in studio interface
- It will show left side studio panel, click Domain box and it will throw an error

opw:813594
2018-02-01 10:31:14 +01:00
Nicolas Martinelli eeebd4ad85 [FIX] web: kanban containment
Set up the following kanban columns:

| Col 1 | Col 2 | Col 3 | Col 4 | Col 5 | Col 6 | F |
|       |       |       |       |       |  Card |   |

<------- Screen width ---------->

Col x are unfolded columns.
F is a folded colum.

Moving the Card from Col 6 to F is impossible: the card won't go 'out of
the screen' on the right, which prevents its center to reach F.

Commit 5ba6d93810 deactivates the drag & drop on read-only fields.
In order to restrict the kanban cards displacements, the `containment`
attribute is used to either restrict the displacement:
- in `o_kanban_view` if draggable
- in the parent if not (to allow the resequence)

The class `o_kanban_view` is too restrictive: when movind the card to
the folded column F, the card must go out of `o_kanban_view`.

opw-803929
2018-02-01 10:12:46 +01:00
Lucas Perais (lpe) e6cccbf441 [FIX] web: less boolean_toogle
Before this commit, the boolean_toggle widget was rendered
but the less contained errors that prevented it from displaying correctly
This was due to commit 9dead7e3d3

After this commit, the widget displays correctly

There might be an issue in the future because of
field_utils.formatBoolean, when this function decides to pass the full options dict

OPW 80782
2018-02-01 09:32:46 +01:00
Nicolas Martinelli a4c7481f24 [FIX] web: auto-refresh of time
When a TZ mismatch is detected, the datetime value is displayed in the
widget. However, on MacOS, this forces the dropdown list to close at
each refresh of the value, which occurs every second.

The refresh interval is set to 1 minute in case of MacOS.

opw-804035
2018-01-31 14:40:23 +01:00
Nicolas Lempereur 5b230c34cb [FIX] web: noshow list view aggregates w/ currency
In df69b5bb the aggregates of a column with currency was shown only if
records were of the same currency when a grouping was closed.

But when the list view is grouped, this would cause a number of issue:

- error if with first grouping is opened, another one is closed
- if the first grouping was closed aggregates were always shown
- the code only acts when closing a grouping
- aggregates could be shown when they should not
- aggregates could be not shown when they should

So this commit change things so this feature is ignored when the list
view is grouped.

There is also a fix so `currency_field` of the column is used instead of
just using `currency_id` that may be wrong.

note: only for saas-14 and saas-15 (feature is not present in saas-16)

opw-810835
closes #22598
2018-01-29 13:37:22 +01:00
Odoo Translation Bot 53c9858656 [I18N] Update translation terms from Transifex 2018-01-28 04:29:24 +01:00
Géry Debongnie 21c1b1acd3 [FIX] web: add target=_blank to url field widgets
Url in the web client are supposed to open in a new tab.  This was the
way it worked in v10.0 and was lost with the refactoring of the new
views.

We just reintroduce that behaviour with this commit.

Closes github issue #22389
2018-01-25 16:31:06 +01:00
Christophe Simonis 0c97be858c [MERGE] forward port branch saas-14 up to 4ea4f99df9 2018-01-24 18:12:53 +01:00
Christophe Simonis 6f2d1b8261 [MERGE] forward port branch 10.0 up to 34bfadb2f2 2018-01-24 15:50:56 +01:00
Nicolas Martinelli 34bfadb2f2 [FIX] web: suggested date
- Set the OS to a GMT- timezone (e.g. 'America/Los Angeles')
- Set the format of the date to '%d/%m/%Y'
- Go to 'Account > Adviser > Journal Entries'
- Type '02-01-2018'

The suggested date is 31/01/2018.

Setting the moment object as UTC will lead to a conversion of the date
to the OS timezone when calling `toDate`, e.g.:
Mon Jan 31 2018 16:00:00 GMT-0800 (PST)

UTC should only be used in case of datetime, not date.

opw-803466
2018-01-24 14:11:55 +01:00
Martin Geubelle 2d3ecf29b3 [FIX] web: handle nested x2m default values
A `default_get` for a x2many field can return a new list of commands for one of
its x2many field, like

[[0, 0, {
    'groups_id': [[6, 0, [1, 2, 3]]],
}]]

where [1, 2, 3] is a list of existing ids.

This use case was not correctly handled by the BasicModel because
`_makeDefaultRecord` was not recursive.

Closes #22401
2018-01-24 10:59:45 +01:00
Nicolas Lempereur 070babf7e2 [FIX] web: css long word breaking out kanban tile
When words are too long this may break out of a kanban tile and getting
everywhere.

This is not wanted and the content should be:

- hidden if overflown or
- long words should be wrapped or
- too long content should be ellipsed

The ellipsis is probably the best but this would affect the current
behavior (we would have to specify a max-height which unexpectedly
may be bothersome to currently existing data).

So breaking long words has been choosen in this change.

opw-806278
closes #22435
2018-01-23 11:04:40 +01:00
Aaron Bohy f68ad51520 [FIX] web: honor action's groupBy on reload
Let's assume an action with a 'group_by' specified in its context.
Unless another groupby is specified in the search view, the action
groupby must be used. For list views, it was only working for the
first rendering of the view. As soon as it was reloaded, the action
groupby was lost.

For instance, go to Project, click on a project in the dashboard
[the action has 'group_by': 'stage_id' in its context], switch to
list view [the list is correctly grouped by 'stage_id'], reload by
clicking on the view switcher -> the view isn't grouped anymore.

It was actually working by chance on other views because they have
specific handling of the groupby (e.g. the kanban view allows the
attribute 'default_group_by' on its arch), but by default, the
action groupby must always be used at each load/reload if there is
no other groupby specified.

This rev. restores the behavior of saas-15, before the new views.
2018-01-22 19:59:23 +01:00
Nicolas Lempereur bb833825f2 [FIX] web: set default you/all option flipped
In 60d9f6fe the ir.default replaced uses of ir.values.

But the [ir.default].set user_id has opposite meaning to
[ir.values].set_default for_all_users.

This was not taken into account when adapting javascript in 791152a87
and this commit fixes that.

opw-805871
closes #22437
2018-01-22 17:40:56 +01:00
Aaron Bohy ca323c51b2 [FIX] web: Kanban: quick create in folded column
With attribute 'on_create="quick_create"' on the arch's root node,
kanban views open the quick create widget in the first column when
the user clicks on 'Create' (in the control panel), if the view
is grouped and if there is at least one column. However, this
column may be folded.

Before this rev., the quick create was inserted into the folded
column, which didn't look amazing. This rev. first toggles the
column before inserting the quick create.
2018-01-22 08:32:57 +01:00
Odoo Translation Bot c5749ef2e3 [I18N] Update translation terms from Transifex 2018-01-21 04:24:31 +01:00
Christophe Simonis 2f95cfb8ed [MERGE] forward port branch saas-16 up to f99c4f2b48 2018-01-19 12:43:58 +01:00
Lucas Perais (lpe) 56052dee60 [FIX] web,board: a kanban button action should trigger that action
Before this commit, when having a kanban within a dashboard and clicking on an action button,
the action was not triggered, instead, the board form view triggered 'save' on the board model
leading to a server side traceback

After this commit, the action button triggers the demanded one and only this one.

OPW 805707

closes #22191
closes #22371
2018-01-19 11:26:52 +01:00
Aaron Bohy ac0e452890 [FIX] web: Kanban: create several records on slow network
Before this rev., it crashed when the user used the quick create
to create several records (very quickly, or on a slow network),
e.g. on crm.lead (there must be a date field on the kanban record
to reproduce the crash).

The crash occurred when the 'read' RPCs for the created records
return misordered. For instance:
  1) 'name_create' record 1 (called and returned)
  2) call 'read' for record 1
  3) 'name_create' record 2 (called and returned)
  4) call 'read' for record 2
  5) 'read' for record 2 returns
  6) 'read' for record 1 returns

At step 5, the kanban column was updated with the new state, but
this state already contained record 1, which wasn't fetched yet.

This rev. ensures that the created records are added to the state
once they are fetched and ready to be displayed, not before.
2018-01-19 09:57:41 +01:00
Nicolas Lempereur b8c8eaa02f [FIX] web: error image when no kanban image
Introduce back part of `formatBinary` that was reverted with 7813a8e7.

When an image is unset, the value was `false` which would end up with a
bin_size of `NaN Bytes` which would end up displaying an error image
with source `data:image/png;base64,NaN Bytes`.

This commit get back a previous behavior so the bin_size when the
attachment does not exist is an empty string (so: '').

opw-805542
closes #22348
2018-01-18 15:53:37 +01:00
Géry Debongnie 1bb6887bb6 [FIX] web: fix crash when creating record with too many default values
When creating a record with many default values, it could happen that
the number of ids returned by the default get (or onchange) exceeds the
limit for the form view.

For example, we can see the issue in the expenses list view.  We can
increase the limit in the pager, to a value higher than 40.  Then,
clicking on select all, then on 'Submit to manager' in the action menu
will result in a traceback.

The Submit to manager action will trigger a new action with a context key
'active_ids' with a large number of ids.  After that, the web client
will execute the server actions, which will return a new action with a
context key 'default_expense_line_ids' with a bunch of ids.  Then, it
will attempt to create a form view.  This will call the
makeDefaultRecord method in the basic model.  This method will generate
the commands for the one2many, for all ids, but will only load the 40
first sub records.  After, it will attempt to apply the onchanges, with
some code that assumes that all operations of type 'ADD' correspond to a
local datapoint.

In this commit, we fix the code to properly work with operations of type
ADD with a res_id, but with no id. In that case, we simply generate a
command 'LINK_TO', since the value has not been changed.

opw 804370
2018-01-18 14:13:34 +01:00
Géry Debongnie ca2060048e [FIX] web: fix issue with multiple pages and relational fields
When fetching x2manys in a x2many, the basic model did not properly sort
the internal data structure before fetching the data.  This is usually
not an issue, except when we have an order which is different from the
order of the res_ids.  In that case, it can cause crash in some
conditions, because the results from the fetchx2manybatched were applied
to the wrong datapoint.

To reproduce this issue, some specific conditions needs to be met. I
think that it is easier to refer to the test, instead of trying to
explain that.

In this commit, we properly sort the data at the correct place. Note
that this probably solves a bunch of other related issues, caused by the
fact that the internal structure was corrupted.
2018-01-17 14:26:37 +01:00
Nicolas Martinelli 00039883c1 [FIX] web: timeout of test suite
A timeout of 300 seconds is not enough anymore to run all tests on some
runbots (e.g. runbot12) or Odoo.sh installations. The duration on these
servers is often slightly over 300, leading to a failing test.

This increase is logical since unit tests are added on a regular basis.

opw-805418
opw-804621
2018-01-17 11:54:08 +01:00
Alexandre Kühn 290e247e82 [FIX] web: remove dead code
Cleaning dead code from these commits that have been reverted:

41fe7f9d1113d026b226b136b4477aaaf9f1f638#diff-54fd886cc58f994ad518ee72df4d3edeR50
2a5488619da22cfd901963dd141e722b195e82ab#diff-f96b339a9374f74489f1f98755e9787bL9253
41fe7f9d1113d026b226b136b4477aaaf9f1f638#diff-86d6d41b5bb7499bf055258d05549d59R3111

With these final changes, we hope to stop the many issues that have occured with
binary fields, from these commits:

255e8ca3d9
7813a8e714
41fe7f9d11
2a5488619d

What remains is the format of binary fields in list views without widgets,
which shows the bin_size instead of the base64 string representation...

... Rest assured, the computation is in JS, so there are no 'bin_size'
shenaningans!
2018-01-17 11:23:23 +01:00
Alexandre Kühn 2a5488619d [FIX] web: disable {bin_size: true} on binary fields
Revision on 41fe7f9d11

This commit intended to reduce the network load when reading records with
binary fields. This was made possible by enforcing the contextual key
`bin_size` to be set for records with binary fields.

However, it is causing some issues (see #22222, #22231) which are:
    - write with bin_size:true generates a traceback
    - read/search_read with bin_size:true breaks some images
      on some views (e.g. base.view_partner_form)

Since the problems outweight the gain of these changes, we revert them.
2018-01-15 10:03:14 +01:00
Odoo Translation Bot 2a244e3e66 [I18N] Update translation terms from Transifex 2018-01-14 04:22:50 +01:00
Christophe Simonis b42b9c936b [MERGE] forward port branch saas-16 up to 3b7bf3a4b8 2018-01-12 18:15:23 +01:00
Odoo Translation Bot d6e3463dcd [I18N] Update translation terms from Transifex 2018-01-12 17:48:53 +01:00
Christophe Simonis 3b7bf3a4b8 [MERGE] forward port branch saas-15 up to 8962b8ecc2 2018-01-12 17:23:10 +01:00
Christophe Simonis 8962b8ecc2 [MERGE] forward port branch saas-14 up to d35a76ee17 2018-01-12 16:47:12 +01:00
Christophe Simonis d35a76ee17 [MERGE] forward port branch 10.0 up to d76237e038 2018-01-12 16:16:51 +01:00
Alexandre Kühn 41fe7f9d11 [FIX] web: contexts on field widgets + enforce bin_size for binary
Field widgets now have a key 'context' that let them
extend the context of the dataPoint (e.g. list).

In particular, widgets on binary fields enforce the contextual
item {bin_size: True}, so that the server gives the size of the
binary field as its value, instead of its content.

This change on binary fields reduces network load when accessing
a view with binary fields.
2018-01-12 16:12:49 +01:00
Alexandre Kühn 7813a8e714 [FIX] web: binaryfile field in list views
Revert partially 255e8ca3d9

Removed widget 'download_link', as it was a sub-version of widget 'binary':
it did the exact same thing (representation of binary fields by means of a download link)
in a much better-looking way (download icon + filename as text of the download link,
instead of just a download link with text "Download").

Also, the values of binary fields might be already a human-readable binsize (e.g. 2.52 MBs),
instead of its plain textual string representation in base64:
The contextual parameter 'bin_size', when set to true, does not download the data of binary fields.
As a consequence, the server provides the sizes of the binary, instead of their value.
2018-01-12 16:12:49 +01:00
Christophe Simonis d76237e038 [MERGE] forward port branch 9.0 up to 26d3b77a1d 2018-01-12 15:32:15 +01:00
tbe-odoo d5e97eab8b [FIX] web: Kanban image not showing in some languages
- In some languages the kanban images are not displayed because of a bug in human_size method in JS.

This method translates the Unit Size for data and strip with the string with a comma as separator.
When the translatation contains spaces after the commas (like in the French translation), there is extra spaces in the final result.
This then cause an issue with the method is_bin_size that expects a unique space between the value and its unit.
Resulting in a bug in the method 'kanban_image'.

opw #804973 #804970 #804648
2018-01-12 12:05:56 +01:00
Jerther 270b2ebf81 [FIX] service, web: memory error on large DB
Fixes MemoryError when restoring large database archive.

Closes #17663
opw-788273
2018-01-12 10:17:42 +01:00
Aaron Bohy 90279c70eb [FIX] web: quick create in empty grouped kanban views
For kanban views with attribute 'on_create="quick_create' set on
their root node, clicking on 'Create' in the control panel should
open the quick create widget in the first column if the view is
grouped and if there is at least one column displayed.

It was working as expected, except when there were no record yet.

This was because the kanban controller used the 'state.count'
attribute of the state (which indicates the total number of records
in the group), whereas it should have used 'state.data.length'
(which is the number of columns).
2018-01-12 08:13:15 +01:00
Aaron Bohy 25b101f15b [FIX] web: Kanban: quick create several records in a row
Before this rev., when quick creating a record in a grouped kanban
view, the quick create widget wasn't automatically re-opened, which
didn't allow the user to quickly create several records in a row
(without clicking each time on the '+').

This desired behavior had been broken by rev. 1d34e26, which aimed
to properly reload the kanban column when a record was created
(e.g. column counter, progress bar...).
2018-01-12 08:13:15 +01:00
Géry Debongnie 27dd19c0b9 [FIX] web: prevent crash in some rare cases
When we have a form view with a one2many with an onchange, and with
lines which contains a x2many, and more lines that the limit (so more
than one page), and the read is not in the same order as what is
displayed because we have a widget=handle, then we might have a problem
when we delete one of the lines, if the onchanges tries to change the
x2many.

This is due to the fact that the order of the basicmodel datapoint is
not preserved by the various operations going around.  I think that we
may still have a few other issues of this type, but it is actually quite
difficult to establish.

In any case, this situation is now properly handled.

opw 804530
2018-01-11 16:30:34 +01:00
Denis Ledoux 78d0a32470 [FIX] web: force a determinist installed modules order for the assets
The backend assets includes a list of the installed modules with:
```
odoo._modules = <t t-raw="get_modules_order()"/>;
```

Because of the randomization of Python 3.5 in the dict keys,
the order of the installed modules could change from time to
time, therefore making the assets being regenerated unnecessarily

This revision is a bit linked to the below one:
f3bb9ae679

In addition to have the dict keys always in the same
order, it's important for the values to always be
the same, and it was not the case for this list
which was in the content of the backend assets,
in various order.

opw-804747
2018-01-11 15:48:08 +01:00
Nicolas Martinelli 411a9fa326 [FIX] web: autofocus
Support autofocus on notebook pages:
```
<page autofocus="autofocus">
```

This was supported before the web client refactoring.

opw-801259
2018-01-11 15:19:52 +01:00
Christophe Simonis a7c2a22310 [FIX] web: adapt new test introduced by previous forward-port 2018-01-09 17:58:06 +01:00
Christophe Simonis 6e25eb9b05 [MERGE] forward port branch saas-16 up to 4c410ee6a1 2018-01-09 17:03:07 +01:00
Martin Trigaux 4637bdf9bf [FIX] web: properly format translatable string
'Edit <type>View' makes untranslatable content as it is split in 3 and the type
is not translated. e.g. 'Editer FormVoir'
2018-01-09 11:23:18 +01:00