Commit Graph
9183 Commits
Author SHA1 Message Date
Aristobulo Meneses bfdf5a6e12 [FIX] cli/server: handle comma-separated db_name config properly
The db_name parameter passed in command-line (-d) or in configuration file,
supports a list of database names separated by commas, in order to
preload them. The WorkerCron processes will also respect this list and only
connect to the specified database(s).

As of Odoo 9 the server also automatically initializes a new database
if the one passed via `db_name` does not exist or is not initialized.
This code did not properly handle multiple comma-separated value,
and created an unitialized database named `a,b` when db_name was set
to `a,b`.

Fixes #13079
Closes #13094
2016-08-09 20:12:33 +02:00
Thibault Delavallée 90a5079d01 [FIX] various: fix fields index parameter in new API still called select 2016-08-09 10:26:53 +02:00
Martin Trigaux a1fbb3d389 [FIX] base: translate _constraint message
While the error content is automatically translatable, the header was not.

Fixes #5645
2016-08-08 11:54:32 +02:00
Odoo Translation Bot 8a3a620404 [I18N] Update translation terms from Transifex 2016-08-07 00:38:49 +02:00
Bruno PLANCHER f5e803c025 [FIX] tools: strip i18n-overwrite from gevent parameters
When gevent is enabled, some arguments are stripped to avodi being retriggered
in the other workers (e.g. update of a module).
The `--i18n-overwrite` was not stripped and the other worker raised an error has
the `overwrite_existing_translations` argument requires the `update` argument
(which is stripped in the `stripped_sys_argv` method.

Fixes #12566
Closes #12986
2016-08-03 16:33:27 +02:00
Martin Trigaux 1dbd085743 [FIX] base: add missing part to 04b081ab
The 'amount 42 False' bug could also be reproduced with monetary widget.
2016-08-03 14:26:06 +02:00
Martin Trigaux 04b081ab37 [FIX] tools: do not display False as the currency
The field symbol is not required on a res.currency (it should and will be
changed in master). In case it is not set, do not display the currency in the
rapport.

Fixes #11346
2016-08-03 14:23:11 +02:00
Odoo Translation Bot b7eb3c6bd0 [I18N] Update translation terms from Transifex 2016-07-31 00:38:56 +02:00
Christophe Simonis d35f4250cc [MERGE] forward port branch saas-6 up to 7079a0b 2016-07-28 12:22:03 +02:00
Christophe Simonis 7079a0be30 [MERGE] forward port branch 8.0 up to 8ceb943 2016-07-27 18:13:51 +02:00
Guewen Baconnier 6cc7c03212 [FIX] tools: use without_demo specified in configuration file
When using the -i command line option without the --without-demo=all command
line option, demo data was installed even if the configuration file has
a line without_demo = all

This change is safe as just above, opt.without_demo is copied into
self.options['without_demo'] so we are sure to consider the 2 options.

Closes #12730
Fixes #9293
2016-07-27 17:39:09 +02:00
Jeremy Kersten 49d789cf99 [FIX] base: widget duration - allow to round to avoid seconds
Allow to round the duration to a minimal unit.

Eg:
   0.33 hour = 19.8 min = "19 minutes 48 seconds"
   if option {'widget'='duration', 'unit'='hour', 'round'='minute'}
   0.33 hour => 20 min = "20 minutes"
2016-07-26 16:17:50 +02:00
Christophe Simonis 7df4ea5b57 [MERGE] forward port branch 8.0 up to 43cff22 2016-07-25 14:07:50 +02:00
Olivier Dony 8245c1d1d8 [FIX] service.server: drop idle connection attempts
Avoid wasting HTTP workers (in prefork server mode)
for pending/idle connections.
HTTP connections that have not sent anything for 500ms
will be dropped.

In particular, wkhtmltopdf uses a connection pool
to load remote resources. It opens more HTTP connections
than necessary and uses a random subset of them, leaving
the other idle.

On a server that has little available workers this
may significantly delay report rendering, and could
even lead to a deadlock.

OPW-667870
2016-07-25 13:06:31 +02:00
Olivier Dony 43cff22950 [FIX] base: fix broken URLs when redirecting
Similarly to werkzeug.urls.url_fix(), attempt to
correct some leftover special characters that
should have been URL-encoded.

We cannot actually use `werkzeug.urls.url_fix` or
`werkzeug.urls.url_quote`, as they expect more/most
characters to be un-encoded.
We have many existing cases where the redirect URL is
already fully encoded or mostly encoded, and those
functions would cause double-encoding, breaking the
final URL.
2016-07-25 13:06:31 +02:00
Olivier Dony 01acb8a497 [FIX] base: fix broken URLs when redirecting
Similarly to werkzeug.urls.url_fix(), attempt to
correct some leftover special characters that
should have been URL-encoded.

We cannot actually use `werkzeug.urls.url_fix` or
`werkzeug.urls.url_quote`, as they expect more/most
characters to be un-encoded.
We have many existing cases where the redirect URL is
already fully encoded or mostly encoded, and those
functions would cause double-encoding, breaking the
final URL.
2016-07-25 13:05:01 +02:00
Christophe Simonis eff0a3b049 [MERGE] forward port branch 8.0 up to 84f9cdd 2016-07-25 10:24:33 +02:00
Odoo Translation Bot 84f9cdd1d9 [I18N] Update translation terms from Transifex 2016-07-24 02:59:48 +02:00
Odoo Translation Bot 6dcaffa3e0 [I18N] Update translation terms from Transifex 2016-07-24 00:30:28 +02:00
Nicolas Martinelli 2c19e9be96 [FIX] base: cherry-pick 55fa0912 to 8.0
Backported to 8.0 following report at #12648

[FIX] base: use datetime instead of date

The variable `date` is compared to the field `name` in the selection
query. `name` is filled in with datetime data. In particular, in the
module currency_rate_live, datetime.now() is used in the name. It is
necessary to make an appropriate comparison to make sure we select the
updated rate right away.

Fixes #12648
2016-07-19 12:58:13 +02:00
Odoo Translation Bot c3dd308913 [I18N] Update translation terms from Transifex 2016-07-19 12:10:41 +02:00
Olivier Dony 36e875e796 [FIX] ir.http: make browsers trust our mime types
We determine the mime types of the files we server
automatically + manually, and browsers should not
try to second-guess it.

Browser mime-guessing is there for the myriads of
badly configured web servers out there.
2016-07-18 19:44:37 +02:00
Olivier Dony 82142475f7 [FIX] mail,base: import XML attachments as text 2016-07-18 19:44:37 +02:00
Olivier Dony 399e2bcf6d [FIX] ir.attachment: simplify xhtml-like mimetypes matching
Simplify/complements revision f6090e69e6,
forcing text/plain for xml-like files.

Ignore forced `mimetype` when downloading attachments, if the model
has its own mimetype or if we can guess it.
`default_mimetype` still available as a fallback.

See also the list of mimetypes supported by common browsers, e.g.:

 - Firefox: CParserContext::SetMimeType in:
    https://hg.mozilla.org/firefox/file/default/parser/htmlparser/CParserContext.cpp

 - Chrome:  kSupportedNonImageTypes constant:
    https://cs.chromium.org/chromium/src/components/mime_util/mime_util.cc?sq=package:chromium&rcl=1467904650&l=89
2016-07-18 19:44:37 +02:00
Odoo Translation Bot 691949c4b8 [I18N] Update translation terms from Transifex 2016-07-17 00:30:21 +02:00
Christophe Simonis fd9eb2e481 [MERGE] forward port of branch saas-6 up to e928c60 2016-07-14 16:23:22 +02:00
Christophe Simonis a039fc509b [MERGE] forward port of branch 8.0 up to 9650249 2016-07-13 17:26:44 +02:00
Jairo Llopis 0529a7f9ba [FIX] tools: extract terms in correct folder
If two addons path have a common part in the folder name (e.g. `/home/alice/dev`
and `/home/alice/devodoo`), the `get_module_from_path` method may match the
wrong folder.
A file `/home/alice/devodoo/bob/models.py` would wrongly match `/home/alice/dev`
path (due to the lack of separator) and the returned module would be `odoo`
(`"odoo/bob/models.py".split('/')[0]`).

In such scenario, the translations of files (code, static folder, report) would
not be included in the exported translation file.

Force the module path to ends with a folder separator to avoid wrong matching.

Closes #12757
2016-07-13 09:43:38 +02:00
Jairo Llopis ee365bbf98 [FIX] modules: choose the right addons path
When launching a server with two similar addons path, e.g.:
- /home/alice/dev
- /home/alice/devodoo

launching the server in dev mode may crash due to the poor matching using
`path.startswith(...)` method which may make `/home/alice/devodoo/bob/main.xml`
match in addons folder `/home/alice/dev` and with a non-exitant local path
`odoo/bob/main.xml`.

Instead of relying on the name, use the `os.path.commonprefix()` method to match
on real paths and avoid partial matching.
commonprefix will only work if the folder name ends with the appropriate
separator (which is not guarantee for a user provided addons-path) so force a
trailing `/` using os.path.join(..., '')`.

Closes #12359
2016-07-12 17:21:50 +02:00
Odoo Translation Bot ef83f798d5 [I18N] Update translation terms from Transifex 2016-07-10 03:01:32 +02:00
Odoo Translation Bot 5a73ff2f1f [I18N] Update translation terms from Transifex 2016-07-10 00:30:32 +02:00
Christophe Simonis 5949eedfdb [MERGE] forward port of branch 8.0 up to 0c3cd7cb 2016-07-08 16:32:10 +02:00
Martin Trigaux 0df7a1ca2f [FIX] base: decode params_store content
The parameter bin_size=True will display the size of the binary field.

Fixes #12681
2016-07-06 16:24:50 +02:00
Philipp Hug 84daaa1658 [FIX] base: use correct address format for CH/LI
Closes #10911
2016-07-04 17:12:14 +02:00
Odoo Translation Bot 1986980a51 [I18N] Update translation terms from Transifex 2016-07-03 02:59:06 +02:00
Odoo Translation Bot e349692ede [I18N] Update translation terms from Transifex 2016-07-03 00:32:09 +02:00
Simon Lejeune 7f2e748a22 [REV] base: allow 'render' override with new api
Using a frozendict as context breaks the `t-lang` mechanism, as
the `loader` is not aware of the changes of a copied frozendict
and thus is still using the values from the original context,
including the lang one.

This reverts commit e1deae7eab.
2016-07-01 15:41:39 +02:00
Yannick Tivisse 2f020dc8b9 [IMP] Remove 'author' field in __openerp__.py files to user default value 2016-06-30 13:27:46 +02:00
Christophe Simonis 10550aa5a5 [MERGE] forward port of branch saas-6 up to e68ed41 2016-06-28 13:11:35 +02:00
Christophe Simonis e68ed417b6 [MERGE] forward port of branch 8.0 up to 3e965ec 2016-06-28 12:23:54 +02:00
Odoo Translation Bot 3e965ecf58 [I18N] Update translation terms from Transifex 2016-06-26 02:57:50 +02:00
Odoo Translation Bot 765b3fc6ac [I18N] Update translation terms from Transifex 2016-06-26 00:29:54 +02:00
Christophe Simonis 4030f2fd32 [MERGE] forward port of branch 8.0 up to 297bbff 2016-06-23 16:21:28 +02:00
Odoo Translation Bot d14efd562b [I18N] Update translation terms from Transifex 2016-06-22 21:14:56 +02:00
Raphael Collet ff93777099 [FIX] models: inverse several computed fields based on a common computed field
Consider fields G1 and G2 being computed fields with inverse methods that
require the value of a common dependency F, which is also a computed field.
For inversing G1 and G2, their values are put in cache, then their inverse
method is called.  If the inverse method of G1 requires the computation of F,
setting F's value will invalidate both G1 and G2 in cache.  Hence the value of
G2 is lost when invoking its inverse method!

The fix consists in marking G1 and G2 as being computed before invoking their
inverse method, which prevents them from being invalidated by field F.
2016-06-22 14:01:59 +02:00
Martin Trigaux 06fd45241f [IMP] hw_blackbox_be: better description
Some users using community version of Odoo may understand that this module turns
the POS into a certified module (which is what pos_blackbox_be does).

Update base.pot to reflect the changes (and add other missing translations)
2016-06-22 09:43:44 +02:00
Odoo Translation Bot 108eee76c5 [I18N] Update translation terms from Transifex 2016-06-22 07:45:52 +02:00
Odoo Translation Bot 41ec7eec56 [I18N] Update translation terms from Transifex 2016-06-22 07:12:57 +02:00
Christophe Simonis 0a2317d303 [FIX] test_new_api,web: tests 9.0 adjustments
Rev e37ba61 forward-ported 8.0 revision f02b230 from PR #12379.
This patch introduces extra tests and views for o2m onchange behavior,
including new fields in the test models.

In 9.0 a new convert_to_onchange() mechanism had been
introduced at 9f81c6d

The combination of both requires some adaptation to the
expected results of the new tests and adaptation of existing tests.

The test models in `test_new_api` have an implicit depencies between
models which cannot be express on ORM:
    messages depends on participants of their discussion.

So, when editing a discussion, the field `participants` should be
processed before field `messages`. This is not always done because
field processing order depends of the iteration order of a `dict` (which
is undefined in python).
The testing tour `widget_x2many` worked by chance until now.
Adapt the tour to save the participants before the messages.
2016-06-21 11:23:18 +02:00
Christophe Simonis e37ba61832 [MERGE] forward port of branch saas-6 up to b87a93a 2016-06-20 14:20:03 +02:00