Commit Graph
12130 Commits
Author SHA1 Message Date
Odoo Translation Bot 2cc3ec0b8a [I18N] Update translation terms from Transifex 2019-06-30 01:17:50 +02:00
Christophe Simonis cd21c016b0 [MERGE] forward port branch saas-11.3 up to 2f2bc67c06 2019-06-27 17:24:24 +02:00
Christophe Simonis 2f2bc67c06 [MERGE] forward port branch 11.0 up to b1d43cc80e 2019-06-27 14:40:32 +02:00
Christophe Simonis b1d43cc80e [MERGE] forward port branch saas-15 up to d090c92782 2019-06-27 14:25:31 +02:00
Christophe Simonis d090c92782 [MERGE] forward port branch saas-14 up to 1985a49b92 2019-06-27 12:41:55 +02:00
Christophe Simonis 1985a49b92 [MERGE] forward port branch 10.0 up to 5eb15c01b5 2019-06-27 12:41:15 +02:00
Priyanka Kakadiya 5eb15c01b5 [FIX] base, web: missing extension on binary downloads
It's currently possible for binary downloads to be missing an
extension entirely. Generate an extension from the mimetype and use
that. Also ensure the existing extension (if any) matches the
mimetype.

Warning: this may require adding new mimetype/extensions pairs to the
local mimetype database similar to
f413d155df.

Also fix missing or incorrect filenames on records without a filename
field: in some Odoo versions the client would send a filename of
"null", resulting in a download of e.g. "null.pdf" instead of the
attachment or inferred name.

Task 2025716

closes odoo/odoo#34299

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2019-06-27 08:26:49 +00:00
Mathieu Duckerts-Antoine 89d5cc3b3d [FIX] web: measure/groupby many2one variation in pivot view
In case a many2one field (let us say 'foo') is used
simultaneously as a groupby and a measure in the pivot view,
the values returned by a read_group for that many2one are of
the form [id, label] and the aggregated values (always 1) are
missing in the read_group results (datapoints).
Thus typically, a datapoint is of the form

{'foo': [1, 'Bar'], '__count': 4, ...}

and does not contain information on the 'foo:count_distinct'
value (this is a read_group bug).

As a consequence, a special processing of the read_group
datapoints is done in the pivot model to handle that
situation and the value for 'foo:count_distinct' is infered
correctly to be 1.

In the pivot comparison mode, datapoints comming from the
period and the comparison period (data and comparisonData
sets) are identified if they have same values for the groupby
fields and the measure values become small objects containing
information on the the measure values for data and for
comparisonData and on the related variation.

Thus

{foo: [1, 'Bar'], __count: 4, ...}

from data and

{foo: [1, 'Bar'], __count: 3, ...}

from comparisonData should become a single datapoint

