Commit Graph

971 Commits

Author SHA1 Message Date
Denis Ledoux 547204b7f4 [IMP] logging: store logs in database in multi databases env.
The server parameter `log-db` gives the possibility
to store the logs of a server in a specific database,
in the ir.logging model.

Unfortunately, it wasn't possible to store these logs within
the database from which the logs came from in a multi databases
environment (e.g. the SAAS).

This revision gives the possibility to store the logs
within the database where the logs come from,
using --log-db=%d (inspired from the --db-filter arg)

We also added the possibility to change the level of logs to store in
the database, with the --log-db-level argument, which is set
by default to `warning`.
2015-05-07 15:11:58 +02:00
belkacem77 d377f5690e [ADD] base: Kabyle language
Add a new language: Kabyle language
2015-05-04 16:56:03 +02:00
Martin Trigaux 18a0ba302b [MERGE] forward port of branch saas-3 up to a939efd 2015-04-17 14:40:19 +02:00
Martin Trigaux a939efdb3f [MERGE] forward port of branch 7.0 up to 21d3be8 2015-04-17 14:23:21 +02:00
Alejandro Santana 21d3be87b3 [FIX] tools: image size as power of 2
Backport of 6a8f395
Fixes #5677
2015-04-17 14:17:19 +02:00
Christophe Simonis ba54a668d4 [MERGE] forward port of branch saas-3 up to 2ffbb5f 2015-04-14 12:12:39 +02:00
Christophe Simonis 2ffbb5f93d [MERGE] forward port of branch 7.0 up to d246e36 2015-04-14 11:40:23 +02:00
Christophe Simonis d1031c34ac [FIX] ormcache: correct stat counter usage. 2015-04-13 13:17:23 +02:00
Christophe Combelles 737728a7a0 [FIX] base: import po file with comments only
Do not crash when importing a po file with only comments lines (e.g.
autogenerated files)
Fixes #4887
2015-04-13 11:38:42 +02:00
Christophe Simonis 3171fd472e [FIX] core: correct LRU cleaning
Do not change dictionary size since during iteration
2015-04-03 16:33:18 +02:00
Christophe Simonis 14fd77c132 [FIX] core: ormcache is now per regisry.
A cross-registry cache was introduced by e2ea691ce.
The initial idea was praiseworthy but sub-optimal for servers with a
lot of registries.
When there is lot of registry loaded, the cache size was huge and
clearing some entries took a lot of CPU time, increasing the chances
of timeout.

Also, the cache was not cleaned when a registry is removed from
registry LRU (this operation would also consume time).
2015-04-03 16:11:57 +02:00
Nicolas Lempereur 10c6fe4a6c [FIX] mail: make read more term translatable
opw-631860
2015-03-31 12:16:33 +02:00
Raphael Collet c58121e8f1 [FIX] method `ir_model.check` now decorated with `ormcache_context`
The method needs the `context` parameter to translate the error message in case
the access is denied and an exception is raised.
2015-03-26 17:14:42 +01:00
Raphael Collet 5aa23f8280 [IMP] ormcache: compute hit/miss/err statistics per database
In ormcache, those statistic numbers were counted per cached method for all
registries.  We introduce separate statistic counters, and create a counter per
(database, model, method).  The existing attributes that are no longer used
have been removed.
2015-03-23 14:36:15 +01:00
Raphael Collet b156c2e27e [IMP] registry: adapt LRU sizes for registries and ormcache
The registry size is now assumed to be around 10Mb, and ormcache size is
proportional to the maximum number of registries.  Statistics about ormcache
usage is shown to the log when receiving signal SIGUSR1.
2015-03-23 14:36:15 +01:00
Raphael Collet e2ea691cef [IMP] ormcache: turn it into a global LRU cache shared among registries
The ormcache is now shared among registries.  The cached methods use keys like
(DBNAME, MODELNAME, METHOD, args...).  This allows registries with high load to
use more cache than other registries.
2015-03-23 14:36:14 +01:00
Dharmraj Jhala 01f2c5c9d2 [IMP] Allow custom ordering of files contained in zip dumps
This will allow to speed up our migration platform: as funzip can pipe
the output of the first file of the archive, even if the file is not
fully unzipped yet. This is useful to plays with dump.sql without waiting
for the full archive decompression.
2015-03-18 14:22:22 +01:00
Jos De Graeve 170674f994 Fix nl_BE language name 2015-03-12 15:08:10 +01:00
Olivier Dony 13476c844d [FIX] fields.html, forum: opt-in stripping of @style attrs
For public-facing HTML content provided by the user,
`<style>` tags and `style` attributes should be stripped
automatically, as they can easily be abused to deface
pages for abusive users and spammers.
<style> tags were already stripped, the optional `strip_style`
for fields.html enables the automatic stripping of style
attributes.

