Commit Graph

7920 Commits

Author SHA1 Message Date
Raphael Collet 05f176f418 [IMP] ir_ui_view: do not recompute field `model_data_id` on views
The recomputation should not be necessary, as we normally don't change the
record referred by an ir_model_data record.  This speeds up the creation of
ir_model_data records by 33%, which should be noticeable during module
installations.
2015-09-08 14:14:58 +02:00
Cédric Pigeon 20b5e0a4ab [ADD] base: test to check too long table aliases
Test for rev. 11f538fae6
2015-09-08 11:53:29 +02:00
Thomas Rehn 11f538fae6 [FIX] expression: table alias reaching 64 characters limits
Postgresql has a limit of 64 characters for tables, columns names
as well as for aliases names.

When generating an alias name, e.g. for group by and order
by clauses, if the alias is longer than 64 characters,
use hashing to force the alias length to be within this
64 chars limit.

Fixes #8094
Closes #8142
2015-09-08 11:53:18 +02:00
Denis Ledoux 64e44c0a24 [IMP] base: tests, move patch_order to TransactionCase
In order to be able to redefine simply the order
of a model for testing purposes,
without having to re-define this method in each test class.
2015-09-08 11:53:18 +02:00
agaldona db6514ea48 [IMP] tools: add language eu_ES Basque / Euskara
As a new translation team has been composed.
Closes #8346
2015-09-07 12:30:06 +02:00
Olivier Dony c345d294b1 [MERGE] Forward-port saas-3 up to rev. 10e6ad1355 2015-09-07 11:18:10 +02:00
Olivier Dony 10e6ad1355 [MERGE] Forward-port 7.0 up to rev. 20f69bbce9 2015-09-07 11:12:57 +02:00
Paul Catinean 20f69bbce9 [FIX] res.users: remove check_super duplication
Closes #8403
2015-09-07 11:07:43 +02:00
Raphael Collet 1c4c64fe01 [FIX] fields: add support for date/datetime null values in field methods 2015-09-07 10:27:34 +02:00
Raphael Collet 1d314962fe [FIX] models: handle the case of `_constraints` with empty list of field names 2015-09-07 09:12:14 +02:00
Odoo Translation Bot 927c00525c [I18N] Update translation terms from Transifex 2015-09-06 01:50:52 +02:00
Raphael Collet fa427f15b7 [FIX] models: performance of `mapped` is now in O(n) instead of O(n²) 2015-09-04 17:11:57 +02:00
Denis Ledoux 50f915f3ac [FIX] models: oversight introduced in 1658bee8d4 2015-09-04 13:27:29 +02:00
Raphael Collet f5e5bbdae0 [FIX] expression: fix search on one2many field with inherited inverse field
Consider the following setting:
 - on model A, field F is computed, stored, and depends on field G
 - on model A, field one2many G to model B, with inverse field H
 - on model B, field many2one H is inherited (_inherits) from model C
 - on model C, field many2one H is stored

When adding records of model B, the field F must be recomputed.  In order to
determine which records to recompute, one searches model A with a domain like
[(G, 'in', ids)].  In expression.py, this is resolved with an SQL query like

    select H from B where id in {ids}

This query fails, since the field H is not stored in model B.  This happens in
general if H is not stored (it may be any computed field).  In that case, one
should instead browse records from B, and read field H through the ORM.

A test case has been added: it introduces a many2one field in a parent model,
and a one2many field using the inherited many2one on a child model.  The test
checks whether one can search on the one2many field.
2015-09-04 13:25:51 +02:00
Denis Ledoux 1658bee8d4 [FIX] models: copy_data call in new API.
Context are frozendict in the new API.
Therefore, they cannot be altered.
Any attempt to alter a frozendict
will lead to a crash.

Fixes #7362
2015-09-04 13:17:34 +02:00
Ravi Gohil 0c1e97895a [FIX] server: missing format string argument.
Introduced by 099ae0f70c

Closes #3356
2015-08-31 17:55:00 +02:00
Olivier LAURENT 017688cc29 [FIX] models: old api, prevent infinite recursion in stored function fields
The risk was introduced by b7f1b9c.
IF _store_set_values() recall another _create() or _write(),
the recomputation mechanism enter in an infinite recursion
trying to reevaluate for each call exactly the same fields
for the same records than the previous one

This revision replaces the loop of _store_set_values()
by 2 nested loops:

 - that not breaks the entire consumption
   of recompute_old queue
   (Tested thanks to revision a922d39),
 - that allows to clear the queue
   before each recomputations bundle fixing thereby the recursion

