75 Commits
Author SHA1 Message Date
Martin Trigaux 75858d3509 [IMP] *: use correct indentation in manifest summary
The summary is a short char field. It should not contain carriage
returns.
The description is the longer text field.
Remove unnecessary spaces in both.

Automatically dedent the description to avoid this issue poping up
again in future modules.

closes odoo/odoo#138214

Related: odoo/enterprise#48695
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-10-11 08:18:49 +00:00
dasz d7df1856fa [IMP] cli: add scaffold for payroll localization
Added few basic rules and folders that are usually common to most localizations.
The template will also serve as documentation on naming conventions (not strict atm).

closes odoo/odoo#121446

Usage: ./odoo_bin scaffold -t l10n_payroll name-code (e.g. estonia-ee) [destination]
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-06-26 16:41:35 +02:00
Julien Castiaux 27865152bb [FIX] core: missing doc for some subcommands
Run `odoo-bin help`, you'll notice that some descriptions are missing,
this commit fixes that.

Run `odoo-bin shell --help`, you'll notice that the `usage:` line says
`odoo-bin [options]` instead of `odoo-bin shell [options]`. Other
commands that depend on the server cli are broken too. Fix those too.

closes odoo/odoo#121085

X-original-commit: 9c6bac741ff437564e7dbe4d0aa8dbd307b71f8d
Signed-off-by: Vincent Schippefilt (vsc) <vsc@odoo.com>
Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
2023-06-06 11:44:58 +02:00
Michele 724df8a570 [IMP] core: new neutralize flag on database restore and database duplicate dialog
Before this PR:
The only way to neutralize the database is running cli command neutralize

After this PR:
There is a new checkbox "neutralize database" in Duplicate database and Restore database dialog that neutralize the database after duplication/restore.
I also moved the neutralization code to the external module so it can be called also outside the cli .

closes odoo/odoo#122185

X-original-commit: 616740e9d09b3d0376be43ed1489e390f6f5823e
Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
2023-05-24 11:53:38 +02:00
Xavier-Do 7fda050abd [IMP] core: imcrease re.MAXCACHE
`re` is using an internal cache for regexes with a default size of 512
This is correct for small apps running on small infrastructure
but as a simple example, the routing map will compile ~1100 regex in a
row. This means that generating two routing map in a row don't benefit
from this cache at all. It looks reasonnable to increase this limit
globally for odoo.

This is visible when generating two routing map in a row.

After this change:

Generating routing map for key None
Routing map web generated in 0.194s
Generating routing map for key 1
Routing map website1 generated in 0.196s

After this change:

Generating routing map for key None
Routing map web generated in 0.200s
Generating routing map for key 1
Routing map website1 generated in 0.062s

Part-of: odoo/odoo#120542
2023-05-10 15:19:47 +02:00
Fabien Pinckaers 6d102d4ee4 [IMP] base: better copywriting for 'neutralized'
closes odoo/odoo#120263

Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2023-05-02 15:59:10 +02:00
Julien Castiaux fddf01e43f [FIX] core: deploy command broken in multi-db
Start a server without a -d and with a --dbfilter that allows for
multiple database. Make sure one of the database has the
`base_import_module` addon installed. Create an empty module using
scaffold and deploy it to the server, make sure to provide the `--db`
argument to the deploy command.

It zips the file and attempt to upload it but it fails for a 404 page
not found error.

The problem is that the controllers of base_import_module are only
accessible when the client is connected to a database. It must first
connect to a database (to have a db in his session) and then access the
controller.

The /web/login route is an example of a rather cheap route to get that
is both accessible without being connected to a database and that takes
a `?db=` argument to connect to one. Using that route, we can ensure
that we are connected to a database prior to uploading a module.

Closes #104589

closes odoo/odoo#107906

X-original-commit: 8feb5f366255c8cb7927842acea3ec76bbe11df2
Signed-off-by: Julien Castiaux <juc@odoo.com>
2022-12-14 22:04:07 +01:00
Chong Wang (cwg) a0bd7d0d72 [IMP] core: improve translation import speed
this commit improves the performance of importing translations by
1. groupup udpating data for different languages and different modules
2. read model_terms translations data directly with xmlid to get rid of fetching
   data from ir_model_data

