Commit Graph
32 Commits
Author SHA1 Message Date
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
Xavier Morel be7c5aefdf [FIX] P3: CSV reading & writing 2017-08-20 23:25:54 +02:00
Christophe Simonis f46a393602 [MERGE] forward port branch saas-16 up to 09d698d05f 2017-07-31 14:53:06 +02:00
Christophe Simonis 09d698d05f [MERGE] forward port branch saas-15 up to a6900c43b4 2017-07-31 14:09:34 +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
Fabien Pinckaers 5a97afcce1 [FIX] scaffold: small fix in template 2017-07-03 16:33:26 +02:00
Xavier Morel b86e5fa477 [FIX] P3: exec keyword -> builtin function 2017-05-12 09:27:17 +02:00
xmo-odoo 6659d5a7d2 [FIX] P3: metaclasses handling
* cross-version metaclass spec
* more formally deprecate browse_record and browse_null since they
  were using metaclasses anyway
* update docstrings referencing the latter
2017-05-11 15:25:36 +02:00
xmo-odoo fffaf735f5 [FIX] P3: list -> iterable builtins (#16811)
In Python 3:

* various builtins and dict methods were changed to return
  view/iterable objects rather than lists
* and the separate Python 2 view/iterable builtins and methods were
  removed altogether

This is problematic when using these items as list (which the happens
repeatedly in Odoo), but more viciously when iterating *multiple times*
over them (which also happens, which I've messed up multiple times while
writing this, and which is a pain to debug even when you've just created
the issue).

Convert all code using these to semantics-matching cross-version
helper functions to get the LCD behaviour between P2 and P3, and
forbid the builtins via lint.

issue #8530
2017-05-10 09:39:55 +02:00
xmo-odoo b4429c2a91 [FIX] Various P3-related import changes
* LDAP import: python-ldap is not python3-compatible, pyldap is

  Warning: only supported from debian Stretch (current testing)?
  https://packages.debian.org/search?searchon=names&keywords=pyldap

* implicitly relative imports
* imports of moved or removed stdlib modules

issue #8530
2017-04-28 09:06:53 +02:00
xmo-odoo 6b9268bd15 [FIX] print statement -> function
In Python 3, ``print`` becomes a builtin function. This is available
in Python 2 by importing the ``print_function`` feature from
``__future__``, the feature is conveniently still available in Python
3 (it just does nothing).

Fixers:
    libfuturize.fixes.fix_print_with_import

#8530
2017-04-25 13:27:54 +02:00
Christophe Simonis 4441237b0a [MERGE] forward port branch saas-15 up to ab68a1c674 2017-04-25 12:36:02 +02:00
Daniel Reis 3e0b720e51 [IMP] cli: extract the project's path from active virtualenv (closes: #16512)
The start command takes the default dbname from the path.
But when running inside a virtualenv, it is a better default to take the
dbname from the virtualenv's path.
2017-04-21 10:32:09 +02:00
Christophe Simonis 39ab200cd3 [MERGE] forward port branch saas-15 up to 780064ea89 2017-04-18 18:37:24 +02:00
Christophe Simonis ea2faefe0d [FIX] odoo-bin shell: force rollback on exit
Each REPL python shell behave differently depending on the exit method.
Force a rollback at the end to avoid inconsitent behavior.

Thanks to Harry Jollenbeck for the report: https://www.odoo.com/groups/59/26318707
2017-04-14 12:38:51 +02:00
Xavier Morel 3979f6802e [#8530] convert exception handlers to except..as syntax
Futurize fixers:
* lib2to3.fixes.fix_except
2017-04-11 14:53:29 +02:00
Uku Lagle f701311f72 [FIX] cli: correct link to module categories file
As the folder openerp no longer exists

Closes #14263
2016-11-14 17:07:44 +01:00
Yenthe V.G 3f605d18ba [FIX] cli: correct templates for scafold
Convert openerp to odoo

Closes #14129
2016-11-14 16:26:23 +01:00
Christophe Simonis 467a958ab0 [FIX] core: handle gevent on command line correctly 2016-09-30 12:05:49 +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
Simon Lejeune 2d5fc151a2 [REF] cli: rename odoo.py to setup_dev.py
and move it under the setup package. Since the rename of the
openerp directory into odoo, having a script named "odoo.py"
conflicts with a package named "odoo".
2016-09-30 12:05:49 +02:00
Fabien Meghazi 4e546cdb0d [ADD] shell: add support for more REPLs in shell mode 2016-09-19 16:35:10 +02:00
Raphael Collet cdd03c3afe [FIX] in all python code, rename openerp to odoo 2016-09-07 14:45:08 +02:00
Olivier Dony 4339196e52 [IMP] support v10 manifest file naming convention
- As of v10, manifest files should be named `__manifest__.py`
- For backwards-compatibility, __openerp__.py manifest files
  will still be supported for the time being
- Limited refactoring, to add support for the 2 different
  naming conventions
- All textual references to __openerp_.py updated in
  documentation and examples
2016-09-05 11:57:50 +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