Closes #7558
2015-08-31 17:45:21 +02:00
Odoo Translation Bot b79d492ec4 [I18N] Update translation terms from Transifex 2015-08-30 01:51:03 +02:00
Colin Newell 84857a3f4f [FIX] currency: simple quote in currency symbols
Escape the currency symbol to prevent javascript errors,
for instance when reconciling a bank statement
(with the special reconciliation widget)

Closes #8216
2015-08-27 17:45:59 +02:00
Nicolas Lempereur 3e82c94d69 [FIX] point_of_sale,base: use context timezone for sequence
Previously when replacing time related sequence in a prefix or suffix of
a sequence, the timezone used for the time values would always be the
server's timezone.

With this fix, the context timezone is used if available (UTC is used
otherwise).

closes #8159
opw-646487
2015-08-25 14:08:17 +02:00
Odoo Translation Bot 99931637d5 [I18N] Update translation terms from Transifex 2015-08-23 01:51:13 +02:00
Christophe Simonis 7349e23837 [FIX] models: correct ORDER BY onm many2one fields
Now the we follow many2one when generating ORDER BY, we need to keep
track of visited relations to avoid loops.

Closes #8114
2015-08-20 11:44:04 +02:00
Olivier Dony c2cbb75319 [FIX] web: _serve_attachment should not trigger redirect loops
When the Bundle mechanism caches bundle files into the
ir.attachment table, it can sometimes cache an empty
resource file (For example, if a less/saas compiled file
results in an empty CSS file) for the bundle URL.
The appropriate behavior for _serve_attachment()
when the browser loads that bundle URL is to return
an empty file (which is the correct content), instead of
redirecting again to the same URL, triggering a loop.

In addition, this commit removes the special case for
returning 204 No Content. This HTTP status code is not
really meant for GET requests - returning an empty file
with a 304 or 200 code is more appropriate and allows
for normal browser caching.
2015-08-17 17:01:19 +02:00
Odoo Translation Bot 4359f65522 [I18N] Update translation terms from Transifex 2015-08-16 01:58:03 +02:00
Christophe Simonis 856cb6fcb0 [FIX] models: distribute ORDER BY direction 2015-08-14 15:42:37 +02:00
Christophe Simonis dac52e344c [FIX] models: "ORDER BY" on many2one fields
When ordering results on a many2one fields, results are ordered by
order of the target model. The code was wrongly assuming that this
`_order` attribute only contains `_classic_read` fields (that can be
directly read from the table in database). Now correctly generate the
"ORDER BY" clause using the current table alias.

`res.users` can now be sorted by name.
2015-08-14 15:42:37 +02:00
Nicolas Lempereur cdb9000449 [FIX] website, base: escaping and unescaping html
When saving a template in version 8.0, html would be saved as it should
be displayed once on the site. In particular, if some text should be
escaped once send to the browser, it will be saved as such.

But when rendering, a text node content is unescaped two times:

* for translation which seems wrong since we already use .text of a node
  which already escaped it, doing it one more time is bad,

* when rendering the template, since the html template is stored in xml,

This commit remove superfluous unescaping for translation, and add an
escaping when saving the changed template content.

closes #7967
opw-646889
2015-08-13 15:15:24 +02:00
Christophe Simonis d5a6380726 [MERGE] forward port of branch 7.0 up to f410266 2015-08-11 16:35:00 +02:00
Odoo Translation Bot 4fcc756ef9 [I18N] Update translation terms from Transifex 2015-08-09 02:00:12 +02:00
Olivier Dony fb55b2fa5e [FIX] res.users: more consistent handling of user private fields 2015-08-07 13:16:45 +02:00
Olivier Dony 5e4c09ae53 [FIX] res.users: more consistent handling of user private fields 2015-08-07 13:15:45 +02:00
Alexandre Fayolle 0b74fbed74 [FIX] ir.ui.view: pass context as a kwarg
otherwise when a method such as fields_get is overridden
using the new API, self.env.context is an empty directory,
and the translations cannot be performed correctly

Closes #7911
2015-08-07 02:52:19 +02:00
Christophe Simonis 6e59ea5db9 [FIX] tests: explain why we ignore phatomjs return code 2015-08-06 21:27:03 +02:00
Olivier Dony 77868ec4f9 [FIX] base, auth_openid: wrong implementation of API by auth_openid
Authentication modules are supposed to override res_users.check_credentials()
in order to plug in their own mechanism, without actually modifying the
behavior of res_users.check(), res_users.authenticate() or
res_users._login().

auth_openid was incorrectly overriding check() instead of
check_credentials(), and unnecessarily accessing private
attributes of res_users. Fixing the implementation of auth_openid
to follow the API means we can completely make those attributes
private.
2015-08-06 19:21:12 +02:00
Olivier Dony 54e06907c0 [FIX] base, auth_openid: wrong implementation of API by auth_openid
Authentication modules are supposed to override res_users.check_credentials()
in order to plug in their own mechanism, without actually modifying the
behavior of res_users.check(), res_users.authenticate() or
res_users._login().