for modules:sale_management, point_of_sale, industry_fsm, helpdesk, mrp, mrp_plm
(62 installed modules)
time for test_language_install is 45.14% less

for all modules:
time for test_language_install is 68.03% less

closes odoo/odoo#107332

X-original-commit: 727ef9e0a2ca93089b472eb1313117fee8dc876d
Signed-off-by: Raphael Collet <rco@odoo.com>
2022-12-06 17:12:21 +01:00
Joseph Caburnay d650ab6a9b [IMP] web,im_livechat: introduce @odoo/owl module
This is done so that using owl features and functions is done using
the standard import syntax, instead of destructuring properties out
of the owl global object.

So instead of just:

`const { Component } = owl;`

inside an odoo-module, we now do:

`import { Component } from "@odoo/owl";`

Note that we haven't removed the global `owl` object so existing
code will work as is.

Furthermore, we also augmented the tsconfig.json that's generated
from the tsconfig subcommand to take into account the path
of owl.js.

Task-id: 3032274
Part-of: odoo/odoo#104260
2022-10-27 14:41:17 +02:00
Laurent Desausoi 7593c073d2 [IMP] core: use inert SQL based neutralization
Before this commit the neutralize system introduced in v16 was using ORM
methods in order to change appropriate records. Although flexible, this approach
could lead to call some methods with side effects while neutralizing
(eg: overloads of write).

This patch converts the neutralize system to a safer "inert" SQL based approach
by migrating the generic method _neutralize to SQL files exposed in the
data folder.

Task id: 2961687

closes odoo/odoo#102792

X-original-commit: e5dbded9bb363351feff7ca8a56c7f8a6860f492
Related: odoo/enterprise#32580
Signed-off-by: Fabien Meghazi <fme@odoo.com>
2022-10-09 22:04:00 +02:00
Xavier Morel cf221d4ba7 [ADD] cli: db manager
Currently dbs can only be managed via the UI in order to take
filestores in account: while it's possible to load/copy/rename/drop
databases via `psql`, that will not manage the related filestores so
the result of the operation is incomplete DBs and leftover filestores
littering the disk.

Seems like a good idea to add a CLI to perform the same
tasks. Currently the CLI calls into the corresponding service, rather
than both calling into (possibly better designed) unified APIs, but
that seems fine for an initial version.

The top-level `db` command acts as a db manager, with git-style
sub-sub-commands for the various operations:

- `load` to load a dump file into a database (with a specified name or
  not)
- `dump` to dump a local db to a zip dump (pg_dump can be created via
  the corresponding command so not a concern)
- `duplicate` and `rename`
- `drop` in order to drop both the database itself and the
  corresponding filestore

Notably, `create` is currently left out because a database can
trivially be created by invoking odoo using a dbname which doesn't
exist, so doesn't seem useful.

`list` is also left out, because `psql -l` generally does the job.

closes odoo/odoo#97365

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2022-08-26 18:41:26 +02:00
Raphael Collet 32bc28aa66 [IMP] core: better API for flush() and invalidate()
This provides a new API for those operations, in order to make the
distinction between the use cases more explicit.  The former API was
using obscure parameter combinations to correspond to various cases.

In the summary below, `fnames` is an iterable of field names.  If the
parameter is not given, it means "all fields" in the given context.
Note that method recompute() is now mostly private, as it should not be
used in business code.

    # process pending computations and updates
    records.env.flush_all()                # all fields of all models
    records.flush_model(fnames)            # the fields of all records of the model
    records.flush_recordset(fnames)        # the fields of the given records

    # process pending computations, became non-public methods
    records.env._recompute_all()           # all fields of all models
    records._recompute_model(fnames)       # the fields of all records of the model
    records._recompute_recordset(fnames)   # the fields of the given records

    # invalidate the cache of fields
    records.env.invalidate_all()           # all fields of all models
    records.invalidate_model(fnames)       # the fields of all records of the model
    records.invalidate_recordset(fnames)   # the fields of the given records