{
foo: [1, 'Bar'],
__count: {
data: 4,
comparisonData: 3,
variation: {
magnitude: +33 (%)
}
}
fooAggregate: {
data: 1,
comparisonData: 1,
variation: {
magnitude: 0 (%)
}
}

It turns out that the code responsible for merging the data
and comparison datapoints made a mistake by mixing the keys
'foo' and 'fooAggregate', with the consequence that the
variations were not correctly computed in the situation
described above.

This is fixed in this commit.

closes odoo/odoo#33118

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-06-25 11:18:02 +00:00
Odoo Translation Bot 149783fb19 [I18N] Update translation terms from Transifex 2019-06-23 03:06:47 +02:00
Odoo Translation Bot 53b6ab9f05 [I18N] Update translation terms from Transifex 2019-06-23 01:17:13 +02:00
Julien Castiaux 81147140ac [FIX] calendar: shift midnight to current locale
Configure your system to be in the Mexico timezone, configure your Odoo
profile accordingly. Go to calendar, show daily events, add an event at
the end of the day (like 10pm). The resulting event is not visible on
the daily view although it is on the weekly view. The same problem
occurs on the weekly view if the event was create late the last day.

The problem is the initial `search_read` has a domain to filter the
events using 00:00 UTC to 23:59 UTC boundaries. Those boundaries are not locale
aware, they should be shifted to the MX timezone.

opw-2009877

closes odoo/odoo#34247

Signed-off-by: Julien Castiaux <Julien00859@users.noreply.github.com>
2019-06-19 14:38:00 +00:00
Nicolas Lempereur 97cd3dfdf9 [FIX] web: update moment ar locale for month
The months name in momentjs used an arabic translation with the month
then some crap (or the month said a second time) after.

This does not seem expected, and has been solved in moment.js library 2
years ago:
https://github.com/moment/moment/pull/4271

This PR apply this change in moment.js localization included in Odoo.

opw-2006265
closes #34248

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-06-19 15:00:27 +00:00
Mathieu Duckerts-Antoine 92a1f215c0 [FIX] web: pie chart structure not modified by favorites
A pie chart widget aims to instantiate a graph view in mode
'pie', with a measure and a single groupby specified via some
attributes. It turns out that if a pie chart is instantiated
in a context in which the keys 'graph_mode', 'graph_measure',
and 'graph_groupbys' are present, that keys prevail over the
pie chart specification. This can produce a line chart for
instance. This fix corrects that situation.

A test has been added in a corresponding commit in enterprise
(historically, the pie chart widgets are tested in dashboard
views).

closes odoo/odoo#34234

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-06-19 08:36:44 +00:00
Nicolas Martinelli 32603da5ba [FIX] web: avatar on empty field
- Create a calendar event
- In debug mode, remove the responsible

The 'Avatar Undefined' string is displayed at the botton of the
responsibles' list.

Do no fetch an image for a falsy value (= falsy id)

opw-2010007

closes odoo/odoo#34215

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-06-18 13:09:28 +00:00
Jakub Hrubý 36abc4641c [FIX] web: keep the search options visibility state
The search buttons visibility is saved in the local storage. Rev.
6448420 changed the API of the LocalStorage servive (by JSON
parsing the values), and didn't adapt the calls done for the
search buttons.

Closes #33833

closes odoo/odoo#34206

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-06-18 10:13:39 +00:00
Christophe Simonis a2582c4252 [MERGE] forward port branch 11.0 up to bdc62d8031 2019-06-07 13:00:07 +02:00
Odoo Translation Bot 34ae29e68b [I18N] Update translation terms from Transifex 2019-06-09 03:07:58 +02:00
Odoo Translation Bot 25eac59ffa [I18N] Update translation terms from Transifex 2019-06-16 01:18:49 +02:00
Julien Mougenot d7d7d92e92 [FIX] web: binary fields correctly resets
When uploading a file to a binary file, then clicking on the
"clear" button, then reuploading the same file...

Before this commit:

The actual input of the field was only changed on user input.
This means that the "clear" action didn't reset the actual value
of the input, and the browser's default behaviour when getting
the same path twice is not to change anything. In the use case,
you couldn't upload the same file until you uploaded another one.

After this commit:

The "clear" action now also clears the value, allowing reuploading
the same file over again.

closes odoo/odoo#33843

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-06-03 15:01:57 +00:00
Odoo Translation Bot 72a0963d2d [I18N] Update translation terms from Transifex 2019-06-02 03:08:27 +02:00
Julien Legros 9993f9c9f9 [FIX] web: typo in font-family for boxed layouts
closes odoo/odoo#34091

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-05-31 12:19:32 +00:00
Odoo Translation Bot 0ebee56da5 [I18N] Update translation terms from Transifex 2019-06-09 01:17:53 +02:00
Christophe Simonis 9e9e9acef1 [MERGE] forward port branch saas-11.3 up to a2582c4252 2019-06-07 19:04:43 +02:00
Odoo Translation Bot 28382b76d8 [I18N] Update translation terms from Transifex 2019-06-02 01:18:32 +02:00
Christophe Simonis 8a0e819d0b [MERGE] forward port branch 11.0 up to 3e12f2ff56 2019-05-29 11:10:34 +02:00
Christophe Simonis cffd147cfd [MERGE] forward port branch 11.0 up to a20a31486c 2019-05-28 15:52:00 +02:00
Christophe Simonis 8d7ee39213 [MERGE] forward port branch saas-11.3 up to 8a0e819d0b 2019-05-29 14:06:12 +02:00
Romain Derie e9350993ca [FIX] web: restore /apps/<app> controller
Since JS refactoring of ActionManager at 32b8cec536, the /apps/<app> controller
was not working anymore as the refactoring dropped the support of `sa` as URL
state.

closes odoo/odoo#33679

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-05-27 11:44:08 +00:00
Luis 0379c51be3 [FIX] web: refresh calendar if error
If an error is raised when saving a calendar event, the transaction is
correctly rolled back. However, the view is not refreshed and the
incorrect information is displayed.

We simply reload in all cases.

opw-2002186

closes odoo/odoo#33028

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-05-24 10:45:48 +00:00
Julien Castiaux 042966ccae [IMP] web: better logging of errors
When an error is raised server-side, the complete traceback is displayed
in the JS console. This traceback can be very useful since it might
contain information not recorded anywhere else by default. For example,
access errors due to record rules or SQL constrains do not have their
traceback displayed in the UI or recorded in the log [1], but it is
logged in the JS console.

However, the information is logged in the JS console as a stringified
version of the `result.error` object. The final result is a long and
non-formatted string which is unreadable.

We replace by a new format more convenient for technical teams. The
error is now formatted as:

Error code
Error message
Error data message
Error data debug

This will hopefully give a better starting point for debugging purposes.

[1] SQL constrains tracebacks are only recorded in the log in debug
mode:

https://github.com/odoo/odoo/blob/ec792da72b92b22349b6f325e53fd37d953c7db3/odoo/service/model.py#L122

closes odoo/odoo#33650

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-05-27 06:41:56 +00:00
Odoo Translation Bot ec792da72b [I18N] Update translation terms from Transifex 2019-05-26 03:07:48 +02:00
Grzegorz Krukar 8869677669 [FIX] web: form: remove invisible fields spacing
Invisible fields in form view and group reserve space.
This looks bad with many invisible fields in a form.

Fixes: #29505 and #28370

closes odoo/odoo#33598

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-05-23 08:33:32 +00:00
Priyanka Kakadiya 5adb6b62d2 [FIX] web: update buttons in editable list
In an editable view when editing a row, then apply or remove any groupby or
filter the control panel buttons are not updated.

When record is in edit mode in editable listview and applying groupby then
control panel buttons 'Save' and 'Discard' buttons are always displaying, this
issue occurs because when applying or removing filters control panel buttons not
updated i.e. _updateButtons not called.

With this commit button are updated when _update of list controller is called,
_update of list controller is also called from search.

Task-1967278

closes odoo/odoo#33572

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-05-23 07:39:13 +00:00
Odoo Translation Bot 7237b8f2a2 [I18N] Update translation terms from Transifex 2019-05-19 03:08:16 +02:00
Nicolas Lempereur e61639723d [FIX] web: resequence work w/ discardable lines
In 11.0 091c86c21 introduced the unselection of lines when line are
resequenced to solve some issue.

There seems to be a related issue in the following use case if:

- the one2many has a handle field
- the lines have same sequence (eg. adding 2 o2m lines on new record)
- there is an invalid o2m line (eg. empty line and required field)
- without blurring, a valid line is moved

then this happen:

- the sequence of lines are computed
- the invalid line is removed
- the computed sequence of lines are applied

=> this break next onchange, because we try to apply an onchange to data
that does not exist anymore (the invalid line).

With this changeset, the invalid lines are discarded before sequences
are computed so the computation is still correct before being applied.

Without the change, the added test fails with:

5. one onchange happens when lines are resequenced (expect: 3, res: 2)
7. one onchange happens when a line is added (expect: 4, res: 2)
8. onchange worked there is 2 lines (expect: 2, res: 1)

opw-1966589
closes #33591

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-05-28 13:25:05 +00:00
Christophe Simonis 2c68df0ab4 [MERGE] forward port branch 11.0 up to 82c901c937 2019-05-02 10:59:21 +02:00
Odoo Translation Bot 27aabeaad5 [I18N] Update translation terms from Transifex 2019-05-05 03:10:58 +02:00
Odoo Translation Bot b24e0441b9 [I18N] Update translation terms from Transifex 2019-05-26 01:15:48 +02:00
Hetal DhanakandPriyanka Kaakdiya 84130174df [FIX] web: make calendar toggle full width work
toggle full width of calendar not working, this is because getItem of
localstorage service now returns parsed value, AbstractStorageService now
return JSON.parse(value)

this commit fixes that.

task-1975004

closes odoo/odoo#33570

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>


Co-authored-by: Priyanka Kaakdiya <pka@odoo.com>
2019-05-24 11:19:34 +00:00
Varun Raval 57bb236c24 [FIX] web: fix tags field which looks weird on kanban view
For many2many_tags widget 'o_tag_color_0' class apply box shadow, in form
view it looks good but in kanban view, it does not look good so I have
removed box shadow from kanban view.

Before this commit in kanban view when no attributes are used in the field
at that time tags will be in box-shadow but after this commit even if no
attributes are used in the field, tags will be without box shadow.

Task ID: 1963188
Closes: #33503

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-05-23 08:55:43 +00:00
Odoo Translation Bot 631abaf689 [I18N] Update translation terms from Transifex 2019-04-28 03:09:59 +02:00
Nicolas Lempereur b09d20ab29 [FIX] web: no ResizeObserver video error on chrome
When displaying a video, with the browser window at a certain size, or
resizing it (or opening developer tools) we could the following error:

 "ResizeObserver loop limit exceeded"

This can be reproduced in chromium just with this JS code:

  window.onerror = function(e){ console.log(e); };
  document.body.innerHTML = '<div><video controls src="v.webm"/>';

The issue only happen if:

- the video server does not support HTTP range requests
- the controls are displayed on the video
- browser size is in problematic size/resized to problematic size

And the error is raised in window.onerror but not displayed in the
developer console.

With this change, we ignore these errors until fixed in chromium.

chromium bug tracker: https://crbug.com/809574

backport of 12.0 535da9e (in pr #30239) since video loader was in 11.0
opw-1928512
closes #32983

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-04-26 11:53:38 +00:00
Nicolas Lempereur c1f354beb8 [FIX] web: date field in calendar no tz issue
The calendar should send to server:

- for an all day event (all_day field on view): the date in UTC (ie. if
we are on 22 august 2018 on UTC+2, not send 21 august 2018 22:00)
- for a datetime event not all day: the UTC datetime corresponding to
UTC (for 03:25 with UTC+5 timezone, we send 22:25 the day before)
- for a date event: the date in UTC (ie. same as all day)

The current code was alright for datetime, but there was a missing case
if the start_date was a Date field (eg. project task calendar view uses
a date_deadline Date field) and not a Datetime field.

This changeset apply the same behavior as an all_day event to a calendar
with a start date that is a Date field.

Note: the issue happen since 11.0's 03d74f4 (26th march 2019) that
solved a similar case but for datetime (a datetime event at 8:00 with
timezone UTC+9 would be moved the previous day when drag and dropped on
the month view).

opw-1969876
opw-1971106
opw-1971019
closes #32796

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2019-04-24 09:37:29 +00:00
Odoo Translation Bot b25fdb25b5 [I18N] Update translation terms from Transifex 2019-05-19 01:16:49 +02:00
Goffin Simon f67200fe9f [FIX] web: Invalid Date warning
Fine tuning of 5ef86ef6c874ab4dc78402493d05b2460c69e7f6

Steps to reproduce:
Set a custom language settings for date by switching the %m and %d.
Create a sales order

Current behavior:
Invalid date error boxes was raised two times

fixes #33408

opw:1998971

closes odoo/odoo#33415

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-05-16 07:26:28 +00:00
Julien Castiaux 43295c2a37 [FIX] web: mark as read trigger notification
Install discuss, change the general setting in dev mode to disable the
"Show Effect" checkbox. Change the preferences of the user to let odoo
handle notifications. Ask another user to ping you on a chatter then go
to discuss and click the "Mark as Read" button. Traceback.

The `notification_manager` agent has been replaced by another agent in
07cd24b1ec, the code has been updated to use the new agent.

opw-1986844

closes odoo/odoo#33363

Signed-off-by: Julien Castiaux <Julien00859@users.noreply.github.com>
2019-05-15 07:35:36 +00:00
Goffin Simon 9ed9710b2b [FIX] web: Error on invalid date format on date field input
Steps to reproduce the bug:

- Go to any field Date
- Enter wrong date

Bug:
A traceback was raised.

Now a warning is raised and the wrong value is removed.

opw:1974747

closes odoo/odoo#33362

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-05-15 06:36:08 +00:00
Christophe Simonis ec29b4d364 [MERGE] forward port branch 11.0 up to 4231103cc9 2019-03-28 18:17:20 +01:00
Nicolas Lempereur 03d74f4f76 [FIX] web: drag & drop month calendar->keep time
In fullcalendar, we have in f5b7ad80f fake moments date with UTC time
that are the local time, thus when we move an event to another day, we
need to set it as:

- the selected year-month-day
- the original utc hours (real local hours) -> local hours
- the original utc minutes (real local minutes) -> local minutes
- the original utc seconds (real local seconds) -> local seconds

When it is sent to server, timezone offset will be removed so we will
transfer to server the expected datetime in UTC.

With this changeset we send server the correct time when a fullcalendar
event is "all_day" but the original event was not (eg. drag and dropping
event on the month view).

Added test without change failed with:

 - 4. event moved to 27th nov 16h00 +40 hours timezone
      (expected "2016-11-29 08:00:00", result: "2016-11-27 16:00:00")
 - 5. expected: "event|6|11/27/2016|16:00:00"
      result: "event|1|12/09/2016|08:00:00"
 - 6. expected: "event|1|12/09/2016|08:00:00"
      result: "event|3|12/10/2016|23:55:05"

opw-1955281
closes #32136

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-03-26 17:49:40 +00:00
Nicolas Lempereur 5838e47ab5 [FIX] web: modal in modal => no block mobile
On a form view:
- we open a modal form view
- in this modal we open a modal form view
- we close that second modal

=> the modal is closed and the first one is still opened, but on mobile
we can't scroll to above or below the modal.

This is because bootstrap remove .modal-open class on body when we close
the second modal, but this class is necessary to scroll (this is not
much an issue on desktop since scroll is often not necessary).

We already had a fix that was weakened in 02a063fd73.

With this changeset, we keep .modal-open as long as a modal is opened.

Without the change, added test failed with:
  10. Modal is said opened (expected: true, result: false)

opw-1948423
closes #32106

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-03-25 16:58:06 +00:00