Commit Graph

7195 Commits

Author SHA1 Message Date
Raphael Collet 2067a206ec [FIX] models: process onchange methods on new records in the order of the view
The onchange() on new records processes fields in non-predictable order.  This
is problematic when onchange methods are designed to be applied after each
other.  The expected order is presumed to be the one of the fields in the view.

In order to implement this behavior, the JS client invokes method onchange()
with the list of fields (in view order) instead of False.  The server then uses
that order for evaluating the onchange methods.

This fixes #4897.
2015-02-10 13:12:40 +01:00
Denis Ledoux 534d4e3e07 [MERGE] forward port of branch saas-3 up to a8fdc60 2015-02-09 17:58:28 +01:00
Denis Ledoux a8fdc60b88 [MERGE] forward port of branch 7.0 up to 1d76586 2015-02-09 17:57:39 +01:00
Denis Ledoux 1d76586a1b [FIX] web: context lang & active* in action buttons
This reverts rev. 9f9e7ef0e1

As explained in 9f9e7ef0e1,
if a field "lang" is present in the view, clicking in any action item
in the more menu leaded for the action title to be translated
in the lang value of the form, such as in the partner form.

9f9e7ef0e1 fixed the issue,
but has as side-effect to not update correctly the active* keys.
So, if "active_id" was used in the context of the action button,
and the active_id was set in the dataset context, for example
because you come from another form, trough another action button
(For instance, Customers > Opportunities > Logged Calls),
the active_id was not updated with the current id of the record.

opw-620293
opw-617321
fixes #3462
2015-02-09 17:53:11 +01:00
Denis Ledoux ca7036776d [FIX] web: do not apply default_order if list grouped
If the list view is grouped (with a groubpy filter),
the default order must always be the order of the groupby
2015-02-09 14:44:45 +01:00
Denis Ledoux 769c62ef27 [MERGE] forward port of branch saas-3 up to f92b2f8 2015-02-06 14:19:30 +01:00
Denis Ledoux f92b2f8d4d [MERGE] forward port of branch 7.0 up to 0b7db55 2015-02-06 14:02:43 +01:00
Denis Ledoux 859979e949 [FIX] web: reset dataset orderby on groupby filter.
If the list view had a default order,
for instance, default_order="create_date desc",
setting a groupby filter kept this default order
and the groupby list was therefore not ordered on the groupby field

In general, when setting a groupby filter on a list
we expect the list to be grouped by the groupby field

The reset of the orderby is done only when the list is not grouped
and a first groupby filter is applied.
The orderby is not reset when adding a new groupby,
when one was already applied.
It doesn't reset either when passing from 2 groupby clause to 1.
It doesn't reset either when passing from 1 groupby clause to none.

opw-627233
2015-02-05 16:39:22 +01:00
Xavier Morel 93fa43f900 [REV] 54e75b02: excessive breadth makes all falsy values disappear from lists
Empty checkboxes are supposed to be displayed.

Fix specifically and only in the binary field.
2015-02-05 14:39:40 +01:00
Denis Ledoux 2a162d9be7 [FIX] web: widget date handling user timezone
When converting a datetime field to date, using the widget date,
the date time value was just cropped, removing the hours,
therefore ignoring the user time zone.

For instance, if the user was in UTC + 1, for a date time 02/02/2015 00:30:00,
applying the widget date on this datetime had as result 02/01/2015,
due to the fact the UTC value of the datetime field was 02/01/2015 23:30:00

fixes #4420
opw-621281
2015-02-04 14:33:01 +01:00
Denis Ledoux 3636aeb59d [FIX] web: field on change event
This is related to rev. d17f22cde7

Compare float values using float_is_zeor only
if the key is 'value',
meaning the changed value is the actual value of the field,
not another variable of the field (widget, etc.)

For instance, changing the currency_info of a float field
using the monetary widget should not compare the old and new value using
float_is_zero (the values are not even floats).

opw-627166
2015-02-04 13:03:39 +01:00
Géry Debongnie 913fa445aa [FIX] web: editable lists and read only fields bug
when the user press tab in editable list views, the focus is supposed to
go to the next cell unless it is at the last cell of the line.  in that
case, it is supposed to create a new record.

Sadly, when the last cell is readonly, this does not work.  This commit
make sure that read only fields are properly ignored when computing the
last_field state.
2015-02-02 16:23:42 +01:00
Denis Ledoux 2883e3f67d [MERGE] forward port of branch saas-3 up to ba5c972 2015-01-30 16:55:36 +01:00
Denis Ledoux ba5c972c3e [MERGE] forward port of branch 7.0 up to 05c907b 2015-01-30 16:52:41 +01:00
Jeremy Kersten 4a698da8b3 [IMP] qweb: Allow to propagate value to variables outside the loop.
If the variable was existing outside the context of the ``foreach``,
the value is copied at the end of the foreach into the global context.