This is opt-in because custom style attributes are still
desirable in trusted HTML fields.
2015-03-09 14:41:14 +01:00
Samus CTO fb285d8695 [FIX] prevent unneeded chmod datadir, but check writable 2015-02-27 17:16:16 +01:00
Xavier Morel 4bd2ee1aaa [FIX] undefined variable
Variable was added to an error message, then inlined in only one of the
two callsites. Undefined variable error would only appear when an error
is triggered in the actual (postgres-level) backup call.

inserted in ec9a543

fixes #5241
2015-02-27 15:07:15 +01:00
Denis Ledoux 2e7347dba5 [FIX] translate: possibility to disable translation of view nodes
Node content of inherited views using <attribute> tags are added
in the translation terms when syncing the terms.

The fact that the content should be translated or not depends
on the content, or to which attribute it refers.
For instance, string attributes should be translated, but
domains probably not.
But, even for domains, this is possible that it requires a translation
e.g. [('category_id.name', 'ilike', 'Customers')].
This domain is very unlikely to be integrated in the standard source code,
but this is possible to have such a domain in a view customization.

Therefore, we provide the possibility to disable the translation
case by case. Setting translation="off" in the attribute of the node
will prevent to add the node content in the translated terms.

opw-625762
2015-02-20 17:22:39 +01:00
Kiril Vangelovski ea60fed97a [FIX] tools.translate: use `request` to find `cr` and `lang` when other methods fail
Do it only after other direct methods fail,
to avoid ignoring a closer environement coming
from a calling frame.

+ Sign CLA

Closes #5148
2015-02-09 20:21:10 +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 7a0451d649 [FIX] safe_eval: no shadowing of PostgreSQL's exceptions
Letting PostgreSQL low-level exceptions bubble up
ensures that the mechanism for automatically
retrying transactions will work.
In case of transient errors such as deadlocks or
serialization errors, the transaction will be
transparently retried. Previously they were
transformed into ValueError and caused a permanent
failure immediately.

The fallback to ValueError is meant for invalid
expressions or expressions that use variables not
provided in the evaluation context. Other
exception types should be preserved (this is
further improved in Odoo 8)
2015-01-28 14:34:54 +01:00
Xavier Morel 426bcf427c [FIX] incorrect serialisation of log_handler
Saving log_handler to the config file is not currently special-cased,
the value is thus dumped as the repr() of the list, but not deserialized
with literal_eval. This means -s breaks log_handler and the
configuration file example is incorrect (it looks like a list).

Repeated -s further break the log_handler by interpreting the original
value as a string, putting it into a list, then reserialising that with
repr(), injecting a bunch of escaping backslash. The config file is soon
filled with backslashes and doubles in size with each new -s.

Furthermore for some reason the whole thing breaks --log-handler (and
aliases) entirely, once the wrong log_handler has been saved none of
them works anymore.

Fixes #4552
Closes #4157
2015-01-27 13:58:12 +01:00
Xavier Morel e9f0d79f85 [IMP] config: deduplicate loggers in log_handler
Saving multiple levels for the same logger should work with few issues,
but over time pathological (basket) cases (e.g. using ``-s`` all the
time) may build pointlessly huge lists in their config file.

Only keep the last level for each logger when saving to a config file.
2015-01-27 12:35:53 +01:00
Xavier Morel 8641826ca4 [IMP] config: make log_handler and --log-handler additive
For log_handler (list of logger configuration specs), having the
configuration file and the CLI configuration be exclusive (one
overwriting the other) is detrimental: it precludes keeping the
configuration file as a convenient baseline and only altering the subset
of loggers of interest at any given time. Combine specs from both
sources instead of overwriting one with the other.

* remove log_handler and its special case from the first options loop
* remove seeding of option with DEFAULT_LOG_HANDLER
* my_default is the baseline "configuration file" value, it's None if
  not provided which is not convenient. Use DEFAULT_LOG_HANDLER for it
  as baseline configuration file. DEFAULT_LOG_HANDLER isn't a list
  anymore, it's a CSV of logger specs (same as file-serialized)
* could actually use a DEFAULT_LOG_HANDLER of ``:`` (the default logger
  is root, the default level is info), but that might be a tad too
  cryptic
* things are weird between my_default and the file-sourced value,
  _parse_config is first run with my_defaults then with the file, but if
  there's no file it's re-run with already-parsed my_defaults. So when
  the file and the command-line values are of different type,
  _parse_config must be ready to handle both
