Commit Graph

8015 Commits

Author SHA1 Message Date
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
Christophe Simonis cb29f9efac [FIX] base: reset `latest_version` field when uninstalling a module. 2015-07-29 12:00:15 +02:00
Christophe Simonis af9393d505 [FIX] orm: access error due to prefetch of indirectly referenced records.
The new-api record prefetching algorithm attempts
to load data for all known records from the requested
model (i.e. all IDs present in the environment cache),
regardless of how indirectly/remotely they were
referenced. An indirect parent record may therefore
be prefetched along with its directly browsed children,
possibly crossing company boundaries involuntarily.

This patch implements a fallback mechanism when
the prefetching failed due to what looks like an
ACL restriction.

The implementation of `_read_from_database` handle
ACL directly and set an `AccessError` as cache value
for restricted records.

If a model (like `mail.message`) overwrites `read` to
implements its own ACL checks and raises an `AccessError`
before calling `super()` (which will then call
`_read_from_database`), the cache will be not fill,
leading to an unexpected exception.

If this commit messae looks familiar to you, that's
simply because this is the new-api counterpart of
b7865502e4
2015-07-24 14:01:09 +02:00
Odoo Translation Bot 0871f423a3 [I18N] Update translation terms from Transifex 2015-07-19 02:01:00 +02:00
Raf Ven 39d17c2580 [FIX] base: avoid deleting translations
When updating a translation, the previous one is deleted and a new one is
recreated (with no module and state). When the source module is updated, the
previous term is inserted again to the lsit of terms.
Instead of dropping and recreating terms during update, simply update the
existing term and create one only if there were no previous translation.
Fixes #4617
2015-07-16 15:14:30 +02:00
Antony Lesuisse 8f07f01783 [FIX] base: res.company _company_default_get
Fix rule processing the criteria user.company_id was not honored.

Closes: #4614, #7504
2015-07-16 14:38:13 +02:00
Christophe Simonis 88e8107e01 [MERGE] forward port of branch saas-3 up to 505e308 2015-07-14 15:13:03 +02:00
Christophe Simonis 505e308cd6 [MERGE] forward port of branch 7.0 up to e12cece 2015-07-14 15:00:33 +02:00
Olivier LAURENT e12cecea9d [FIX] tools: separator in po comments
Comments in .po(t) files for translations of type "code" (e.g. field labels)
specify the path to the file containing the translation. This path should be
OS-independent to get the same result whatever the plateform the instance is
running on.
Closes #7561
2015-07-14 11:40:16 +02:00
Jonathan Nemry (ACSONE) 1bc2608490 [FIX] base: add missing context
Propagates context when calling method 'attributes' of ir_qweb
Closes #7582
2015-07-14 11:08:20 +02:00
Daniel Reis e20cf77ce0 [FIX] cli: Backport client command discovery optimization
Lazy load modules to avoid import of unmet dependencies such as ldap.
2015-07-12 16:40:55 +02:00
Odoo Translation Bot 99a7d530e0 [I18N] Update translation terms from Transifex 2015-07-12 01:51:44 +02:00
Christophe Simonis 9654b54d3c [MERGE] forward port of branch saas-3 up to b15461b 2015-07-10 16:46:40 +02:00
Christophe Simonis b15461baba [MERGE] forward port of branch 7.0 up to 1d01872 2015-07-10 16:30:48 +02:00
Christophe Simonis 6e73a31146 [FIX] base: ir.qweb: fault tolerant save of assets.
Do not fail if an asset cannot be cached into the database.
2015-07-10 16:10:59 +02:00
Dariusz Żbikowski 0f4399bb7b [FIX] res.country: address format in polan
Address format in Poland looks like:

Legionów 93
91-072 Lodz
Poland

see: http://en.wikipedia.org/wiki/Address_%28geography%29#Poland

Closes #2416
2015-07-10 11:37:34 +02:00
David Beal d780f9476d [FIX] res.currency: allow duplication
Currencies must be unique per company.
Therefore, without this revision, adding `(Copy)`
to the currency name on duplication, this
is simply not possible to duplicate a currency.