Fix #4461 - Q74531 - Q71486 - Q71675
2015-01-30 14:26:48 +01:00
Denis Ledoux a804d9a70f [FIX] web: possibility to autocomplete 'No' for boolean fields
In the search bar.

Besides, if the label value of the selection field is set to False,
which is quite dummy but accepted
The autocomplete crashed.
2015-01-30 13:40:31 +01:00
Denis Ledoux 35806cc075 [FIX] web: indent possible values for selection/bool fields in search 2015-01-30 11:38:34 +01:00
Xavier Morel 3d85eaa591 [FIX] correctly handle empty binary fields in saveas
Original code assumed the empty field would be missing or an empty
string, b64decoding an empty string yields an other empty string which
triggered a "not found" response.

However Odoo returns ``False`` in case of an empty field, so that needs
to be replaced by an empty string before decoding, as b64decode doesn't
accept booleans as input (for some reason...)
2015-01-29 16:11:16 +01:00
kevin wang 54e75b0286 [FIX] Empty binary column download error
In case of an empty inline column, a Download link inviting the user to
click would still be rendered (erroring out if the user eventually
clicked on it)

fixes #3684
2015-01-29 16:06:22 +01:00
Olivier Dony 801a8b8fa9 [MERGE] Forward-port latest saas-3 bugfixes, up to c9b690f6b6 2015-01-29 13:54:13 +01:00
Olivier Dony c9b690f6b6 [MERGE] Forward-port latest 7.0 bugfixes, up to 4c2706d685 2015-01-29 13:50:51 +01:00
Olivier Dony a4c3670f66 [FIX] web: load translations for login/db manager screens
This was broken by mistake at rev. d6c6f31231
partially undoing the introduction of this feature at
rev. 49c0ed6467 (probably due to the
confusing name of that manifest option)
2015-01-29 13:40:49 +01:00
Denis Ledoux 4c2706d685 [FIX] web: saveas_ajax, correct filename when data passed directly
In cases where data is directly given to the saveas_ajax controller,
the filename was not correctly set, as no read method was performed.
(The read call is useless as the data is already avaiable in such a case)
In such cases, the filename must be given in advance

opw-626707
2015-01-29 12:51:47 +01:00
Denis Ledoux 457b940c0e [FIX] web: digits is not always defined for float fields in js
This rev. is related to d17f22cde7
2015-01-28 18:53:12 +01:00
Denis Ledoux d17f22cde7 [FIX] web: float compare, float is zero
When setting a float field,
the web client rounds the value entered by the user
using the instance.web.round_decimals method.
Nevertheless, this is possible that this method returns unrounded float,
due to the float precision
For example, round_decimals(53.8, 2) returns 53.800000000000004

In order to compare this new float value to the old float value
and check the eventual change),
we need to check if the delta between the two is almost 0.
This is the goal of the float_is_zero method introduced during this rev.
which is comparable to the float_is_zero method
already available in the openerp server, in openerp.tools.

Float values compared using the simple === operator
instead of this float_is_zero method
will be regarded as different in some cases,
according to the float value and the precision
And the value of the field will be regarded as changed,
which can lead to unwanted triggers of onchanges.

opw-626635
2015-01-28 15:09:10 +01:00
Olivier Dony 8e03852fd4 [I18N] Update translations from Launchpad 8.0 branches 2015-01-26 16:36:51 +01:00
Aaron Bohy 3cae676619 [FIX] Use local copies of png instead of fetching them from websites
Debian does not allow fetching data from external website at runtime.
This fixes the privacy-breach-generic lintian warnings for Debian packaging.
The removed youtube url was a dead link...
2015-01-23 11:23:04 +01:00
Aaron Bohy 2a39214d2e [FIX] File permission: remove unnecessary executable perm on files
Some .xml,.csv,.po,.woff,.ttf,.png,.eot,.svg had perm 755, provocating
'executable-not-elf-or-script' lintian warning for Debian packaging.
Set permission to 644 for those files.
Also remove unnecessary executable permissions on some .py:
	-addons/l10n_fr_hr_payroll/report/fiche_paye.py
	-addons/l10n_ro/res_partner.py
	-addons/l10n_ro/__openerp__.py
	-addons/l10n_ro/__init__.py
	-addons/l10n_do/__openerp__.py
	-addons/l10n_do/__init__.py