2015-01-27 12:35:52 +01:00
Xavier Morel 9f4dea0891 [FIX] config: correctly serialize log_handler to CSV 2015-01-27 12:35:52 +01:00
Xavier Morel 23ad48a91b [FIX] config: a list is always equal to itself
add_option(action=append*) always modifies the ``default`` list
in-place. When using DEFAULT_LOG_HANDLER directly, that means
log_handler is always equal to DEFAULT_LOG_HANDLER since they're the
same list object. Thus the --log-handler command-line would never
overwrite the log_handler value from the configuration file, which is
unexpected

Fix that by copying DEFAULT_LOG_HANDLER before passing it as the
option's default value.
2015-01-27 12:35:51 +01:00
Martin Trigaux 2c99ddc612 [FIX] tools: exec_command_pipe parameters
args is a tuple, do not popen it as it's concatanated with another tuple
in _exec_pipe. This made the "print workflow" method crash.
2015-01-21 18:33:04 +01:00
Martin Trigaux cbd9b46129 [FIX] tools: return data from exec_command_pipe call
Rendering of workflow uses it, returns the pdf data
2015-01-21 18:33:04 +01:00
Simon Lejeune e40a6fd325 [FIX] tools: pass env in `exec_pg_command` 2015-01-20 17:36:20 +01:00
Christophe Simonis 7b7554c91f [MERGE] forward port of branch saas-3 up to cdb48d3 2015-01-19 12:16:33 +01:00
Christophe Simonis cdb48d39ba [MERGE] forward port of branch 7.0 up to 6c55a4b 2015-01-19 12:09:48 +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 2f5a7b63d3 [FIX] base: keep first multiline translation in po file
The first term of a po file is a comment for translator e.g.:
msgid ""
msgstr ""
"Project-Id-Version: openobject-addons\n"
...

This comment is ignored if there is no source and it is the first term of the po
file. The first flage was disabled too late and if the following terms also
started with an empty source (for too long terms), they were skipped as well.

Disable the flag as soon as the condition is evaluated to make sure no
additional terms are ignored. opw 619786
2015-01-16 13:05:46 +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
Martin Trigaux ae34a1e93e [IMP] config: remove deprecated comment
It was intended to be replaced by log-handler at first but log-level is still
a very convenient way to manage the level of debug.
2015-01-06 18:03:58 +01:00
Ronald Portier (Therp BV) 7c2795ca04 [FIX] base: specify correct pot file linked to po
In case of different directory for stroing po and pot files than 'i18n'
(e.g. 'i18n_extra'), a po could be linked to a wrong pot file.
Use the same folder as the po file to look for pot.
Fixes #4326
2014-12-31 13:56:54 +01:00
Denis Ledoux a175ed6b2f [MERGE] forward port of branch saas-3 up to 30674c3 2014-12-23 14:03:38 +01:00
Denis Ledoux 30674c3ed6 [MERGE] forward port of branch 7.0 up to e151e8f 2014-12-23 13:50:25 +01:00
Fabien Pinckaers c9446ed903 Merge pull request #1886 from lepistone/7.0-fix-yaml-onchange-user
use selected user and not admin to run yaml tests
2014-12-22 02:39:06 +01:00
Georges Racinet 9dad29caaf Reintroduce fname kwarg in configmanager
In [f04f409], the configmanager's __init__ lost its fname kwarg, which
allows to pass the name of the config file to read (or write).
Without it the only way to programmatically specify this file name is to
use the OPENERP_SERVER environment variable, which may be unpractical and/or
subject to renaming.

External tools (such as the buildout recipe) may need to pass this file in a
clean way.
2014-12-16 12:54:16 +01:00
Xavier Morel f04f409943 [ADD] doc: setup documentation
* Odoo installation from packages or source
* Deployment instructions for production environments
* dbfilter

Add missing support for disabling xmlrpc(/http), useful for WSGI
deployments which require running cron-only Odoo instances.
2014-12-15 16:01:37 +01:00
Xavier Morel a2115ef544 [FIX] ensure default addon paths are valid (existing)
User-provided addons paths are checked for existence (and rejected), but
default addons paths are not checked, and blow up when trying to listdir
them (e.g. when http.py tries to load modules).

This is an issue when using Odoo from the distributed tarballs, because
the packaging currently moves all modules to openerp/addons and removes
the root ("main") addons directory.
2014-12-05 19:12:33 +01:00
Denis Ledoux 9c7fb721f0 [FIX] translate: allow common english 2 chars terms
Before, all isolated (between xml/html tags) two chars words coming from views were not translated (by choice).
But, for some words, allowing them is useful. For instance, the word 'or' located between two buttons.

opw-616716
2014-12-04 13:13:07 +01:00
Raphael Collet be10d1e573 [IMP] translate: small, non-breaking code improvements 2014-12-02 09:40:59 +01:00