Part-of: odoo/odoo#87527
2022-05-25 18:00:46 +02:00
Christophe Monniez bd3c681b99 [IMP] cli: add a command to generate a proxy token
This commit adds a `genproxytoken` command to generate and set an access
token for the proxy mode in the config file.

X-original-commit: 41a7224b46b3b163789257efd4583ef2d74479ba
Part-of: odoo/odoo#92195
2022-05-24 23:01:54 +02:00
root fa83960449 [IMP] cli: propose HTTPS website URL by default
As by now pretty much all of the internet runs on HTTPS & it is
recommended everywhere let's do so our in our manifest do.

closes odoo/odoo#91281

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-05-24 12:47:53 +02:00
Victor Feyens 0f2bea1e88 [IMP] core: minor improvement in populate cli
closes odoo/odoo#85537

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-05-19 18:06:05 +02:00
Victor Feyens 695ab84f63 [IMP] core: allow profiling & rollback of models population
Profiling: creation of ir.profile records for each models population
Rollback: allow triggering multiple times the same population,
without any risk of records conflicts (& having to recreated a clean database)

Note: those two options are mostly recommended for small models population.
Indeed, profiling slows down the population, and large/medium population is
already quite slow for some models (and it seems that the rollback breaks as well
for some advanced models).

Part-of: odoo/odoo#85537
2022-05-19 18:06:05 +02:00
root cca131eb71 [FIX] cli: use V15 url for manifest
closes odoo/odoo#86304

X-original-commit: 001cfd8ed85aad0377457bfc8477789b21a89480
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-03-14 08:43:07 +00:00
Raf Geens 6f3cd5fd94 [IMP] cli: Set global neutralization parameter
This flag allows code to detect it's running on a neutralized database.

closes odoo/odoo#85259

X-original-commit: 892efa2c8b85b86155d50055dca568592569d411
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
Signed-off-by: Raf Geens <raf@odoo.com>
2022-02-24 07:17:52 +00:00
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
Christophe Monniez 152310fe26 [IMP] core: add a neutralize CLI command
When debugging a database, it's sometimes desirable to neutralize it to
avoid undesired side effects like sending emails.

This commit adds a generic method `_neutralize` on models to neutralize
the current database. This method has to be overridden by modules models
that needs to be neutralized.

A new CLI command `neutralize`is now available that will permit to
neutralize a database from the command line before starting
investigations.

Pay attention that the neutralize operation cannot be reversed and should
only be used on a database copy.

Task id: 1818795

Part-of: odoo/odoo#67825
2022-02-01 09:54:07 +00:00
Jeremy Kersten 27df588c15 [FIX] *: remove trailing slash from controllers
Follow-up of c1ae086cdb

closes odoo/odoo#80139

X-original-commit: 58ee1a5906e4b2a50fb248085abd9caab97f4c52
Related: odoo/enterprise#22421
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-11-19 18:53:45 +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
Simon Genin (ges) 8d57a5cde9 [ADD] web: prettier and eslint tooling
Provide an opt in js tooling system by adding a node env with prettier and eslint configured.
3 bash scripts are provided: enable.sh, disable.sh and reload.sh.

Enable.sh: add to the community root (and optionaly to the enterprise root) the env.
Disable.sh: remove the env.
Reload.sh: disable then enable.
2021-06-18 21:31:27 +02: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
Simon Genin (ges) 9f56448388 [FIX] tsconfig: add missing command name attribute
closes odoo/odoo#66180

Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2021-02-15 14:11:19 +00:00
Simon Genin (ges)andFrancois 396fec3929 [ADD] cli: add a command to generate tsconfig
With the new native JS module system, we have a lot of new features for
the developer: autocompletion, docstrings, ...

However, it does not work across modules: if a JS file in
/addons/stock/static/src/some_file.js want to import a file in web, say
/addons/web/static/src/blabla.js, we will need to use a statement like
this:

import { something } from '@web/blabla';

Obviously, there is no automatic way for IDEs to know that '@web' should
map to 'addons/web'.

This is why we propose to use a tsconfig.json that defines the mapping
between modules and their paths.  This is not mandatory, and only
affects those developers that work commonly in JS.

Part of PR 63177

