Commit Graph
34 Commits
Author SHA1 Message Date
Adrian Torres 31ba0fb41b [FIX] ir_module_module: unlink uninstalled modules (#21111)
Before this revision, unlinking a module which has been uninstalled at
least once would raise an Exception because base_module_uninstall
contains a field model_id which is required. The unlink method of
ir_module_module would try to set this field to NULL which is of course
a constraint violation.

This is fixed by manually unlinking the respective base_module_uninstall
records before the unlinking of the ir_module_module record itself

Fixes #20720

DO NOT FORWARD-PORT
2017-11-21 11:13:24 +01:00
Christophe Simonis 8f1e2044cd [MERGE] forward port branch saas-16 up to 810b6aa760 2017-10-31 16:29:07 +01:00
Christophe Simonis 810b6aa760 [MERGE] forward port branch saas-15 up to d1fcca1504 2017-10-31 15:25:01 +01:00
Christophe Simonis a0157f104f [MERGE] forward port branch 10.0 up to dcce040a63 2017-10-31 12:07:15 +01:00
Wolfgang Taferner 088f1e3fdc [FIX] base: load translation files in correct dependency order
Fixes #19824
opw-776928
2017-10-27 09:52:20 +02:00
Christophe Simonis 5ce21c7355 [MERGE] forward port branch saas-16 up to b3d0897f2d 2017-10-02 13:05:17 +02:00
Olivier Dony e4672db97d [IMP] module: make internal methods private
Only methods that are meant to be accessed by the client-side
directly (or via RPC) should be public. All others should be private by
default.
2017-09-28 14:15:30 +02:00
Olivier Dony dc49ba1dc1 [IMP] module: verify and log admin operations
Verifies that admin operations on modules/apps are indeed performed by
an administrator, regardless of ACLs on `ir.module`.
Also logs these important operations, whether completed or blocked.
2017-09-28 14:15:23 +02:00
Christophe Simonis 017ee5eab3 [MERGE] forward port branch saas-17 up to 877e709871 2017-08-24 13:17:53 +02:00
Richard Mathot 594ff13f58 [IMP] base: log user id triggering module (un)installations
After a few tickets with clients asking "who installed this app?", we
will be able to answer with this.
2017-08-24 09:55:38 +02:00
Olivier Dony 695716efb0 [FIX] P3: remove pycompat.{keys,items,values} helpers
Now that we're closer to switching to P3 for good, these helpers have
outlived their usefulness, and mostly add noise.

All remaining dict.iter*() or dict.view*() must be converted to the
normal keys(), values() or items() calls.

Whenever the result is likely to be used for more than the scope of a
loop, or when the dict needs to be modified during iteration, the calls
must be wrapped in a ``list()``, to protect the new P3 semantics.
Those cases are very exceptional.

Also removed some dead code or improved the API to remove unnecessary
conversions.
2017-08-20 23:25:54 +02:00
Xavier Morel 7dd062f835 [FIX] P3: text model types
* remove references to basestring & unicode (use relevant pycompat
  helpers)
* remove some str calls (either entirely or replaced by relevant
  helper, either text or native)
* use better API to avoid unnecessary conversions
* remove some XML declarations in views
2017-08-20 23:25:54 +02:00
Xavier Morel 3824b5dcc1 [FIX] P3: fix base64 and StringIO uses
* StringIO removed from stdlib, replace with io
* try to correctly handle BytesIO/StringIO (one is for bytes the other
  is for text)
* fix base64: Python 3 removed bytes-encoding and bytes-bytes
  codecs (via #encode) so replace all calls to str.encode('base64'),
  also b64encode is a bytes->bytes conversion so attempt to properly
  handle that

issue #8530
2017-08-20 23:25:54 +02:00
Christophe Simonis 1fa8680286 [MERGE] forward port branch saas-17 up to 48b2ce60ed 2017-08-10 18:07:47 +02:00
Christophe Simonis 9882f24313 [IMP] test_pylint: check for python3 incompatibilities 2017-08-07 15:02:56 +02:00
Yannick Tivisse ee5ebbadab [FIX] base/module: Use a correct env to load next action on install
Bug introduced in https://github.com/odoo/odoo/commit/c8601f4384e0c95abc92d1f0b3092cfe2cb2a79d

Purpose
=======

If a module installation is supposed to load an action (example: a wizard like in l10n_eu_service) and if the related action is defined in this module (example: l10n_eu_service.wizard), currently we're using the environment defined on self, which is not updated after the module install, and the key is not defined in the registry.

Specification
=============

Instead of using the environment on self, let's use the new environment created after the cursor commit.
2017-08-02 12:32:24 +02:00
Martin Trigaux ec7b08d1ff [FIX] base: check description content
Some may say that fe346fa0 made the test fail but this is an illusion
2017-06-30 15:25:44 +02:00
Raphael Collet b8cf940247 [ADD] base: new wizard to uninstall a module (#17284)
The "Uninstall" button on the module form no longer changes the state of
modules, so that cancelling the wizard will not unexpectedly perform the
uninstallation.  The uninstallation is performed only by clicking on the
"Confirm" button on the wizard.

Moreover, the wizard provides clearer information about the impact of the
uninstallation: what apps/modules will be uninstalled and what documents
(models) will be lost.
2017-06-28 15:36:17 +02:00
Yannick Tivisse 56feb8dd16 [IMP] base: Load actions todo on button_immediate_install 2017-06-19 17:37:38 +02:00
Xavier Morel 01e3514147 [FIX] P3: urllib, urllib2 and urlparse
In Python 3, all of these were "consolidated" under urllib(.request,
.parse, .errors) which is inconvenient.

Since we already have hard dependencies on requests and
werkzeug(.urls, which is a backport of Python 3's unicode-aware
urllib.parse) migrate *everything* to that.

A sticking point is urllib2.URLError, those were (mostly) replaced by
the slightly more general IOError which URLError extends.
2017-05-15 12:26:30 +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
Laurent Smet 3425752eac [REM] odoo/report: remove deprecated stuff
- RML Reports
- Webkit Reports (most part already removed by 13b9982c62)
- LocalService in netsvc.py
- rename attributes like rml_% to report_%
- rename ir.actions.report.xml to ir.actions.report
- allow rendering directly on an ir.actions.report by calling render method
- remove 'controller' report_type
- remove unused res.font stuff
- remove print_report method in models.py (not used)
- restore removed call to pdftotext process in test_reports
2017-05-08 09:22:56 +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
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
Raphael Collet 6498f35145 [IMP] base: add individual module exclusions 2017-04-06 11:17:58 +02:00
Raphael Collet c29cac23fb [IMP] base: add boolean field 'exclusive' on module categories
When set, this flag restricts the installation of several modules
from the same category.
2017-04-06 11:17:58 +02:00
Christophe Simonis 6a942a9e96 [MERGE] forward port branch 10.0 up to 8a0151b4bc 2017-02-02 12:42:51 +01:00
Olivier Dony 8235f03f56 [FIX] module: allow disabling 1-click install
As discussed on issue #15225, it should be possible for system administrators
to disable the 1-click installation system.
The plan is to disable the feature by default, but make it relatively easy
to turn on when it is explicitly desired.

1. At the moment we cannot guarantee that all Apps published on the Odoo Apps
   Store are safe. And it is a security risk to let end-users deploy Python
   code on their Odoo servers without requiring any review/deployment by a
   competent system administrator.
   We will work on improving the validation process of the Store, but this
   will require time, and won't probably be a 100% safe process in any case.
2. The one-click install feature is however really useful to help
   non-technical users install Apps, as long as the feature has been
   explicitly allowed by the system administrator. This is a common feature
   in other software suites as well. So we'd like to keep it as an opt-in
   feature.
3. Administrators of multi-tenant servers, cloud hosting services, etc.
   understandably expect to be able to turn off the feature for
   security/control reasons.
4. By turning off the feature by default, but still exposing it in the UI,
   we keep it *discoverable* for users. The error message should be
   helpful to direct users to their sysadmins.
5. By using the permissions of the download folder as a flag for turning
   off the feature, we avoid introducing an extra server parameter.
   The folder is still created (read-only) by default, for the sole purpose
   of making it easier to locate.

Fixes #15225
2017-01-27 13:56:05 +01:00
Raphael Collet 6453e4eb23 [IMP] base: tighten ir.model.data access rights 2017-01-03 16:52:50 +01:00
Christophe Simonis dece72d010 [MERGE] forward port branch saas-12 up to ca20038 2016-11-15 13:58:55 +01:00
Christophe Simonis ae1fb33e0e [FIX] base: call correct method to get module icon 2016-10-03 13:13:11 +02:00
David Monjoie 5f1c771b53 [ADD] base: add OPL-1 module license
This allows people to create modules under the 'Odoo Proprietary
License' version 1.0 rather than having to rely on the rather vague
'Other Priorietary' license.

The text of the license can be found at:
https://www.odoo.com/loempia/static/examples/LICENSE

This should already have been in Odoo 9 but was mistakenly left out.
2016-09-23 14:12:30 +02:00
Raphael Collet 7596fa3ee3 [FIX] base: adapt imports 2016-09-02 17:28:13 +02:00
Raphael Collet 9e64f9f951 [REF] openerp: move openerp to odoo 2016-09-02 17:28:12 +02:00