Closes #2443
2015-07-09 17:15:30 +02:00
Nicolas Martinelli f3e4d0a2e8 [FIX] openerp: export None instead of False in raw_data mode
If we export False or an empty string, the Excel export will consider the field
similarly to a boolean, and en empty value will be converted into "=False()" in
Excel. To prevent this, we return "None" in the following cases:

- String
- Date
- Datetime
- Selection
- Reference
- Many2one
- RelationalMulti

Introduced by 6243d18

opw-643966
2015-07-09 11:49:04 +02:00
andreparames 067fd2f342 [FIX] models: don't assume ids are ints in sorted()
Some models (e.g. calendar.event), use "virtual" ids which are not represented
as integers. It was not possible to use sorted method on those models as calling
int() is failing.

This commit fixes the method, making it agnostic to the type of the
'id' member variable.

Fixes #7454
2015-07-08 15:00:32 +02:00
Temur Vibliani 0eeab361d9 [FIX] tools: Added Georgian Language to the installable languages 2015-07-08 11:51:35 +02:00
Denis Ledoux f86d5870fc [FIX] res.country: Preferred address format
According to the USPS, separating the city name
and the zip code with a comma is acceptable,
but the preferred format omits the comma.

http://pe.usps.gov/cpim/ftp/pubs/Pub28/pub28.pdf