Co-authored-by: Francois (fge) <fge@odoo.com>
2021-02-15 10:18:11 +01:00
william cd5211904f [IMP] base: show average time on populate
Total population time is great but so is the average time for creating
one record.
2021-01-22 08:50:34 +00:00
Swapnesh Shah b07f2d31d2 [FIX] *: update document links
Before this commit, links to the documentation were referenced the
previous version, 13.0, instead of the current one, 14.0.

Eventhough there is a redirection done by NGINX of a "versionless" URL
to the latest one (e.g. /documentation/user/general/auth/google.html
-> /documentation/user/14.0/general/auth/google.html as of today), the
goal is to keep links owrking for users that will still be using the
14.0 in three years (and should not endup on the 17.0 doc).

closes odoo/odoo#60228

X-original-commit: 7ac08486d91d0ff0151abeeda057ffa6beda72e8
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-10-19 07:03:01 +00:00
Julien Castiaux e9859a0979 [FIX] module.py: Remove useless path initialization
The `initialize_sys_path` is the function responsible of getting the
custom Odoo import hooks to work, i.e. addons import via
`import odoo.addons`. This function is called by some other module
related functions to ensure the paths are correctly setup. We are
confident it is useless to re-initialize the path in many places.

The `load_openerp_module` function is called during server bootup by
both `odoo-bin server` and `odoo-bin shell`, both command parse the
configuration before starting the server which initialize the paths
already.

Most call to `get_module`, `get_module_path` and `get_resource_path` are
done in models or controllers where a registry is setup already. There
is one notable exception which is the subcommand discovery done during
the bootup, for that specific case, we initialize the paths with a
partially loaded configuration.

closes odoo/odoo#49715

Task: 2200956
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2020-04-17 13:23:04 +00:00
1c522ee778 [ADD] odoo-bin cloc cli subcommand.
Odoo cloc is a tool to count the number of relevant lines written in Python,
Javascript or XML. This can be used as rough metric for pricing maintenance of
customizations.

It has two modes of operation, either by providing a path:

    odoo-bin cloc -p module_path

Or by providing the name of a database:

    odoo-bin cloc --addons-path=dirs -d database

In the latter mode, only the custom code is accounted for.
Both modes can be used simultaneously.

Files that cannot be parsed are shown at the end of the report.
Parsing can fail due to syntax errors or excessive file size.

closes odoo/odoo#52635

X-original-commit: ae858c3ac66267b4726db459032b91a6be1cc1d6
Related: odoo/enterprise#11018
Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
Co-authored-by: Thibault Francois <tfr@odoo.com>
Co-authored-by: Antoine Vandevenne (anv) <anv@odoo.com>
2020-06-09 00:30:55 +00:00
Xavier-Do f545fd274d [IMP] core, base: add tooling to populate database
Some use case like testing performance or upgrade scripts required a database
with prefilled data, covering basic corner cases. A solution can be to
create data a procedural way.

This commit proposes an API to easily populate a model, usually by giving a
list of possible values for each field or by giving a compute method that will
be based on raw values of other fields.

The basic way to define how to populate a new field is to override `_populate_factories`,
a method that returns a sequence of pairs `(field_name, factory)`.

The definition of a field is a "factory", a function that returns a neverending iterator
combining its value(s) with the values of the iterator given in parameter.
Some factory helpers are given in `tools.populate.py`:
- `iterate(vals, weighs)` ensures that one record is created for each value
by iterating on them, then resumes as `random.choice` on those vals following weights
once the first iteration is finished.
- `cartesian(vals, weights)` makes a cartesian product of its own values with the values
of its input iterator, then resumes as a randomized generator.
- `compute(function)` calls the given function with the current values dict and a random object,
and assigns the current field to the returned value.
- ...

Each iterator yields dictionaries of field values, and the factory should add a
value for the current field(s).  The yielded dictionaries also contain a pseudo_field
`"__complete"`, that indicates whether this step is some randomized data
to reach the expected count of records.  A falsy value indicates that the iterator
is still covering mandatory cases.  This indicates whether a cartesian product is
finished, or an `iterate` has consumed all its values.

The order of the factories is quite important, since some computed fields may need
other fields to be defined, and `cartesian` factories should always be at the beginning
to avoid having too many combination.  That is why the factories are given as a list of
pairs instead of a dictionary; this makes it easier to insert elements at any place.

