Commit Graph
16 Commits
Author SHA1 Message Date
Ronald Portier f278589d2a [FIX] cli: support export of pot files
The export_translation method supports the "new language" option but
it was not possible if giving a .pot file.

closes odoo/odoo#85141

X-original-commit: 93e23025252784f39f37a7ffd109425ae56b1d36
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-02-22 16:16:40 +00:00
Raphael ColletandXavier Dollé 1595c0ee27 [REF] core: replace thread-local "envs" by cursor-bound "transaction"
Refactor the Environments object into a Transaction object, which is
bound to one cursor, and is no longer shared among several cursors.

The following methods/properties have been changed:
 - Environment.envs no longer works (because of the design change);
 - Environment.manage() is deprecated (no longer useful);
 - Environment.reset() is now an instance method;
 - env.clear_upon_failure() is deprecated in favor of cr.savepoint().

closes odoo/odoo#75598

Related: odoo/enterprise#20451
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Co-authored-by: Xavier Dollé <xdo@odoo.com>
2021-09-03 15:45:46 +00:00
luz paz c9e29e5917 [FIX] *: correct typos
Various user facing an non-user-facing typos
Found via `codespell`

Closes odoo/odoo#65648

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-02-19 13:20:48 +00:00
Xavier-Do 9c26d4d870 [IMP] core: rename upgrades-paths to upgrade-path
Since this option is soon to be used, this rename is a last tweek
to make it more logical to use since it will point to a single
upgrade dir most of the time.

closes odoo/odoo#44593

X-original-commit: 1c8e2809fb296abce6114b7da906d48a240df418
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2020-02-04 13:19:02 +00:00
Martin Trigaux ac63556e23 [IMP] base: explicitly pass parameters for translation methods
Instead of relying on the context content, pass explicit values for
overwrite and create_empty_translations
applu this to trans_load and trans_load_data
Adapt the test that was trying to create empty translations.
2019-11-19 10:37:07 +01:00
Julien Castiaux d47083e6d2 [IMP] module.py: deprecate openerp
[PEP-594] is deprecating the `imp` module, that module is used in
`module.py` in order to dynamically import addons using any of the
`odoo.addons` or `openerp.addons` import anchor.

We are deprecating `openerp` module/addons imports in v13 in order to
remove the support in v14 and greatly simplify how modules/addons are
loaded. If you are still using the old `import openerp` or `import
openerp.addons`, `import odoo` and `import odoo.addons` are drop-in
replacements.

The `odoo.modules.module.ad_paths` addon paths list has been deprecated
too. The list is now accessible on `odoo.addons.__path__` where they
are now directly loaded [2].

See also:

[PEP-594]: https://python.org/dev/peps/pep-0594/
[2]: https://packaging.python.org/guides/packaging-namespace-packages/

closes odoo/odoo#36597

Task: 2003936
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-09-20 05:58:16 +00:00
Laurent ContzenandOlivier Dony bbb1a8f151 [IMP] ORM: Add new --upgrades-paths CLI option
This commit adds a new way to use upgrades scripts folders
whithout needing to symlink them to an hardcoded path.

The folders specified in --upgrades-paths is then being used by
migration.py to find and execute migrations scripts per module
specified in the -u CLI option.

The folder needs to have the following structure:
- <upgrades_paths folder 1>
	- <module1 name>
		- <version1>
			- <script1>
			- <script2>
			- ...
			- <scriptn>
		- <version2>
			- <scripts>
	- <module2 name>
		- <versions>
			- <scripts>
	- ...
- <upgrades_paths folder 2>
	- ...

Update odoo/tools/config.py

Co-Authored-By: Olivier Dony <odony@users.noreply.github.com>
2019-08-05 12:21:00 +00:00
Olivier Dony cb2862ad2a [IMP] core: require install mode for db bootstrap
The registry loading system should not alter databases unless it is
asked to do so, by a module installation or update instruction.
This property should hold true as well for database bootstrap, and this
is what this commit changes..

In order to avoid any behavior change for command-line users, an
implicit `-i base` is assumed when starting the server from the
command-line with `-d <db>`, causing the db boostrap to happen if the
database did not exist yet.
2018-09-24 12:30:49 +02:00
Akram Ben Aissi cae7c71635 [IMP] cli: allows to run odoo with openshift
For containers using random uids[1], use the higher level method getpass.getuser
which as the same effect but also looks consider the environment variables to
determine the user name.

Details from
http://blog.dscpl.com.au/2015/12/unknown-user-when-running-docker.html

CLA signature for akram

Closes #26452

[1] openshift or docker as explained at
http://blog.dscpl.com.au/2015/12/random-user-ids-when-running-docker.html
2018-08-21 08:34:14 +02:00
Christophe Monniez b2a126da84 [IMP] server,db: coherently handle PGUSER env variable
When Odoo is started with a db_user using 'postgres', the process
exits with a status 1. However, this can be bypassed when the
PGUSER environment variable is used.
This commit will prevent the usage of the 'postgres' for the
environment variable too.
Also, when trying to list db's, various methods where used to find a
suitable postgres user to get this list.
In fact, as the db cursor is available, a user is already at work.
So, in order to avoid code duplication (e.g. verify user from
environment variables), this commit removes those various method
and get the db user from the cursor.
2017-11-09 13:25:16 +01:00
xmo-odoo 8e1ab16441 [FIX] core: mode of output file for t9n export
trans_export has been decided to use a *bytes* output buffer as some of
the output formats are text-ish (e.g. po) but others are definitely
binary content (e.g. XML). Therefore, when calling trans_export with a
*file*, it needs to be open in *binary mode*.

Fixes #20555
2017-10-30 16:18:04 +01:00
Xavier Morel be7c5aefdf [FIX] P3: CSV reading & writing 2017-08-20 23:25:54 +02:00
Fabien Meghazi b244f31151 [FIX] server: don't crash in case we can't check if a database exists
In case Postresgl access rights prevents the pguser to access
`pg_database`, the server should not crash when trying to create the
database because the pguser does not have the right to check if the
database exists and he won't be able to create a new database anyway.

However the database might exists and in such a case the flow should
continue. This patch allows the flow to be resumed in such a case, and
in case the database did not actually exists, a warning will tell the
user that it was not possible to check if the db existed and the
registry for this database will fail to be loaded afterward.
2017-07-31 10:03:45 +02:00
Simon Lejeune 630b4b1d55 [REF] cli: renamed .rc configuration file
A fallback for .openerp_serverrc has been implemented. If both
are present, Odoo will crash and report.
2016-09-30 12:05:49 +02:00
Raphael Collet 4a700d0ad9 [FIX] odoo: rename imports and adapt import hooks 2016-09-02 17:28:12 +02:00
Raphael Collet 9e64f9f951 [REF] openerp: move openerp to odoo 2016-09-02 17:28:12 +02:00