opw-644000
2015-07-08 11:13:46 +02:00
Nicolas Lempereur e33baecfa3 [FIX] osv: binary size already in human format
In version 8.0, postgresql's pg_size_pretty function is used
(http://www.postgresql.org/docs/9.4/static/functions-admin.html) when
getting the size of a binary field when reading if `bin_size`
or `bin_size_[col_name]` is set in the context.

So in 8.0 the size of a binary field get units bytes, kB, MB, GB and TB
which was not taken into account. e.g: '5.3 GB'.

This fix uses the size of the string to choose to differenciate the two.

e.g: '10000 bytes' (the longest size) will be returned directly, but
for something longer the human size of the content length will be
returned.

There is a corner case if a file is shorter than 12 bytes but
it is an enough of a small scenario with small implications that it is
deemed acceptable.

closes #7485
opw-644085
2015-07-07 19:17:43 +02:00
Christophe Simonis 00afd776fd [MERGE] forward port of branch saas-3 up to dbe60c7 2015-07-07 15:42:58 +02:00
Christophe Simonis dbe60c7bce [MERGE] forward port of branch 7.0 up to 3add4f6 2015-07-07 15:40:31 +02:00
Martin Trigaux 3add4f665c [FIX] tools: accept multilines on_change
Allow to write on_change on several lines (accepted by view parser but was not
by yaml parser, making false positive at 595216b)
2015-07-07 15:36:15 +02:00
Christophe Simonis acc7d20ea9 [MERGE] forward port of branch saas-3 up to ac865c8 2015-07-07 15:12:41 +02:00
Christophe Simonis ac865c8a78 [MERGE] forward port of branch 7.0 up to 9fa7624 2015-07-07 13:58:35 +02:00
Nicolas Lempereur 0920c2fae0 [FIX] web: sort tree view by id
Previously, if the ID column was displayed it was not sortable.

The particular case added 247c1972 is no longer needed with the new api,
id is in the list of existing fields (see xmo comment in #7461).

closes #7487, closes #7461
fixes #7459
opw-644009
2015-07-07 12:32:38 +02:00
Xavier Morel 95e56a109d [ADD] doc: new theme
Pretty much completely rewritten theme with custom HTML translator and a
few parts of the old theme extracted to their own extensions.

Banner images thought not to be that huge after all, and not worth the
hassle of them living in a different repository.

co-authored with @stefanorigano
2015-07-07 11:22:50 +02:00
Samus CTO 6490c62e5d [FIX] mail: backport of rev 752a07c to 8.0
[FIX] res.partner.find_or_create() should match using =like

Otherwise john@connor.com may match sarah.john@connor.com
2015-07-07 08:52:44 +02:00
Leonardo Donelli 207cf92a0c [DOC] openerp: add missing parameter for search method
The `search` method of models has an additional keyword parameter, `count`.

It not being specified in the docs could lead people to inherit `search`
without defining it, which would result in a `TypeError` when called with
`count=`.

Closes #7451
2015-07-06 14:26:46 +02:00
Odoo Translation Bot fe3835faff [I18N] Update translation terms from Transifex 2015-07-05 01:52:32 +02:00
Frédéric van der Essen fdb9aa29bf [FIX] base: verifying python external dependencies was failing on OSX. 2015-07-03 13:55:52 +02:00
Jeremy Kersten f07be4b675 [REF] base, wesbite_crm: remove placeholder for phone
Some people visiting website doesn't understand that it's a
placeholder and call to Odoo because they see the number on the website.
2015-07-02 15:53:36 +02:00
Matthieu Dietrich f2c807d99d [IMP] account_report_company: performance on partner name_search
The field display_name is present in account_report_company but not in base
on the res.partner (has been added in v8 in base).
Create a hook method to keep using the slow CASE in base and switch to the
faster display_name when installing account_report_company.
2015-07-02 14:10:23 +02:00
Denis Ledoux 49cc4b9d4e [FIX] base: typoe, referencable -> referenceable 2015-07-02 12:59:36 +02:00
andreparames dae0d407c0 [ADD] base: LGPL as possible module license
Keeping in mind than the AGPLv3 core still propagates the license to other
modules.
Fixes #6914
2015-07-02 11:50:40 +02:00
Antonio Espinosa c65fe46569 [FIX] base: runtime error in address_get if ids is empty
Closes #7359
2015-07-02 11:23:34 +02:00
Martin Trigaux 2758aaa6f8 [IMP] models: sanitize error messages in import
Revert 83282f2d for a cleaner sanitizing earlier in the generation of the error
message.

If the import is failing, the error message contains the value that is
problematic. Escape this value in case it contains '%'
2015-07-01 17:04:48 +02:00
Raphael Collet 0939738479 [IMP] fields: speedup of `convert_to_cache` for x2many fields
The algorithm's complexity changed from O(n²) to O(n).
2015-07-01 13:49:14 +02:00
Odoo Translation Bot 2326bb7a54 [I18N] Update translation terms from Transifex 2015-07-01 10:45:16 +02:00
Nicolas Lempereur 45faa3a941 [FIX] base: fixing fix, attachment file size and None
In commit 44f2c8d54 we unified the return value of the function to int,
but it seems the returned size could be None which is not a valid input
of the int() built-in function.
2015-07-01 10:12:24 +02:00
Daniel Reis 8880edd4fb [FIX] cli: start command path option does not work
Using the `start` CLI command with the `--path` or `-p` option arrors with:

    odoo.py: error: no such option: --path

This is because the `--path` option is passed on the server start routine,
and it's invalid there.
A workaround is to remove those command options from the arguments passed
to the main() server start.

Closes #5896
2015-06-30 13:57:14 +02:00
Christophe Simonis 066e41b63d [MERGE] forward port of branch saas-3 up to 31f2a1b 2015-06-30 13:33:35 +02:00
Christophe Simonis 31f2a1bc38 [MERGE] forward port of branch 7.0 up to 1c0bc7c 2015-06-30 12:47:27 +02:00
Mohammad Alhashash 83282f2dea [FIX] models: Escape `%` characters from error messages of a failed import
To prevent susbtituion exception when creating use error message
e.g. No matching record found for external id 'fo%o' in field 'Bar'
Fixes #5933
2015-06-29 16:50:33 +02:00
Martin Trigaux 1c0bc7cc16 [FIX] server: backport of 3940a096 on psutil
psutil 3.0 removed get_momory_info method
create wrapper method for backward compatibility
2015-06-29 16:09:42 +02:00
Odoo Translation Bot acc1b525fa [I18N] Update translation terms from Transifex 2015-06-29 08:42:08 +02:00
Xavier Morel f5b88f6309 [IMP] minor perf improvement during tests
During tests, some creation of user records would unnecessarily trigger
password reset or set a password, both of which would trigger password
hashing which takes some time (for good reasons).

Fix by:
* passing no_reset_password in YAML tests and some Python tests still
  missing it (a number of Python tests already used it)
* removing passwords from YAML records as they're never necessary, the
  test user records are not expected to ever log in
2015-06-26 14:22:29 +02:00
Developer Team bf0630e427 [FIX] tools: add support for transparency of PNG images
Fixes #2569
Closes #6260
2015-06-25 18:51:03 +02:00
Xavier Morel d1a19bcb7f [IMP] base: performances of view._check_xml
View validation accounts for a fair cost of module installation, most of
that is spent checking for view validity, and a significant fraction
of *that* is spent reading the validated view from the DB.

Turns out _check_xml requested *all* view fields even though it needed
none of them save for the arch. Specifying fields to read_combined
rather than fetching all fields seems to result in a ~30% speedup of
_check_xml (under line_profiler). Most of the rest is spent fetching
sub-views (in get_inheriting_view_arch), I don't know that it can be
improved without hand-crafting a fairly complex SQL request.
2015-06-25 10:39:55 +02:00
Miku Laitinen f5dd09dd84 [ADD] base: Finnish address format 2015-06-25 08:47:05 +02:00
Laetitia Gangloff 1511e788cf [FIX] fields: error if there is no value when convert a many2many relation
Closes #1165
2015-06-24 16:52:05 +02:00
Christophe Simonis b8bf1e0905 [MERGE] forward port of branch saas-3 up to ea659cb 2015-06-24 12:37:08 +02:00
Christophe Simonis ea659cbd87 [MERGE] forward port of branch 7.0 up to 16a545b 2015-06-24 12:34:03 +02:00
Xavier Morel 11ba4689b1 [IMP] running speed of some tests & new testcase type
Some tests (e.g. mail) have expensive and significant DB setup for a
number of small and cheap tests. Using a TransactionCase, the DB setup
far dominates the tests themselves, by up to 10x (mail unit tests take
~130s on my machine, the tests themselves take ~15s).

The SavepointCase introduced here is an hybrid of SingleTransactionCase
and TransactionCase: it uses a single transaction for all tests in a
class, but each test case is isolated by a rollbacked savepoint. This
allows a common DB setup (via setUpClass) while keeping independent
tests.

TransactionCase should remain the primary test case superclass, but
SavepointCase can be a fair optimisation when setup costs far dominate.
2015-06-23 16:38:14 +02:00
Nicolas Lempereur 1942522969 [FIX] base: update File Content for binary field
To distinguish two ir.attachment 'File Content', we base it on the file
size (this I imagine is for efficiency).

This is done by setting bin_size in the context. Doing this, the
returned db_datas field will be the file size of the converted to base64
content (if no filestore).

But this size is returned in string format, so "get_nice_size" (in
openerp/osv/fields.py) which gets this size calculates the length of the
string. e.g: if the size is '2142' get_nice_size will return 4.

This fix solves this by converting the string to an integer, thus
unifying it with the filestore case (where we use os.path.getsize which
return an integer).

Also, the field presenting the issue (FieldBinaryFile) has been changed
so it is always updated even if the size is the same (as it was already
done by 3632949 for FieldBinaryImage widget).

closes #7223
opw-643071
2015-06-23 15:20:33 +02:00
Olivier Dony 9b1aa53f29 [MERGE] Forward-port saas-3 up to 9cdfb0696a 2015-06-23 15:18:00 +02:00
Olivier Dony 9cdfb0696a [MERGE] Forward-port 7.0 up to 6acd5ef91c 2015-06-23 15:13:47 +02:00
Olivier Dony 6acd5ef91c [FIX] expression: internal domain operators require different parsing
Ensure the absence of internal domain operators is correctly
propagated throughout the domain parsing.
2015-06-23 15:04:45 +02:00
Odoo Translation Bot 35b2463324 [I18N] Update translation terms from Transifex 2015-06-22 13:21:18 +02:00
Christophe Simonis ed3065e3c6 [MERGE] forward port of branch saas-3 up to b7f9f4a 2015-06-18 19:33:19 +02:00
Christophe Simonis b7f9f4ade0 [MERGE] forward port of branch 7.0 up to e8e3f75 2015-06-18 19:29:47 +02:00
Olivier Dony e8e3f75727 [FIX] workers: process signals during graceful shutdown to allow force shutdown
Required after e17844c946 which
enabled graceful shutdown of workers, including the cron worker.
The latter may typically be busy on long-running tasks that
will not be aborted by a simple graceful shutdown request.

A typical shutdown sequence initiated by a daemon manager such
as start-stop-daemon will involve multiple SIGTERM signals to
ensure the process really stops in a timely manner.
This was not possible after e17844c946
if any cron worker was busy.
2015-06-18 19:18:03 +02:00
Martin Trigaux 6bb3be5ba3 [FIX] doc: api.multi/one confusion
As the methods are using @api.multi, it should be accessed with rec, not self
2015-06-17 09:41:09 +02:00
StefanRijnhart 3940a096b2 [FIX] http: Compatibility with psutil 3.0
Version 3.0 has replaced get_memory_info by memory_info.
Create wrapper to be able to use the correct one depending on the installed
version.
2015-06-16 08:59:44 +02:00
Christophe Simonis 885565968f [MERGE] forward port of branch 7.0 up to d566558 2015-06-15 16:24:11 +02:00
Damián Soriano f7742add26 [FIX] tests: restore openerp.tests.common.DB for backwards compatibility
It was removed at 2df9060d97 and broke
tests in community modules that relied on it.

Tests using it should switch to the new get_db_name() method.

Closes #7054
2015-06-15 00:52:20 +02:00
Laurent Mignon (ACSONE) e17844c946 [FIX] server: graceful shutdown must send SIGINT instead of SIGTERM to workers
Workers do not specifically handle SIGTERM so it can be used to
force quit them, but the graceful shutdown is triggered by SIGINT.

Closes #6998
2015-06-12 16:11:59 +02:00
Nicolas Lempereur 3269ad8f48 [FIX] fields: throw truthy values on old api field
In 7.0, a field overriding an inherited model would overwrite all the
previously set field attributes. In v8 the new API allow us to keep
previous attribute, and only overwrite attributes of our wish.

Following the commit 7b1ef708 (october 2014) an old api field overriding
could conserve previous attributes values in some cases (if the new value
is falsy (None, "", 0, False, (), {}, [], ...) when it should not. It
was partly an optimization to diminish the size of orm registries
dictionaries to save memory (this patch has been tested with all odoo
modules and added +/- 3M).

This commit (proposed by rco) should overwrite falsy value (so the
behavior of v7 for old api fields overwritting is re-introduced) and
get back the behavior of old api in V7.

closes #7035
opw-639712
2015-06-12 15:08:54 +02:00
Damián Soriano 2df9060d97 [FIX] tests: db name moved from constant to function
Avoids initializing the DB constant too early
when subcommand modules are loaded, making them
unable to run db-backed tests later.

Closes #6984
2015-06-12 12:43:01 +02:00
Christophe Simonis 5e7f143c21 [MERGE] forward port of branch saas-3 up to ed76b2a 2015-06-11 13:00:49 +02:00
Christophe Simonis ed76b2a782 [MERGE] forward port of branch 7.0 up to e470385 2015-06-11 12:46:06 +02:00
Stéphane Bidoul d291aba4b5 [FIX] server: graceful shutdown must send SIGINT instead of SIGTERM to workers
Workers do not specifically handle SIGTERM so it can be used to
force quit them, but the graceful shutdown is triggered by SIGINT.

Closes #6738
2015-06-11 12:00:57 +02:00
Raphael Collet 4a5e2fe99e Merge pull request #5618 from acsone/8.0-fix-5616-ir_model_fields-from-fields
[FIX] model: use self._fields instead of self._columns to populate ir.model.fields
2015-06-09 09:51:49 +02:00
Odoo Translation Bot e2c9699cfc [I18N] Update translation terms from Transifex 2015-06-08 14:03:50 +02:00
Alexis de Lattre 96135fa785 [FIX] http: correct authentication via JSON-RPC.
Since 31d817e, we rotate then session at login/logout.
Unfortunatly, `openerpframework.js` does not support session id change
at authentication and keep old one.

In order to keep compatibility with existing js clients (including 7.0
ones), we do not rotate the session at authentication.

Fixes #6948
Closes #6949
2015-06-05 12:38:39 +02:00
SauliusZ 2948ed954b [FIX[ base: Currencies changed for Latvia and Lithuania
Latvia changed its currency to Euro from 2014 and Lithuania from 2015. It is not
possible to buy in old currencies anymore.
2015-06-03 19:03:45 +02:00
Jeremy Kersten daa69fb838 [FIX] http: avoid that request.not_found crash
return request.not_found crash with a internal error, because get_response
takes a environment as param.

Werkzeug Documentation:
Keep in mind that you have to pass an environment to get_response() because
some errors fetch additional information from the WSGI environment.
2015-06-01 10:30:16 +02:00
Martin Trigaux 7def86fcc7 [I18N] spring cleaning of untranslated languages
Remove languages that were not translated fro, the list of installable languages.
Installing languages with no translations (en_CA) has no effect and having a too
long list is misleading. Sorry Klingon.

Adding languages that were translated but not installable (fr_CA, en_AU)
2015-05-29 23:40:40 +02:00
Martin Trigaux 4528ccf148 [I18N] First sync of translations from Transifex
Translation is that which transforms everything so that nothing changes.
 -- Grass Günter
2015-05-29 21:58:20 +02:00
Martin Trigaux 409ca3e009 [I18N] Update translations from Transifex
Now I am become Death, the destroyer of worlds
2015-05-29 18:28:10 +02:00
Olivier Dony b17c7d66c7 [I18N] Final sync + cleanup of Launchpad Translations, moving to Transifex
See https://github.com/odoo/odoo/wiki/Translations
2015-05-29 11:22:32 +02:00
Olivier Dony 1cea0dc4e9 [I18N] Final sync + cleanup of Launchpad Translations, moving to Transifex
See https://github.com/odoo/odoo/wiki/Translations
2015-05-29 10:55:06 +02:00
Olivier Dony 3c3581e19f [I18N] Sync latest translations from Launchpad (not the final one) 2015-05-21 18:01:57 +02:00
Christophe Simonis e20dcda50d [MERGE] forward port of branch 7.0 up to 99c87b6 2015-05-21 16:33:45 +02:00
Olivier Dony 53980b7c52 [FIX] account, mail, etc.: uniformize evaluated expressions
opw-626694
2015-05-21 16:07:21 +02:00
Olivier Dony 8d745f9f50 [FIX] account, mail, etc.: uniformize evaluated expressions
opw-626694
2015-05-21 15:26:35 +02:00
Olivier Dony ebb5ddcd65 [I18N] Sync latest translations from Launchpad (not the final one) 2015-05-21 14:42:20 +02:00
Christophe Simonis 327e471c9b [MERGE] forward port of branch saas-3 up to b62ee07 2015-05-21 14:19:24 +02:00
Christophe Simonis b62ee0734c [MERGE] forward port of branch 7.0 up to eaaca65 2015-05-21 14:11:39 +02:00
Christophe Simonis 8a430c4a23 [FIX] base: ir.http: only server_attachement for 404 errors
fixes #6792
2015-05-21 13:46:38 +02:00
Christophe Simonis 1cf5723835 Revert "Revert "[FIX] fields: `digits()` computation""
Thamks to parent commit, `request.env` doesn't raise `AttributeError`
anymore for requests without session bound to a database.

This exception was bubbling up to `digits` property (and `__getattr__`)

This reverts commit 49cb46fb78.
This reinstate commit eeedd2d9f5.
2015-05-21 13:13:23 +02:00
Christophe Simonis 291119c802 [FIX] http: `request.env` and request.cr` now raise `RuntimeError`.
These method used to raise an `AttributeError` when `self.registry`
returns `None`. Now raises a more appropriated exception.
2015-05-21 13:13:23 +02:00
Colin Newell 6e54c8d17a [FIX] web: avoid marking session as modified every time
The `rotate` flag introduced by 31d817e849
was initialized at the very end of the session init, after
the reset of the `modified` flag.
This had the side-effect of marking the session as modified
for every request, saving the session to disk every time
even without any change.

Closes #6795
2015-05-21 12:52:54 +02:00
Denis Ledoux 49cb46fb78 Revert "[FIX] fields: `digits()` computation"
This reverts commit eeedd2d9f5.

This revision introduces an issue more serious than the ones
it fixes. This is no longer possible to receive an email
aimed a sale.order thread with catchall.

To reproduce the issue:
 - Create a new sale order
 - Send a message in the thread to the customer
 - Reply to the mail received in the customer mailbox
 - Traceback, AttributeError: digits

 opw-640370
2015-05-20 19:13:04 +02:00
Denis Ledoux 54a90179bb [FIX] expression: ensure tuple to compare leaf with TRUE/FALSE leaf
When setting a custom filter with as domain
[(0, '=', 1)]

the domain was rejected, because (0, '=', 1) wasn't
considered as a valid leaf, while it is.

This is because the Javascript converts this domain
using list instead of tuple
[(0, '=', 1)] -> [[0, '=', 1]]

And therefore, comparing the "list" leaf
to the TRUE/FALSE leaf tuple failed.

Ensuring "element" as a tuple solves the issue.

opw-640306
2015-05-20 15:33:35 +02:00
Christophe Simonis eeedd2d9f5 [FIX] fields: `digits()` computation
Ensure we always have an valid cursor when determining `digits()`.

fixes #6605, fixes #6650
2015-05-19 19:59:10 +02:00
Goffin Simon 6e06318828 [FIX] base: value = 0 for record ir_property
When a record is created with a field property of type integer or float equal to 0, there is
no record created in ir_property for this field. Then for a search of a record with this type of
field equal to 0, it must match all the records that have no corresponding property in the table
"ir.property" for this field.

ps: in 7.0, the function search_multi doesn't exist and the bug linked to cost price
doesn't happen because it's a float field.

opw:639746
2015-05-19 09:30:53 +02:00
Coin Newell 31d817e849 [FIX] web: rotate session identifiers after login/logout
As recommended by OWASP
https://www.owasp.org/index.php/Session_Management_Cheat_Sheet#Renew_the_Session_ID_After_Any_Privilege_Level_Change

Closes #6760
2015-05-19 01:45:46 +02:00
Denis Ledoux a4c7c564cf [FIX] stock_account: average cost in multi-company environment
When receiving goods with average price set as costing method,
for a move from another company than the SUPERUSER_id company,
the average price updated was the one from the SUPERUSER company
instead of the one of the move.

opw-634167
2015-05-18 11:49:55 +02:00
Raphael Collet 78a20a3dba [FIX] model: wrong alias used in read query for multi-inherited field
In commit 04ba0e99, we introduced an optimization for reading inherited fields
in a single query.  There is an issue when you have more than one level of
`_inherits`.  The query looks like:

    SELECT ...
    FROM table0, table1 AS alias1, table2 AS alias2
    WHERE table0.link0 = alias1.id AND table1.link1 = alias2.id AND ...
                                       ^^^^^^
                             should be alias1

This fixes the issue, and adds a test to reproduce it.  The fix is based on
@emiprotechnologies's own proposal, but is cleaner and does not break APIs.
2015-05-12 13:42:27 +02:00
Denis Ledoux 5d4560676e [FIX] res_users: action_id must be readable by the user
`action_id` is the loaded (window) action on user sign in.
It must thefore be readable by the user.

opw-634402
2015-05-12 11:33:43 +02:00
Christophe Simonis d8d3b38cbd [FIX] ir.logging: cursor should be in auto-commit 2015-05-11 19:01:37 +02:00
Christophe Simonis 04b252b72c [FIX] Cursor.closed property
`_obj` doesn't exists anymore when the cursor is effectively closed.
2015-05-11 16:24:33 +02:00
Raphael Collet fdc6ba1820 [FIX] http: make sure to instantiate an environment before calling method
This fixes an issue in property `field.digits` that cannot find a valid cursor
to the database.  Forcing the instantiation of an environment makes the cursor
retrievable.
2015-05-11 12:32:00 +02:00