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#13079Closes#13094
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#12566Closes#12986
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
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#12730Fixes#9293
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"
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
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.
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.
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
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.
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
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
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.
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.
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)
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.