Example:
field A: cartesian([T, F])
field B: cartesian([0, 1])
field C: iterate([a, b, c, d, e])
field D: compute(1-B)

_c is shortcut for __complete
_ is a random value, or result of a random value

```
iter | root  | field A  | field B | field C     | field D   | result
0     {_c:F}  {... A:T}  {... B:0} {...C:a}      {...D:1}    T,0,a,1 complete:False
                         {... B:1} {...C:b}      {...D:0}    T,1,b,0 complete:False
              {... A:F}  {... B:0} {...C:c}      {...D:1}    F,0,c,1 complete:False
                         {... B:1} {...C:d}      {...D:0}    F,1,d,0 complete:False
1     {_c:T}  {... A:_}  {... B:_} {...C:e,_c:F} {...D:_}    _,_,e,_ complete:False
2     {_c:T}  {... A:_}  {... B:_} {...C:_}      {...D:_}    _,_,_,_ complete:True
```

X-original-commit: 4c0182dafa584853ed83a166096f45c33c06a245
2020-03-30 21:30:13 +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
Denis Ledoux a1fc9c0427 [FIX] scaffold: clean the templates:
- Add blank lines at end of python files (pep8)
 - Easier uncomment (entire blocks, and no remaining whitespaces in empty lines)
 - Add `_description` to model to avoid the warning telling it's missing
 - Correct compute field, `self.value` raised an `ensure_one` issue
 - Change access so the user can add/edit/delete records in the web interface
   by default
 - Correct the server action, `self` is not in the server action context.

closes odoo/odoo#40659

X-original-commit: 622615771d0a6f8544f6810f30df46aea0e0fb9c
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
2019-11-21 18:21:40 +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
Adrien Horgnies 745f5f951f [FIX] command: typo in unknown command exit message
closes odoo/odoo#39260

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2019-10-24 08:16:39 +00:00
mreficent 41c434cd5d [FIX] v13 urls
Was still pointing to old links

closes odoo/odoo#37859

Signed-off-by: Adrian Torres (adt) <adt@odoo.com>
2019-10-03 12:48:09 +00:00
Julien Castiaux 7c47eb1854 [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-16 09:31:38 +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
Nicolas Martinelli 79d29c51df [FIX] base_import_module, cli: deploy
The use of the `deploy` command always fails because of an incorrect
CSRF token since commit 9bae56acd4. Indeed, the latter
re-introduces the session rotation, i.e. the session ID is changed at
authentication.

Practically, what happens server-side is:
- authentication
- generate CSRF token
- create the response with the token and a change of session ID

At this point, the token generated is not correct anymore since it is
based on the 'old' session ID. Therefore, when it is reused at
uploading, an error is raised.

It is actually possible to simplify the process by performing the
authentication and the file upload in a single request. There is indeed
no real use of extracting the authentication, since the request is then
only used to upload the module.

opw-1902863

closes odoo/odoo#28653
2018-11-14 09:40:17 +00:00
Swapnesh Shah 44287eb719 [FIX] doc: correct links to categories
Was pointing to a file that no longer exists

Fixes odoo/odoo#27741

closes odoo/odoo#27755
2018-10-17 10:03:25 +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
qsm-odoo 3f6ddd4a66 [REF] odoo: adapt scaffolding templates 2018-04-18 15:59:06 +02:00
Christophe Simonis 33bf2fe922 [MERGE] forward port branch 11.0 up to aed8f45346 2018-02-05 15:06:55 +01:00
Christophe Simonis 2dbc1edef9 [MERGE] forward port branch saas-16 up to b503e79722 2018-02-05 13:42:10 +01:00
Christophe Simonis b503e79722 [MERGE] forward port branch saas-15 up to 81003c82e0 2018-02-05 13:08:32 +01:00
Christophe Simonis e5f2e6d390 [MERGE] forward port branch 9.0 up to b08185fc66 2018-02-05 11:30:42 +01: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
Christophe Simonis 30b1b89496 [FIX] odoo shell: P3 compatibility when reading script from stdin 2017-09-20 11:31:21 +02:00