diff options
| author | Christophe Simonis <chs@odoo.com> | 2015-01-19 17:15:56 +0100 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2015-01-19 17:15:56 +0100 |
| commit | 18e22be138f4d273ce8f63c0ff2c8a437cf6ce5d (patch) | |
| tree | 63bd658de7b6fa0e91d521ca19322dd68bdc1492 /doc/howtos | |
| parent | f6e5bf847b1a7107c09b009a757823b0f9514fa4 (diff) | |
| parent | 0aab81cd3ac6881b2b64ccedb901b55badd421d4 (diff) | |
[MERGE] forward port of branch 8.0 up to 0aab81c
Diffstat (limited to 'doc/howtos')
| -rw-r--r-- | doc/howtos/backend.rst | 40 | ||||
| -rw-r--r-- | doc/howtos/backend/exercise-creation | 4 | ||||
| -rw-r--r-- | doc/howtos/backend/exercise-dashboard | 3 | ||||
| -rw-r--r-- | doc/howtos/backend/exercise-model-inheritance | 6 | ||||
| -rw-r--r-- | doc/howtos/backend/exercise-wizard | 8 | ||||
| -rw-r--r-- | doc/howtos/themes.rst | 67 |
6 files changed, 59 insertions, 69 deletions
diff --git a/doc/howtos/backend.rst b/doc/howtos/backend.rst index fcbc10e3721..0ac7ab8060d 100644 --- a/doc/howtos/backend.rst +++ b/doc/howtos/backend.rst @@ -74,31 +74,9 @@ option. most command-line options can also be set using :ref:`a configuration file <reference/cmdline/config>` -An Odoo module is declared by its :ref:`manifest <reference/module/manifest>`. It -is mandatory and contains a single python dictionary declaring various -metadata for the module: the module's name and description, list of Odoo -modules required for this one to work properly, references to data files, … - -The manifest's general structure is:: - - { - 'name': "MyModule", - 'version': '1.0', - 'depends': ['base'], - 'author': "Author Name", - 'category': 'Category', - 'description': """ - Description text - """, - # data files always loaded at installation - 'data': [ - 'mymodule_view.xml', - ], - # data files containing optionally loaded demonstration data - 'demo': [ - 'demo_data.xml', - ], - } +An Odoo module is declared by its :ref:`manifest <reference/module/manifest>`. +See the :ref:`manifest documentation <reference/module/manifest>` information +about it. A module is also a `Python package <http://docs.python.org/2/tutorial/modules.html#packages>`_ @@ -108,15 +86,15 @@ files in the module. For instance, if the module has a single ``mymodule.py`` file ``__init__.py`` might contain:: - import mymodule + from . import mymodule -Fortunately, there is a mechanism to help you set up an module. The command -``odoo.py`` has a subcommand :ref:`scaffold <reference/cmdline/scaffold>` to -create an empty module: +Odoo provides a mechanism to help set up a new module, :ref:`odoo.py +<reference/cmdline/server>` has a subcommand :ref:`scaffold +<reference/cmdline/scaffold>` to create an empty module: -.. code:: bash +.. code-block:: console - odoo.py scaffold <module name> <where to put it> + $ odoo.py scaffold <module name> <where to put it> The command creates a subdirectory for your module, and automatically creates a bunch of standard files for a module. Most of them simply contain commented code diff --git a/doc/howtos/backend/exercise-creation b/doc/howtos/backend/exercise-creation index 4b780bddbb7..353556a43b5 100644 --- a/doc/howtos/backend/exercise-creation +++ b/doc/howtos/backend/exercise-creation @@ -46,8 +46,8 @@ Index: addons/openacademy/__init__.py +++ addons/openacademy/__init__.py 2014-08-26 17:25:49.791783523 +0200 @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- -+import controllers -+import models ++from . import controllers ++from . import models Index: addons/openacademy/controllers.py =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 diff --git a/doc/howtos/backend/exercise-dashboard b/doc/howtos/backend/exercise-dashboard index 4e3e563f450..bf175edc7d3 100644 --- a/doc/howtos/backend/exercise-dashboard +++ b/doc/howtos/backend/exercise-dashboard @@ -54,6 +54,7 @@ Index: addons/openacademy/views/session_board.xml + <record model="ir.ui.view" id="board_session_form"> + <field name="name">Session Dashboard Form</field> + <field name="model">board.board</field> ++ <field name="type">form</field> + <field name="arch" type="xml"> + <form string="Session Dashboard"> + <board style="2-1"> @@ -89,6 +90,6 @@ Index: addons/openacademy/views/session_board.xml + name="Session Dashboard" parent="base.menu_reporting_dashboard" + action="open_board_session" + sequence="1" -+ id="menu_board_session"/> ++ id="menu_board_session" icon="terp-graph"/> + </data> +</openerp> diff --git a/doc/howtos/backend/exercise-model-inheritance b/doc/howtos/backend/exercise-model-inheritance index ddc84ea6886..a3529403d55 100644 --- a/doc/howtos/backend/exercise-model-inheritance +++ b/doc/howtos/backend/exercise-model-inheritance @@ -7,9 +7,9 @@ Index: addons/openacademy/__init__.py +++ addons/openacademy/__init__.py 2014-08-26 17:26:01.219783354 +0200 @@ -1,3 +1,4 @@ # -*- coding: utf-8 -*- - import controllers - import models -+import partner + from . import controllers + from . import models ++from . import partner Index: addons/openacademy/__openerp__.py =================================================================== --- addons.orig/openacademy/__openerp__.py 2014-08-26 17:26:01.227783353 +0200 diff --git a/doc/howtos/backend/exercise-wizard b/doc/howtos/backend/exercise-wizard index 1605185bf05..906cdef181b 100644 --- a/doc/howtos/backend/exercise-wizard +++ b/doc/howtos/backend/exercise-wizard @@ -3,10 +3,10 @@ Index: addons/openacademy/__init__.py --- addons.orig/openacademy/__init__.py 2014-08-27 14:19:23.023111330 +0200 +++ addons/openacademy/__init__.py 2014-08-27 14:22:25.043108628 +0200 @@ -2,3 +2,4 @@ - import controllers - import models - import partner -+import wizard + from . import controllers + from . import models + from . import partner ++from . import wizard Index: addons/openacademy/wizard.py =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 diff --git a/doc/howtos/themes.rst b/doc/howtos/themes.rst index 2c6eef2d405..dbc59f6392d 100644 --- a/doc/howtos/themes.rst +++ b/doc/howtos/themes.rst @@ -30,7 +30,7 @@ with the structure: |-- pages.xml `-- snippets.xml -``static/styles`` contains your stylesheet(s), ``views`` contains the various +``static/style`` contains your stylesheet(s), ``views`` contains the various XML files describing the theme and theme features to Odoo. Static Page @@ -51,7 +51,12 @@ copy paste the lines:: </t> </template> -Refresh the page and feel the hit. +Comment the lines about ``options.xml`` and ``pages.xml`` in ``__openerp__.py``. + +Run the server and update the theme (``./odoo.py -u dummy_theme``), then +install the theme in the settings menu. + +Go to ``http://localhost:8069/page/hello`` feel the hit. Editing content on a page ''''''''''''''''''''''''' @@ -104,14 +109,25 @@ modify these lines as below: .. code-block:: css - .h1 { + h1 { color: #215487; } - .span { + span { border: 2px solid black; background-color: #eee; } +Compile your file (http://lesscss.org/usage/#command-line-usage) to get the +``custom.css`` file. + +Add this asset to your template in ``page.xml``:: + + <template id="dummy_theme_asset" name="website assete for Dummy theme" inherit_id="website.theme"> + <xpath expr="." position="inside"> + <link rel="stylesheet" href="/dummy_theme/static/style/custom.css"/> + </xpath> + </template> + Refresh the page and feel the hit. Get the most of the dom @@ -267,9 +283,9 @@ Adding images to your snippet You can easely add images in your snippets simply by setting up css backgrounds images. -In ``odoo/addons/theme_dummy/static/`` create a new folder and name it -``img``. Put your images there, in sub-folders if needed. Open -:file:`odoo/addons/theme_dummy/static/style/custom.less`, add these lines +Put your images in ``odoo/addons/theme_dummy/static/img``, or in sub-folders +if needed. Open :file:`odoo/addons/theme_dummy/static/style/custom.less`, add +these lines .. code-block:: css @@ -279,28 +295,20 @@ In ``odoo/addons/theme_dummy/static/`` create a new folder and name it @img-02: url("../img/img-girl.png"); .dummy-girl { background-image: @img-02; } +Add also the ``width`` and the ``height`` css attributes to theses new classes. + In :file:`odoo/addons/theme_dummy/views/pages.xml` change the correspondant lines as below:: - <section> - <div class="container"> - <div class="row dummy-bg"> - <div class="alert alert-primary" role="alert"> - <a href="#" class="alert-link">...</a> - </div> - <div class="col-md-6"> - <h2>BLUE it!</h2> - <div class="dummy-boy"> - </div> - </div> - <div class="col-md-6"> - <h2>GREEN THAT!</h2> - <div class="dummy-girl"> - </div> - </div> - </div> - </div> - </section> + <div class="row"> + <div class="col-md-12 text-center mt32 mb32"> + <h2 class="options_simple_snippet">A great Title, prmize</h2> + <h3 class="text-muted">And a great subtilte too</h3> + <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. </p> + <div class="dummy-boy"></div> + <div class="dummy-girl"></div> + </div> + </div> Your new snippet is now ready to use. Just drag and drop it on your page to see it in action. @@ -329,9 +337,12 @@ Explain xpath .. TODO:: syntax not correct (see website examples) -Your option menu is now correctly set in the database, you can create an new dropdown menu. +Your option menu is now correctly set in the database, you can create an new +dropdown menu. + +Let's say yout want three options which will change the text color and the +background. -Let's say yout want three options which will change the text color and the background. In option.xml, add these lines inside the xpath:: <li data-check_class="text-purple"><a>YOUR OPTION 1</a></li> |
