summaryrefslogtreecommitdiff
path: root/addons/transifex
diff options
context:
space:
mode:
authorJulien Castiaux <juc@odoo.com>2019-09-09 16:10:13 +0000
committerJulien Castiaux <juc@odoo.com>2019-09-16 09:31:38 +0000
commit7c47eb185443af08a55b0045c6a78f74151dc083 (patch)
treeff74975923ba2da758df1df16018e6b875d5337c /addons/transifex
parent760ab74f831dcbd2c2e48c5dbfbbf46df383cba7 (diff)
[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>
Diffstat (limited to 'addons/transifex')
-rw-r--r--addons/transifex/models/ir_translation.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/transifex/models/ir_translation.py b/addons/transifex/models/ir_translation.py
index 6c9e84755d7..ed1150f8d14 100644
--- a/addons/transifex/models/ir_translation.py
+++ b/addons/transifex/models/ir_translation.py
@@ -10,8 +10,8 @@ from os.path import join as opj
import os
import werkzeug
+import odoo
from odoo import models, fields
-from odoo.modules.module import ad_paths
class IrTranslation(models.Model):
@@ -27,7 +27,7 @@ class IrTranslation(models.Model):
tx_config_file = ConfigParser()
tx_sections = []
- for addon_path in ad_paths:
+ for addon_path in odoo.addons.__path__:
tx_path = opj(addon_path, '.tx', 'config')
if os.path.isfile(tx_path):
tx_config_file.read(tx_path)