diff --git a/addons/l10n_cr/__openerp__.py b/addons/l10n_cr/__openerp__.py index 942f1dd7fbd824c909fe17f5c1387c69f08d55c6..e5a8e317a5d21d62dde5a137d64fdcf6d9465c55 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 3815174965178f04168d729f57d66f5abfedcdaa..19b38689641fac01c6f48374d12abf5f01856a02 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 7971a9197809517c72405906d2ed44da6127dafb..ffbe90d09337e67eb1cab922dffc9d8f6ef7a913 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 16762e1afd0591ba982665f6969215caa585ab9b..17b70a861976f18399f9afa5e02d5bb593b973b8 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 fc4225afaa653ef9c316b524e2fe808a305e3bef..889ee98e801373e8e07b5e98f1818f0dd5838583 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 9a2982e7d200b7f074ea95b5a8b4745b2b497bd1..85c931c33b2847a71cea3bf0ba515c38df166965 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 08becf416025730ecce7b0b6dd7808b29b609079..7d8e9f055970145fd2567900a79aecc65277e4aa 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 9dcf9e18cf5b63977ec3775291e106a2e3893433..0972e85604213e40a018291b1f80ecfbdde24bf8 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 55535fe57da15b2443419f7afbfe4159f79ff8e6..99c073d672ab7412988c8a2041b5db455bd7ddb2 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 f2c6a8762e7c93dd0f3a59c39e80bd93b5bd2b55..3a1232fa51c2c4a783ca92baff44c810bee0a63d 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 4904c64618d82f858c52103276f126fd2222117a..b362624a27419ddb5d23c27c0f5435d846df008c 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 552afd72bd6aed2b6c2db26747f58ab0d5056163..e653cbadcd5c62892474a7e3b427ed94088af6ff 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 ac84e344d6a57900477b5d7e80c72640e0c76660..f5e5e9be9d53933374ed86a9ee18d42fc1097147 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 6325efeb2265267d95a1260abd8b9724190e2e48..80911aa160eb273bb256e8e5e2dc8557793c63cf 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 bf175edc7d381f327a0348e4045abd3dbced8801..b10924796692cac04fd4d1f1f83432c8ef57b6cb 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 a3529403d55e701f2a2511157d36aaff27022439..941ce0442df989dd0ebb427d1d9ff027f5798b36 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 43055c7a8dbad2e4b76279f5a3ccf519e09ec923..b06e3fbf6eeba3240e83c8c33ff9104fa28cf194 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 062f8b46a6b31d27db6acb89c3d543b3f3814317..6178913d164f002cfa0e526358366ed046e7b784 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 cce149a847f20d711291af14a3772b7242715e75..a3a3b18212fe8c4433a56b5d49549dd90d97dc25 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 d58091e964e60f9b2e68122c34678af995176323..9c99b02d2ce0fa4906befe903f3a61a9ce45ae98 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 00391df0929e65f0a5c29f33c66a60de0f8f78ac..43c3a9a998a695f996f7063272d33ae97d1f3972 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 fa2483909e2c366f3fcd7f087302f2bfda47328a..c31576ce1592ccca2607bf69ac3f75ca86e470d6 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 ce433605bafc0a9ba07f299468175cd44ad749e2..b6f9bfedff7a8140c003096f45f431b7717e7aaa 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 744dc7c9ab53bb15c6a68ac327d7326c3c5c0e26..8a144e05d0988b2272ac57c72205f7c5762eefeb 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 1998b8769848424e6de146939559929930bb7763..e835628a16d5ab9fb66ab85c8ef6df6f337778d0 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 da659bde1babd6f5b30a18e61a01a1e31d6daadd..27fd53b09aaac6041525b5d42685ea0e8d9b01b8 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 33b401c014485a6a6c6ae1e470c616f17f1d28b4..c3deb4f6896c2c7119e28b5dc51006816f899d6c 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 5ae52963b42f23b51ce392ee64f8a62857e25202..8a1831c469db03231a1a38f4903c39180aed8340 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 d4ce37a1862452b52f8e529cb87edb004ae53f3d..010e10e20956a00fa622f626a62907446c1be716 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 bc5321a3b751e9b8b3d550472db2501152093961..83c2befe96c3bf77760fc5157473296fc2cab8a4 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 690582241170b81bb3acf45d1288e4a4451f295a..043c411ad8de2a4b523963915597870e16350261 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 similarity index 100% rename from odoo/cli/templates/default/__openerp__.py.template rename to 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 similarity index 100% rename from odoo/cli/templates/theme/__openerp__.py.template rename to odoo/cli/templates/theme/__manifest__.py.template diff --git a/odoo/http.py b/odoo/http.py index 5fd3c727a2f86ca2e0e23f24c4d61ff0303d3f02..1a78a9250bbc1e9ae4d13ffdadc03dc458e05c47 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 01a830843b453b095a02b26e3e9718a8181cb0e9..66cbae460f0121129fe20fc6004bb20daf92fd42 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 7c81652b68f835419e7149bcc1799b55ea732f6d..a4cbd9a043980b0aea2d0fed29315d2bf322a81d 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