summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Dony <odo@openerp.com>2016-09-02 13:24:09 +0200
committerOlivier Dony <odo@openerp.com>2016-09-05 11:57:50 +0200
commit4339196e5231aa734a0154e2f4e88b2e54f27d48 (patch)
treea5e140610e000ced1fccea3cf24358efc6f06883
parentc0566b289608f2ebb97ece4683440a551c8db9b9 (diff)
[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
-rw-r--r--addons/l10n_cr/__openerp__.py1
-rw-r--r--addons/web/doc/addon-structure.txt2
-rw-r--r--addons/web/doc/module.rst16
-rw-r--r--addons/web/doc/module/06
-rw-r--r--addons/web/doc/module/116
-rw-r--r--addons/web/doc/module/126
-rw-r--r--addons/web/doc/module/26
-rw-r--r--addons/web/doc/module/246
-rw-r--r--addons/web/doc/module/46
-rw-r--r--addons/web/doc/module/66
-rw-r--r--doc/howtos/backend.rst8
-rw-r--r--doc/howtos/backend/exercise-access-rights6
-rw-r--r--doc/howtos/backend/exercise-basic-action6
-rw-r--r--doc/howtos/backend/exercise-creation4
-rw-r--r--doc/howtos/backend/exercise-dashboard6
-rw-r--r--doc/howtos/backend/exercise-model-inheritance6
-rw-r--r--doc/howtos/backend/exercise-report6
-rw-r--r--doc/howtos/backend/exercise-state-workflow6
-rw-r--r--doc/howtos/themes.rst16
-rw-r--r--doc/howtos/web.rst6
-rw-r--r--doc/howtos/website.rst2
-rw-r--r--doc/howtos/website/basic-acl6
-rw-r--r--doc/howtos/website/course-product6
-rw-r--r--doc/howtos/website/module-empty4
-rw-r--r--doc/howtos/website/product-dependency6
-rw-r--r--doc/howtos/website/teachers-menu6
-rw-r--r--doc/howtos/website/website-support6
-rw-r--r--doc/reference/guidelines.rst2
-rw-r--r--doc/reference/module.rst2
-rw-r--r--odoo/cli/scaffold.py3
-rw-r--r--odoo/cli/start.py9
-rw-r--r--odoo/cli/templates/default/__manifest__.py.template (renamed from odoo/cli/templates/default/__openerp__.py.template)0
-rw-r--r--odoo/cli/templates/theme/__manifest__.py.template (renamed from odoo/cli/templates/theme/__openerp__.py.template)0
-rw-r--r--odoo/http.py11
-rw-r--r--odoo/modules/module.py116
-rw-r--r--odoo/tools/config.py3
36 files changed, 159 insertions, 154 deletions
diff --git a/addons/l10n_cr/__openerp__.py b/addons/l10n_cr/__openerp__.py
index 942f1dd7fbd..e5a8e317a5d 100644
--- a/addons/l10n_cr/__openerp__.py
+++ b/addons/l10n_cr/__openerp__.py
@@ -3,7 +3,6 @@
##############################################################################
#
-# __openerp__.py
# l10n_cr_account
# First author: Carlos Vásquez <carlos.vasquez@clearcorp.co.cr> (ClearCorp S.A.)
# Copyright (c) 2010-TODAY ClearCorp S.A. (http://clearcorp.co.cr). All rights reserved.
diff --git a/addons/web/doc/addon-structure.txt b/addons/web/doc/addon-structure.txt
index 38151749651..19b38689641 100644
--- a/addons/web/doc/addon-structure.txt
+++ b/addons/web/doc/addon-structure.txt
@@ -1,5 +1,5 @@
<addon name>
- +-- __openerp__.py
+ +-- __manifest__.py
+-- controllers/
+-- static/
+-- lib/
diff --git a/addons/web/doc/module.rst b/addons/web/doc/module.rst
index 7971a919780..ffbe90d0933 100644
--- a/addons/web/doc/module.rst
+++ b/addons/web/doc/module.rst
@@ -2,12 +2,12 @@
.. queue:: module/series
-Building an OpenERP Web module
-==============================
+Building a Web module
+=====================
-There is no significant distinction between an OpenERP Web module and
-an OpenERP module, the web part is mostly additional data and code
-inside a regular OpenERP module. This allows providing more seamless
+There is no significant distinction between a Web module and
+a regular module, the web part is mostly additional data and code
+inside a regular module. This allows providing more seamless
features by integrating your module deeper into the web client.
A Basic Module
@@ -19,11 +19,11 @@ A very basic OpenERP module structure will be our starting point:
web_example
├── __init__.py
- └── __openerp__.py
+ └── __manifest__.py
.. patch::
-This is a sufficient minimal declaration of a valid OpenERP module.
+This is a sufficient minimal declaration of a valid module.
Web Declaration
---------------
@@ -36,7 +36,7 @@ module is automatically recognized as "web-enabled" if it contains a
web_example
├── __init__.py
- ├── __openerp__.py
+ ├── __manifest__.py
└── static
is the extent of it. You should also change the dependency to list
diff --git a/addons/web/doc/module/0 b/addons/web/doc/module/0
index 16762e1afd0..17b70a86197 100644
--- a/addons/web/doc/module/0
+++ b/addons/web/doc/module/0
@@ -3,12 +3,12 @@
diff --git a/__init__.py b/__init__.py
new file mode 100644
-diff --git a/__openerp__.py b/__openerp__.py
+diff --git a/__manifest__.py b/__manifest__.py
new file mode 100644
--- /dev/null
-+++ b/__openerp__.py
++++ b/__manifest__.py
@@ -0,0 +1,7 @@
-+# __openerp__.py
++# __manifest__.py
+{
+ 'name': "Web Example",
+ 'description': "Basic example of a (future) web module",
diff --git a/addons/web/doc/module/11 b/addons/web/doc/module/11
index fc4225afaa6..889ee98e801 100644
--- a/addons/web/doc/module/11
+++ b/addons/web/doc/module/11
@@ -1,8 +1,8 @@
# HG changeset patch
# Parent 3ed382d9a8fe64fbb8e2bf4045e3fcd5c74c92bc
-diff --git a/__openerp__.py b/__openerp__.py
---- a/__openerp__.py
-+++ b/__openerp__.py
+diff --git a/__manifest__.py b/__manifest__.py
+--- a/__manifest__.py
++++ b/__manifest__.py
@@ -6,4 +6,5 @@
'depends': ['web'],
'data': ['web_example.xml'],
diff --git a/addons/web/doc/module/12 b/addons/web/doc/module/12
index 9a2982e7d20..85c931c33b2 100644
--- a/addons/web/doc/module/12
+++ b/addons/web/doc/module/12
@@ -1,9 +1,9 @@
# HG changeset patch
# Parent 43f21611dacb7c2b2f3810baeeef359ad7c329f0
-diff --git a/__openerp__.py b/__openerp__.py
---- a/__openerp__.py
-+++ b/__openerp__.py
+diff --git a/__manifest__.py b/__manifest__.py
+--- a/__manifest__.py
++++ b/__manifest__.py
@@ -7,4 +7,5 @@
'data': ['web_example.xml'],
'js': ['static/src/js/first_module.js'],
diff --git a/addons/web/doc/module/2 b/addons/web/doc/module/2
index 08becf41602..7d8e9f05597 100644
--- a/addons/web/doc/module/2
+++ b/addons/web/doc/module/2
@@ -1,8 +1,8 @@
# HG changeset patch
# Parent 8a986919a3e22cd7cca51210820c09d4545dc60d
-diff --git a/__openerp__.py b/__openerp__.py
---- a/__openerp__.py
-+++ b/__openerp__.py
+diff --git a/__manifest__.py b/__manifest__.py
+--- a/__manifest__.py
++++ b/__manifest__.py
@@ -3,5 +3,5 @@
'name': "Web Example",
'description': "Basic example of a (future) web module",
diff --git a/addons/web/doc/module/24 b/addons/web/doc/module/24
index 9dcf9e18cf5..0972e856042 100644
--- a/addons/web/doc/module/24
+++ b/addons/web/doc/module/24
@@ -1,7 +1,7 @@
-Index: web_example/__openerp__.py
+Index: web_example/__manifest__.py
===================================================================
---- web_example.orig/__openerp__.py
-+++ web_example/__openerp__.py
+--- web_example.orig/__manifest__.py
++++ web_example/__manifest__.py
@@ -8,4 +8,5 @@
'js': ['static/src/js/first_module.js'],
'css': ['static/src/css/web_example.css'],
diff --git a/addons/web/doc/module/4 b/addons/web/doc/module/4
index 55535fe57da..99c073d672a 100644
--- a/addons/web/doc/module/4
+++ b/addons/web/doc/module/4
@@ -1,8 +1,8 @@
# HG changeset patch
# Parent 139dae60de67efa0017f5032f71ab774685c5507
-diff --git a/__openerp__.py b/__openerp__.py
---- a/__openerp__.py
-+++ b/__openerp__.py
+diff --git a/__manifest__.py b/__manifest__.py
+--- a/__manifest__.py
++++ b/__manifest__.py
@@ -4,4 +4,5 @@
'description': "Basic example of a (future) web module",
'category': 'Hidden',
diff --git a/addons/web/doc/module/6 b/addons/web/doc/module/6
index f2c6a8762e7..3a1232fa51c 100644
--- a/addons/web/doc/module/6
+++ b/addons/web/doc/module/6
@@ -1,9 +1,9 @@
# HG changeset patch
# Parent 0026cb80097a724db8d36371bc00da993a51a06f
-diff --git a/__openerp__.py b/__openerp__.py
---- a/__openerp__.py
-+++ b/__openerp__.py
+diff --git a/__manifest__.py b/__manifest__.py
+--- a/__manifest__.py
++++ b/__manifest__.py
@@ -4,5 +4,6 @@
'description': "Basic example of a (future) web module",
'category': 'Hidden',
diff --git a/doc/howtos/backend.rst b/doc/howtos/backend.rst
index 4904c64618d..b362624a274 100644
--- a/doc/howtos/backend.rst
+++ b/doc/howtos/backend.rst
@@ -303,7 +303,7 @@ action more easily.
#. Create ``openacademy/views/openacademy.xml`` with an action and
the menus triggering the action
- #. Add it to the ``data`` list of ``openacademy/__openerp__.py``
+ #. Add it to the ``data`` list of ``openacademy/__manifest__.py``
.. patch::
@@ -687,7 +687,7 @@ instead of a single view its ``arch`` field is composed of any number of
#. Create a file ``openacademy/partner.py`` and import it in
``__init__.py``
#. Create a file ``openacademy/views/partner.xml`` and add it to
- ``__openerp__.py``
+ ``__manifest__.py``
.. patch::
@@ -1374,7 +1374,7 @@ rights are usually created by a CSV file named after its model:
hold the OpenAcademy Manager group
#. Edit the file ``openacademy/security/ir.model.access.csv`` with
the access rights to the models
- #. Finally update ``openacademy/__openerp__.py`` to add the new data
+ #. Finally update ``openacademy/__manifest__.py`` to add the new data
files to it
.. patch::
@@ -1688,7 +1688,7 @@ Dashboards
.. note:: Available dashboard styles are ``1``, ``1-1``, ``1-2``,
``2-1`` and ``1-1-1``
- #. Update ``openacademy/__openerp__.py`` to reference the new data
+ #. Update ``openacademy/__manifest__.py`` to reference the new data
file
.. patch::
diff --git a/doc/howtos/backend/exercise-access-rights b/doc/howtos/backend/exercise-access-rights
index 552afd72bd6..e653cbadcd5 100644
--- a/doc/howtos/backend/exercise-access-rights
+++ b/doc/howtos/backend/exercise-access-rights
@@ -1,10 +1,10 @@
# HG changeset patch
# Parent 303a5f4f011822dcb42b5833d579eabd3f03f4bf
-Index: addons/openacademy/__openerp__.py
+Index: addons/openacademy/__manifest__.py
===================================================================
---- addons.orig/openacademy/__openerp__.py 2014-08-26 17:26:18.143783102 +0200
-+++ addons/openacademy/__openerp__.py 2014-08-26 17:26:18.135783102 +0200
+--- addons.orig/openacademy/__manifest__.py 2014-08-26 17:26:18.143783102 +0200
++++ addons/openacademy/__manifest__.py 2014-08-26 17:26:18.135783102 +0200
@@ -25,7 +25,8 @@
# always loaded
diff --git a/doc/howtos/backend/exercise-basic-action b/doc/howtos/backend/exercise-basic-action
index ac84e344d6a..f5e5e9be9d5 100644
--- a/doc/howtos/backend/exercise-basic-action
+++ b/doc/howtos/backend/exercise-basic-action
@@ -1,9 +1,9 @@
# HG changeset patch
# Parent 16e4cb131d9f7f3a72a8a1b0bc46c2ce9ac76435
-Index: addons/openacademy/__openerp__.py
+Index: addons/openacademy/__manifest__.py
===================================================================
---- addons.orig/openacademy/__openerp__.py 2014-08-26 17:25:53.519783468 +0200
-+++ addons/openacademy/__openerp__.py 2014-08-26 17:25:53.511783468 +0200
+--- addons.orig/openacademy/__manifest__.py 2014-08-26 17:25:53.519783468 +0200
++++ addons/openacademy/__manifest__.py 2014-08-26 17:25:53.511783468 +0200
@@ -27,6 +27,7 @@
'data': [
# 'security/ir.model.access.csv',
diff --git a/doc/howtos/backend/exercise-creation b/doc/howtos/backend/exercise-creation
index 6325efeb226..80911aa160e 100644
--- a/doc/howtos/backend/exercise-creation
+++ b/doc/howtos/backend/exercise-creation
@@ -1,9 +1,9 @@
# HG changeset patch
# Parent 0000000000000000000000000000000000000000
-Index: addons/openacademy/__openerp__.py
+Index: addons/openacademy/__manifest__.py
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ addons/openacademy/__openerp__.py 2014-08-26 17:25:49.787783523 +0200
++++ addons/openacademy/__manifest__.py 2014-08-26 17:25:49.787783523 +0200
@@ -0,0 +1,35 @@
+# -*- coding: utf-8 -*-
+{
diff --git a/doc/howtos/backend/exercise-dashboard b/doc/howtos/backend/exercise-dashboard
index bf175edc7d3..b1092479669 100644
--- a/doc/howtos/backend/exercise-dashboard
+++ b/doc/howtos/backend/exercise-dashboard
@@ -1,10 +1,10 @@
# HG changeset patch
# Parent 643813940cbea07bec792f9e1c60022a9292fa90
-Index: addons/openacademy/__openerp__.py
+Index: addons/openacademy/__manifest__.py
===================================================================
---- addons.orig/openacademy/__openerp__.py 2014-08-26 17:26:21.535783052 +0200
-+++ addons/openacademy/__openerp__.py 2014-08-26 17:26:21.531783052 +0200
+--- addons.orig/openacademy/__manifest__.py 2014-08-26 17:26:21.535783052 +0200
++++ addons/openacademy/__manifest__.py 2014-08-26 17:26:21.531783052 +0200
@@ -21,7 +21,7 @@
'version': '0.1',
diff --git a/doc/howtos/backend/exercise-model-inheritance b/doc/howtos/backend/exercise-model-inheritance
index a3529403d55..941ce0442df 100644
--- a/doc/howtos/backend/exercise-model-inheritance
+++ b/doc/howtos/backend/exercise-model-inheritance
@@ -10,10 +10,10 @@ Index: addons/openacademy/__init__.py
from . import controllers
from . import models
+from . import partner
-Index: addons/openacademy/__openerp__.py
+Index: addons/openacademy/__manifest__.py
===================================================================
---- addons.orig/openacademy/__openerp__.py 2014-08-26 17:26:01.227783353 +0200
-+++ addons/openacademy/__openerp__.py 2014-08-26 17:26:01.223783354 +0200
+--- addons.orig/openacademy/__manifest__.py 2014-08-26 17:26:01.227783353 +0200
++++ addons/openacademy/__manifest__.py 2014-08-26 17:26:01.223783354 +0200
@@ -28,6 +28,7 @@
# 'security/ir.model.access.csv',
'templates.xml',
diff --git a/doc/howtos/backend/exercise-report b/doc/howtos/backend/exercise-report
index 43055c7a8db..b06e3fbf6ee 100644
--- a/doc/howtos/backend/exercise-report
+++ b/doc/howtos/backend/exercise-report
@@ -1,10 +1,10 @@
# HG changeset patch
# Parent c140f0a861a08881d8737bca0ffb83904a2059a3
-Index: addons/openacademy/__openerp__.py
+Index: addons/openacademy/__manifest__.py
===================================================================
---- addons.orig/openacademy/__openerp__.py 2014-08-29 08:39:43.975536806 +0200
-+++ addons/openacademy/__openerp__.py 2014-08-29 08:39:52.000000000 +0200
+--- addons.orig/openacademy/__manifest__.py 2014-08-29 08:39:43.975536806 +0200
++++ addons/openacademy/__manifest__.py 2014-08-29 08:39:52.000000000 +0200
@@ -31,6 +31,7 @@
'views/openacademy.xml',
'views/partner.xml',
diff --git a/doc/howtos/backend/exercise-state-workflow b/doc/howtos/backend/exercise-state-workflow
index 062f8b46a6b..6178913d164 100644
--- a/doc/howtos/backend/exercise-state-workflow
+++ b/doc/howtos/backend/exercise-state-workflow
@@ -2,9 +2,9 @@
# Parent c72382bf0c5794135fa318f6ba59899b2277d8c5
# Parent 82f902dbb7aab4d3ddd9caaa9170536afa9d274d
-diff --git a/openacademy/__openerp__.py b/openacademy/__openerp__.py
---- a/openacademy/__openerp__.py
-+++ b/openacademy/__openerp__.py
+diff --git a/openacademy/__manifest__.py b/openacademy/__manifest__.py
+--- a/openacademy/__manifest__.py
++++ b/openacademy/__manifest__.py
@@ -29,6 +29,7 @@
'templates.xml',
'views/openacademy.xml',
diff --git a/doc/howtos/themes.rst b/doc/howtos/themes.rst
index cce149a847f..a3a3b18212f 100644
--- a/doc/howtos/themes.rst
+++ b/doc/howtos/themes.rst
@@ -205,9 +205,9 @@ Odoo’s themes are packaged like modules. Even if you are designing a very simp
Create a folder and name it like this: ``theme_`` followed by your
theme's name.
-``__openerp__.py``
+``__manifest__.py``
Create an empty document and save it to your folder as
- ``__openerp__.py``. This will contain the configuration info for
+ ``__manifest__.py``. This will contain the configuration info for
your theme.
``__init__.py``
@@ -229,10 +229,10 @@ The final result should be something like this:
.. image:: theme_tutorial_assets/img/folder.jpg
-Edit ``__openerp__.py``
+Edit ``__manifest__.py``
-----------------------
-Open the ``__openerp__.py`` you created and copy/paste the following:
+Open the ``__manifest__.py`` you created and copy/paste the following:
.. code-block:: python
@@ -349,7 +349,7 @@ target css rules to that element and avoid these affecting other content on the
The second xpath will add a welcome message just after the navigation menu.
The last step is to add layout.xml to the list of xml files used by
-the theme. To do that, edit your ``__openerp__.py`` file like this
+the theme. To do that, edit your ``__manifest__.py`` file like this
.. code-block:: python
@@ -457,7 +457,7 @@ can fill with snippets. To achieve this, just create a ``div`` with
You can create as many snippet areas as you like and place them anywhere in your pages.
-Our page is almost ready. Now all we have to do is add **pages.xml** in our **__openerp__.py** file
+Our page is almost ready. Now all we have to do is add **pages.xml** in our **__manifest__.py** file
.. code-block:: python
@@ -560,7 +560,7 @@ assets*".
Placing it after the last one, we ensure that our file will
be loaded at the end and take priority.
-Finally add **assets.xml** in your **__openerp__.py** file.
+Finally add **assets.xml** in your **__manifest__.py** file.
Update your theme
@@ -717,7 +717,7 @@ the attribute will automatically be applied to the element.
Since ``select_class`` method avoids multiple selections, the last "empty"
option will reset the snippet to default.
-Add **options.xml** to ``__openerp__.py`` and update your theme.
+Add **options.xml** to ``__manifest__.py`` and update your theme.
.. image:: theme_tutorial_assets/img/restart.png
diff --git a/doc/howtos/web.rst b/doc/howtos/web.rst
index d58091e964e..9c99b02d2ce 100644
--- a/doc/howtos/web.rst
+++ b/doc/howtos/web.rst
@@ -55,7 +55,7 @@ If you browse the ``petstore`` folder, you should see the following content:
| `-- mice.jpg
|-- __init__.py
|-- oepetstore.message_of_the_day.csv
- |-- __openerp__.py
+ |-- __manifest__.py
|-- petstore_data.xml
|-- petstore.py
|-- petstore.xml
@@ -103,7 +103,7 @@ sub-folders are conventional and not strictly necessary.
Which only prints a small message in the browser's console.
-The files in the ``static`` folder, need to be defined within the module in order for them to be loaded correctly. Everything in ``src/xml`` is defined in ``__openerp__.py`` while the contents of ``src/css`` and ``src/js`` are defined in ``petstore.xml``, or a similar file.
+The files in the ``static`` folder, need to be defined within the module in order for them to be loaded correctly. Everything in ``src/xml`` is defined in ``__manifest__.py`` while the contents of ``src/css`` and ``src/js`` are defined in ``petstore.xml``, or a similar file.
.. warning::
@@ -127,7 +127,7 @@ The files in the ``static`` folder, need to be defined within the module in orde
This will reload the web client with optimizations disabled, making
development and debugging significantly more comfortable.
-.. todo:: qweb files hooked via __openerp__.py, but js and CSS use bundles
+.. todo:: qweb files hooked via __manifest__.py, but js and CSS use bundles
Odoo JavaScript Module
======================
diff --git a/doc/howtos/website.rst b/doc/howtos/website.rst
index 00391df0929..43c3a9a998a 100644
--- a/doc/howtos/website.rst
+++ b/doc/howtos/website.rst
@@ -88,7 +88,7 @@ own :ref:`QWeb <reference/qweb>` templating system which integrates with other
features.
Create a template and ensure the template file is registered in the
-``__openerp__.py`` manifest, and alter the controller to use our template:
+``__manifest__.py`` manifest, and alter the controller to use our template:
.. patch::
diff --git a/doc/howtos/website/basic-acl b/doc/howtos/website/basic-acl
index fa2483909e2..c31576ce159 100644
--- a/doc/howtos/website/basic-acl
+++ b/doc/howtos/website/basic-acl
@@ -2,9 +2,9 @@
# Parent 91c0cc5b319e7bf240d359817b8bd044769a4f5c
# Parent 0a9ec16d98785205f25868bc23485569a1444cf3
-diff --git a/academy/__openerp__.py b/academy/__openerp__.py
---- a/academy/__openerp__.py
-+++ b/academy/__openerp__.py
+diff --git a/academy/__manifest__.py b/academy/__manifest__.py
+--- a/academy/__manifest__.py
++++ b/academy/__manifest__.py
@@ -24,7 +24,7 @@
# always loaded
diff --git a/doc/howtos/website/course-product b/doc/howtos/website/course-product
index ce433605baf..b6f9bfedff7 100644
--- a/doc/howtos/website/course-product
+++ b/doc/howtos/website/course-product
@@ -2,9 +2,9 @@
# Parent 2ee7212e5de4702dff08d9b5e4268e7dc261d038
# Parent 4ca7b848bb60c3573de7ed41a28b4b65186a5725
-diff --git a/academy/__openerp__.py b/academy/__openerp__.py
---- a/academy/__openerp__.py
-+++ b/academy/__openerp__.py
+diff --git a/academy/__manifest__.py b/academy/__manifest__.py
+--- a/academy/__manifest__.py
++++ b/academy/__manifest__.py
@@ -27,6 +27,7 @@
'security/ir.model.access.csv',
'templates.xml',
diff --git a/doc/howtos/website/module-empty b/doc/howtos/website/module-empty
index 744dc7c9ab5..8a144e05d09 100644
--- a/doc/howtos/website/module-empty
+++ b/doc/howtos/website/module-empty
@@ -10,10 +10,10 @@ new file mode 100644
+# -*- coding: utf-8 -*-
+import controllers
+import models
-diff --git a/academy/__openerp__.py b/academy/__openerp__.py
+diff --git a/academy/__manifest__.py b/academy/__manifest__.py
new file mode 100644
--- /dev/null
-+++ b/academy/__openerp__.py
++++ b/academy/__manifest__.py
@@ -0,0 +1,34 @@
+# -*- coding: utf-8 -*-
+{
diff --git a/doc/howtos/website/product-dependency b/doc/howtos/website/product-dependency
index 1998b876984..e835628a16d 100644
--- a/doc/howtos/website/product-dependency
+++ b/doc/howtos/website/product-dependency
@@ -2,9 +2,9 @@
# Parent 6106208621f01d5aea67727f09adf5c5b2a38642
# Parent ae97cfb61fd0e1a47727a9d8ed4a702116254eff
-diff --git a/academy/__openerp__.py b/academy/__openerp__.py
---- a/academy/__openerp__.py
-+++ b/academy/__openerp__.py
+diff --git a/academy/__manifest__.py b/academy/__manifest__.py
+--- a/academy/__manifest__.py
++++ b/academy/__manifest__.py
@@ -20,7 +20,7 @@
'version': '0.1',
diff --git a/doc/howtos/website/teachers-menu b/doc/howtos/website/teachers-menu
index da659bde1ba..27fd53b09aa 100644
--- a/doc/howtos/website/teachers-menu
+++ b/doc/howtos/website/teachers-menu
@@ -2,9 +2,9 @@
# Parent c8cc9e66a2701dad6589ff1d950e1cb7738d0854
# Parent 44a09b8865d418cda8b7c46dfb70fadc86e22184
-diff --git a/academy/__openerp__.py b/academy/__openerp__.py
---- a/academy/__openerp__.py
-+++ b/academy/__openerp__.py
+diff --git a/academy/__manifest__.py b/academy/__manifest__.py
+--- a/academy/__manifest__.py
++++ b/academy/__manifest__.py
@@ -26,6 +26,7 @@
'data': [
'security/ir.model.access.csv',
diff --git a/doc/howtos/website/website-support b/doc/howtos/website/website-support
index 33b401c0144..c3deb4f6896 100644
--- a/doc/howtos/website/website-support
+++ b/doc/howtos/website/website-support
@@ -2,9 +2,9 @@
# Parent 7ae0db4c2ddf5d0f7f58db2af8976fcec905cc4e
# Parent 06f959831b14dd5d2e0a57d3e14bf919e18f8e3a
-diff --git a/academy/__openerp__.py b/academy/__openerp__.py
---- a/academy/__openerp__.py
-+++ b/academy/__openerp__.py
+diff --git a/academy/__manifest__.py b/academy/__manifest__.py
+--- a/academy/__manifest__.py
++++ b/academy/__manifest__.py
@@ -20,7 +20,7 @@
'version': '0.1',
diff --git a/doc/reference/guidelines.rst b/doc/reference/guidelines.rst
index 5ae52963b42..8a1831c469d 100644
--- a/doc/reference/guidelines.rst
+++ b/doc/reference/guidelines.rst
@@ -95,7 +95,7 @@ The complete tree should look like
addons/<my_module_name>/
|-- __init__.py
- |-- __openerp__.py
+ |-- __manifest__.py
|-- controllers/
| |-- __init__.py
| |-- <inherited_module_name>.py
diff --git a/doc/reference/module.rst b/doc/reference/module.rst
index d4ce37a1862..010e10e2095 100644
--- a/doc/reference/module.rst
+++ b/doc/reference/module.rst
@@ -14,7 +14,7 @@ Manifest
The manifest file serves to declare a python package as an Odoo module
and to specify module metadata.
-It is a file called ``__openerp__.py`` and contains a single Python
+It is a file called ``__manifest__.py`` and contains a single Python
dictionary, where each key specifies module metadatum.
::
diff --git a/odoo/cli/scaffold.py b/odoo/cli/scaffold.py
index bc5321a3b75..83c2befe96c 100644
--- a/odoo/cli/scaffold.py
+++ b/odoo/cli/scaffold.py
@@ -9,9 +9,6 @@ import jinja2
from . import Command
-from odoo.modules.module import (get_module_root, MANIFEST, load_information_from_description_file as load_manifest)
-
-
class Scaffold(Command):
""" Generates an Odoo module skeleton. """
diff --git a/odoo/cli/start.py b/odoo/cli/start.py
index 69058224117..043c411ad8d 100644
--- a/odoo/cli/start.py
+++ b/odoo/cli/start.py
@@ -2,12 +2,13 @@
# -*- coding: utf-8 -*-
import argparse
import glob
+import itertools
import os
import sys
from . import Command
from .server import main
-from odoo.modules.module import get_module_root, MANIFEST
+from odoo.modules.module import get_module_root, MANIFEST_NAMES
from odoo.service.db import _create_empty_database, DatabaseExists
@@ -15,10 +16,12 @@ class Start(Command):
"""Quick start the Odoo server for your project"""
def get_module_list(self, path):
- mods = glob.glob(os.path.join(path, '*/%s' % MANIFEST))
+ mods = itertools.chain.from_iterable(
+ glob.glob(os.path.join(path, '*/%s' % mname))
+ for mname in MANIFEST_NAMES
+ )
return [mod.split(os.path.sep)[-2] for mod in mods]
-
def run(self, cmdargs):
parser = argparse.ArgumentParser(
prog="%s start" % sys.argv[0].split(os.path.sep)[-1],
diff --git a/odoo/cli/templates/default/__openerp__.py.template b/odoo/cli/templates/default/__manifest__.py.template
index 97b8372007c..97b8372007c 100644
--- a/odoo/cli/templates/default/__openerp__.py.template
+++ b/odoo/cli/templates/default/__manifest__.py.template
diff --git a/odoo/cli/templates/theme/__openerp__.py.template b/odoo/cli/templates/theme/__manifest__.py.template
index f6d99c2be45..f6d99c2be45 100644
--- a/odoo/cli/templates/theme/__openerp__.py.template
+++ b/odoo/cli/templates/theme/__manifest__.py.template
diff --git a/odoo/http.py b/odoo/http.py
index 5fd3c727a2f..1a78a9250bb 100644
--- a/odoo/http.py
+++ b/odoo/http.py
@@ -23,6 +23,7 @@ import traceback
import urllib2
import urlparse
import warnings
+from os.path import join as opj
from zlib import adler32
import babel.core
@@ -49,6 +50,8 @@ from odoo.service import security, model as service_model
from odoo.tools.func import lazy_property
from odoo.tools import ustr, consteq, frozendict
+from odoo.modules.module import module_manifest
+
_logger = logging.getLogger(__name__)
rpc_request = logging.getLogger(__name__ + '.rpc.request')
rpc_response = logging.getLogger(__name__ + '.rpc.response')
@@ -1307,13 +1310,13 @@ class Root(object):
controllers and configure them. """
# TODO should we move this to ir.http so that only configured modules are served ?
statics = {}
-
for addons_path in odoo.modules.module.ad_paths:
for module in sorted(os.listdir(str(addons_path))):
if module not in addons_module:
- manifest_path = os.path.join(addons_path, module, '__openerp__.py')
- path_static = os.path.join(addons_path, module, 'static')
- if os.path.isfile(manifest_path) and os.path.isdir(path_static):
+ mod_path = opj(addons_path, module)
+ manifest_path = module_manifest(mod_path)
+ path_static = opj(addons_path, module, 'static')
+ if manifest_path and os.path.isdir(path_static):
manifest = ast.literal_eval(open(manifest_path).read())
if not manifest.get('installable', True):
continue
diff --git a/odoo/modules/module.py b/odoo/modules/module.py
index 01a830843b4..66cbae460f0 100644
--- a/odoo/modules/module.py
+++ b/odoo/modules/module.py
@@ -24,7 +24,7 @@ import odoo.tools as tools
import odoo.release as release
from odoo import SUPERUSER_ID, api
-MANIFEST = '__openerp__.py'
+MANIFEST_NAMES = ('__manifest__.py', '__openerp__.py')
README = ['README.rst', 'README.md', 'README.txt']
_logger = logging.getLogger(__name__)
@@ -253,6 +253,14 @@ def get_module_icon(module):
return ('/' + module + '/') + '/'.join(iconpath)
return '/base/' + '/'.join(iconpath)
+def module_manifest(path):
+ """Returns path to module manifest if one can be found under `path`, else `None`."""
+ if not path:
+ return None
+ for manifest_name in MANIFEST_NAMES:
+ if os.path.isfile(opj(path, manifest_name)):
+ return opj(path, manifest_name)
+
def get_module_root(path):
"""
Get closest module's root begining from path
@@ -273,8 +281,8 @@ def get_module_root(path):
@return: Module root path or None if not found
"""
- while not os.path.exists(os.path.join(path, MANIFEST)):
- new_path = os.path.abspath(os.path.join(path, os.pardir))
+ while not module_manifest(path):
+ new_path = os.path.abspath(opj(path, os.pardir))
if path == new_path:
return None
path = new_path
@@ -285,58 +293,53 @@ def load_information_from_description_file(module, mod_path=None):
:param module: The name of the module (sale, purchase, ...)
:param mod_path: Physical path of module, if not providedThe name of the module (sale, purchase, ...)
"""
-
if not mod_path:
mod_path = get_module_path(module)
- terp_file = mod_path and opj(mod_path, MANIFEST) or False
- if terp_file:
- info = {}
- if os.path.isfile(terp_file):
- # default values for descriptor
- info = {
- 'application': False,
- 'author': 'Odoo S.A.',
- 'auto_install': False,
- 'category': 'Uncategorized',
- 'depends': [],
- 'description': '',
- 'icon': get_module_icon(module),
- 'installable': True,
- 'license': 'LGPL-3',
- 'post_load': None,
- 'version': '1.0',
- 'web': False,
- 'website': 'https://www.odoo.com',
- 'sequence': 100,
- 'summary': '',
- }
- info.update(itertools.izip(
- 'depends data demo test init_xml update_xml demo_xml'.split(),
- iter(list, None)))
-
- f = tools.file_open(terp_file)
- try:
- info.update(ast.literal_eval(f.read()))
- finally:
- f.close()
-
- if not info.get('description'):
- readme_path = [opj(mod_path, x) for x in README
- if os.path.isfile(opj(mod_path, x))]
- if readme_path:
- readme_text = tools.file_open(readme_path[0]).read()
- info['description'] = readme_text
-
- if 'active' in info:
- # 'active' has been renamed 'auto_install'
- info['auto_install'] = info['active']
-
- info['version'] = adapt_version(info['version'])
- return info
-
- #TODO: refactor the logger in this file to follow the logging guidelines
- # for 6.0
- _logger.debug('module %s: no %s file found.', module, MANIFEST)
+ manifest_file = module_manifest(mod_path)
+ if manifest_file:
+ # default values for descriptor
+ info = {
+ 'application': False,
+ 'author': 'Odoo S.A.',
+ 'auto_install': False,
+ 'category': 'Uncategorized',
+ 'depends': [],
+ 'description': '',
+ 'icon': get_module_icon(module),
+ 'installable': True,
+ 'license': 'LGPL-3',
+ 'post_load': None,
+ 'version': '1.0',
+ 'web': False,
+ 'website': 'https://www.odoo.com',
+ 'sequence': 100,
+ 'summary': '',
+ }
+ info.update(itertools.izip(
+ 'depends data demo test init_xml update_xml demo_xml'.split(),
+ iter(list, None)))
+
+ f = tools.file_open(manifest_file)
+ try:
+ info.update(ast.literal_eval(f.read()))
+ finally:
+ f.close()
+
+ if not info.get('description'):
+ readme_path = [opj(mod_path, x) for x in README
+ if os.path.isfile(opj(mod_path, x))]
+ if readme_path:
+ readme_text = tools.file_open(readme_path[0]).read()
+ info['description'] = readme_text
+
+ if 'active' in info:
+ # 'active' has been renamed 'auto_install'
+ info['auto_install'] = info['active']
+
+ info['version'] = adapt_version(info['version'])
+ return info
+
+ _logger.debug('module %s: no manifest file found %s', module, MANIFEST_NAMES)
return {}
def load_openerp_module(module_name):
@@ -353,7 +356,6 @@ def load_openerp_module(module_name):
initialize_sys_path()
try:
- mod_path = get_module_path(module_name)
__import__('odoo.addons.' + module_name)
# Call the module's post-load hook. This can done before any model or
@@ -382,9 +384,9 @@ def get_modules():
return name
def is_really_module(name):
- manifest_name = opj(dir, name, MANIFEST)
- zipfile_name = opj(dir, name)
- return os.path.isfile(manifest_name)
+ for mname in MANIFEST_NAMES:
+ if os.path.isfile(opj(dir, name, mname)):
+ return True
return map(clean, filter(is_really_module, os.listdir(dir)))
plist = []
diff --git a/odoo/tools/config.py b/odoo/tools/config.py
index 7c81652b68f..a4cbd9a0439 100644
--- a/odoo/tools/config.py
+++ b/odoo/tools/config.py
@@ -458,12 +458,13 @@ class configmanager(object):
odoo.conf.server_wide_modules = ['web','web_kanban']
def _is_addons_path(self, path):
+ from odoo.modules.module import MANIFEST_NAMES
for f in os.listdir(path):
modpath = os.path.join(path, f)
if os.path.isdir(modpath):
def hasfile(filename):
return os.path.isfile(os.path.join(modpath, filename))
- if hasfile('__init__.py') and (hasfile('__openerp__.py') or hasfile('__terp__.py')):
+ if hasfile('__init__.py') and any(hasfile(mname) for mname in MANIFEST_NAMES):
return True
return False