2015-01-23 11:11:27 +01:00
Aaron Bohy 629572cb76 [FIX] Web: qweb-test.js.html: use local copy of jquery and qunit
Use the local copy of those libraries instead of fetching them at runtime.
This fix was required for Debian packaging. It fixes the
privacy-breach-may-use-debian-package lintian error.
2015-01-23 11:11:27 +01:00
Denis Ledoux 34de1c0f78 [FIX] web: display error message when export fail. 2015-01-21 17:05:55 +01:00
Denis Ledoux 560f2359a0 [FIX] web: correctly retrieve exception from @serialize_exception
and _serialize_exception as well.
2015-01-21 17:03:54 +01:00
Martin Trigaux 4f14290670 [FIX] web: rounding of fields
round_precision expects a decimal (e.g. 0.01) while digits contains the number
of digits (e.g. 2)
replace by round_decimals
2015-01-21 16:04:29 +01:00
Olivier Dony 495ec92251 [I18N] Update translations from Launchpad 8.0 branches 2015-01-21 15:36:54 +01:00
Olivier Dony 39f00b3637 [I18N] Update translation templates with latest terms
Total new terms: 270
Total deleted terms: 82
Total identical terms: 19653
Old total number of terms: 19735
New total number of terms: 19923
2015-01-21 15:31:22 +01:00
Adrien Peiffer 37e85a1e35 [FIX] view form: Use digits to round float values on client side 2015-01-21 10:38:32 +01:00
Simon Lejeune e901fa20e4 [FIX] web: don't shadow exception in do_backup 2015-01-20 17:36:19 +01:00
Géry Debongnie af8c2e4db6 [IMP] pyeval: implement weekday function
courtesy of mva.  This adds the weekday function to date objects in
pyeval.  This will be useful for adding better filters (such as this
week) in the searchview.
2015-01-19 14:08:09 +01:00
youring 5c59479577 [FIX] openerp -> odoo renamings in db files
closes #4762
2015-01-19 10:27:28 +01:00
Antony Lesuisse c1c8ac7d7f [FIX] dbmanager: backup allow pg_dump custom dump to be larger than diskspace
- delete a forgotten print
- allow pg_dump custom dumps to be larger than the available disk size, the
  previous commit allowed dumps to be larger than memory, this one remove this
  limitation. zip dumps are still limited to by the disk size.
2015-01-19 02:42:34 +01:00
Antony Lesuisse ec9a543014 [FIX] dbmanager: backup support both zip and pg_dump custom format
- let the user choose between the pg_dump custom format or the zip format including the filestore
- use file objects to allow dumps larger than memory
- postgres subprocess invocation is now clean and thread-safe, we dont touch the local process environ anymore
- add a manifest to the zip dump format with version information about odoo, postgres (pg_dump doesnt output it) and modules
2015-01-19 02:05:12 +01:00
Martin Trigaux 48002b3278 [FIX] web: debugger in previous commit
Damn you commit -a
2015-01-15 15:38:16 +01:00
Martin Trigaux fc9ce0bcff [FIX] website_forum: description not translated
Make the field description on a forum translatable and add it in the forum view. opw 619786
2015-01-15 15:37:31 +01:00
Denis Ledoux 87dd06c941 [MERGE] forward port of branch saas-3 up to 8c150c6 2015-01-15 14:43:32 +01:00
Denis Ledoux a692c6e934 [MERGE] forward port of branch 7.0 up to f406847 2015-01-15 11:49:28 +01:00
Xavier Morel 8c3d71ccb8 [CHG] Fix task 7536 / PR #499 differently
Issue was the propagation of contextual values across actions, more
precisely conserving the selected fiscal year when selecting an account
from the chart of accounts tree view: the chart of accounts tree view is
generally opened for a specific fiscal year, and it seemed sensible that
opening an account would show only the journal items for the previously
selected fiscal years rather than all items ever.

PR #649 altered action.read by tentatively evaluating the action's
context, however this has the side-effect of providing evaluated
contexts when creating or editing actions via the UI, usually breaking
them in the process (as the context at this point is basically
nonsensical for the action's purpose).

This backs out the previous fix, and creates a fix restricted to the
tree view's JS (thereby removing the feature for window actions not
invoked from a tree view).

closes #4677, closes #4690
2015-01-14 13:28:23 +01:00
Denis Ledoux 275367581b [FIX] web: view is not always defined when a many2one is rendered
This rev. is associated with rev. 38aa984f31

closes #4660
2015-01-13 12:45:47 +01:00
Denis Ledoux 38aa984f31 [FIX] web: avoid rendering fields on one2many list validation
This rev. reverts 91911159f5

The above rev. was a good idea, except that internal_set_value expects the raw value, while the records attributes can be tuples(for instance, many2one are tuple(id, name) or list of command(one2many, many2many).

set_value must be use here, as all fields (js) override set_value in order to handle their value repr (for instance, many2one fields handle the tuple (id,name).

Besides, avoiding the re-render provides a huge performance improvment, as rerendering fields can lead to xmlrpc calls (for instance, re-rendering a many2one field implies calling the name_get method)

opw-620111
opw-622108
2015-01-09 18:10:38 +01:00
Olivier Dony d0cd92bb9f [I18N] Sync updated 7.0 translations from Launchpad 2015-01-07 17:57:28 +01:00
Denis Ledoux 4c1908088c [MERGE] forward port of branch saas-3 up to 879fca0 2015-01-06 19:00:08 +01:00
Denis Ledoux 879fca0856 [MERGE] forward port of branch 7.0 up to 9191115 2015-01-06 18:56:10 +01:00