Skip to content

Commit

Permalink
[IMP] support v10 manifest file naming convention
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
odony committed Sep 5, 2016
1 parent c0566b2 commit 4339196
Show file tree
Hide file tree
Showing 36 changed files with 159 additions and 154 deletions.
1 change: 0 additions & 1 deletion addons/l10n_cr/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion addons/web/doc/addon-structure.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<addon name>
+-- __openerp__.py
+-- __manifest__.py
+-- controllers/
+-- static/
+-- lib/
Expand Down
16 changes: 8 additions & 8 deletions addons/web/doc/module.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
---------------
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions addons/web/doc/module/0
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 3 additions & 3 deletions addons/web/doc/module/11
Original file line number Diff line number Diff line change
@@ -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'],
Expand Down
6 changes: 3 additions & 3 deletions addons/web/doc/module/12
Original file line number Diff line number Diff line change
@@ -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'],
Expand Down
6 changes: 3 additions & 3 deletions addons/web/doc/module/2
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
6 changes: 3 additions & 3 deletions addons/web/doc/module/24
Original file line number Diff line number Diff line change
@@ -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'],
Expand Down
6 changes: 3 additions & 3 deletions addons/web/doc/module/4
Original file line number Diff line number Diff line change
@@ -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',
Expand Down
6 changes: 3 additions & 3 deletions addons/web/doc/module/6
Original file line number Diff line number Diff line change
@@ -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',
Expand Down
8 changes: 4 additions & 4 deletions doc/howtos/backend.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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::

Expand Down Expand Up @@ -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::

Expand Down Expand Up @@ -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::
Expand Down Expand Up @@ -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::
Expand Down
6 changes: 3 additions & 3 deletions doc/howtos/backend/exercise-access-rights
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 3 additions & 3 deletions doc/howtos/backend/exercise-basic-action
Original file line number Diff line number Diff line change
@@ -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',
Expand Down
4 changes: 2 additions & 2 deletions doc/howtos/backend/exercise-creation
Original file line number Diff line number Diff line change
@@ -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 -*-
+{
Expand Down
6 changes: 3 additions & 3 deletions doc/howtos/backend/exercise-dashboard
Original file line number Diff line number Diff line change
@@ -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',

Expand Down
6 changes: 3 additions & 3 deletions doc/howtos/backend/exercise-model-inheritance
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
6 changes: 3 additions & 3 deletions doc/howtos/backend/exercise-report
Original file line number Diff line number Diff line change
@@ -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',
Expand Down
6 changes: 3 additions & 3 deletions doc/howtos/backend/exercise-state-workflow
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
16 changes: 8 additions & 8 deletions doc/howtos/themes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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``
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions doc/howtos/web.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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::

Expand All @@ -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
======================
Expand Down
2 changes: 1 addition & 1 deletion doc/howtos/website.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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::

Expand Down
6 changes: 3 additions & 3 deletions doc/howtos/website/basic-acl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions doc/howtos/website/course-product
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Loading

0 comments on commit 4339196

Please sign in to comment.