auth_openid was incorrectly overriding check() instead of
check_credentials(), and unnecessarily accessing private
attributes of res_users. Fixing the implementation of auth_openid
to follow the API means we can completely make those attributes
private.
2015-08-06 19:19:17 +02:00
Christophe Simonis d8d9c7277e [FIX] phantomjs test: `phantom` variable is undefined inside page. 2015-08-06 17:20:37 +02:00
Olivier Dony 5a41a3011a [FIX] ir_translation: undo asymmetric change of set_ids/get_ids
Partial revert of commit 39d17c2580
of PR #4617, that broke translations by introducing a different
set of criterions for filtering translations in `_set_ids()` and
`_get_ids()`, adding the `module` column in `_set_ids`.

This meant `_get_ids` would see translations that `_set_ids`
would never update: the translation interface did not appear to
be working anymore as soon as a translation entry existed with
no `module` value.
This is likely for manual entries and for entries bootstrapped
by `translate_fields()`, as they do not belong to any module.

The situation described in PR #4617 probably requires an extra
fix in the translation import system instead.
2015-08-05 16:29:16 +02:00
Raphael Collet 9699f510e4 [FIX] res_users: fix wrong index when parsing m2m commands 2015-08-05 14:35:42 +02:00
Olivier Dony c96174da5f [MERGE] Forward-port of latest bugfixes from saas-3 up to 733cb3e76f 2015-08-04 15:22:49 +02:00
Olivier Dony 733cb3e76f [MERGE] Forward-port from 7.0 up to 8b3d69a0d7 2015-08-04 15:17:51 +02:00
Daniel Reis 8b3d69a0d7 [FIX] orm: performance of regex to check search `order` spec
This regex is used for a quick sanity check of
the order_spec in `search(order=<order_spec>)`.
Because it was build on the repetition of a
group ending with a series of optional patterns,
it could cause expensive backtracking when the
order spec did not actually match the regex
(the regex engine was trying all possible ways
to split the groups)

Forcing the repeating group to either end
with a comma or the end of the string prevents
prohibitive backtracking, while being even
more restrictive with regard to the syntax of
the order spec.

Closes #7755
2015-08-04 11:45:01 +02:00
Olivier Dony df002518ee [FIX] models: access error due to prefetch of indirectly referenced records
Complements commit af9393d505
in light of commit 62b0d99cfe,
to really have the correct effect.

When the prefetching failed due to the presence of
extra records in the cache (for which the access is denied),
the `read` operation was indeed retried. However the
result was not stored in the cache because the cache
already held a FailedValue (automatically added when the
prefetch failed).
2015-08-04 00:00:31 +02:00
Martin Trigaux 180b2e7746 [I18N] Transifex project URL
Thank you Transifex to change the URL scheme from time to time, that's cool.
cf https://www.transifex.com/blog/2015/new-url-schema/
2015-08-03 17:25:44 +02:00
Nicolas Martinelli 282fc4a850 [FIX] openerp: export empty string instead of None
xmlrpc 1.0 does not support None/null, so commit f3e4d0a will break xmlrpc api.
Therefore, we export an empty string if the field is empty, instead of False or
None. For integers and floats, zero is exported.

opw-643966
2015-08-03 08:16:23 +02:00
Antony Lesuisse b4f7288193 [REM] test: phantom_jsfile method
deprecate phantom_jsfile method, keeping only phantom_js, phantom_js takes a
code argument to run client side only.

Removing phantom_jsfile will allow to switch from phantom to any other engine
such as running google chrome or firefox directly. The only use of
phantom_jsfile was an example.
2015-08-02 14:37:19 +02:00
Odoo Translation Bot 389252dd95 [I18N] Update translation terms from Transifex 2015-08-02 08:30:05 +02:00
Odoo Translation Bot 218ffc1a5a [I18N] Update translation terms from Transifex 2015-08-02 01:59:36 +02:00
Christophe Simonis ecfaf213c4 [FIX] module loading: pre/post_init_hook execution
New installation was detected using the `installed_version` attribute
(`latest_version` in `ir_module_module` table), but this field wasn't
reset at module uninstallation (now fixed by cb29f9e) avoiding
execution of hooks.

Same logic was applied for migration scripts at 8ff7230.

Fixes #7708
2015-07-29 12:30:14 +02:00
Christophe Simonis e8076c3854 [MERGE] forward port of branch saas-3 up to 5c7190c 2015-07-29 12:11:20 +02:00
Christophe Simonis 5c7190c93f [MERGE] forward port of branch 7.0 up to cb29f9e 2015-07-29 12:07:34 +02:00