[IMP] developer/howtos/rdtraining: Add missing information about module category.

Adds explanations and directive for module category creation, so it can be used correctly at res.groups creation.

closes odoo/documentation#2728

X-original-commit: 338fe297b0
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
This commit is contained in:
Claire Bretton (clbr) 2022-09-15 13:07:35 +00:00
parent cd9fae9c97
commit 38eb13f6dd

View File

@ -89,27 +89,27 @@ the ``res.groups`` model. They are normally part of a module's :ref:`master data
As simple example `can be found here <https://github.com/odoo/odoo/blob/532c083cbbe0ee6e7a940e2bdc9c677bd56b62fa/addons/hr/security/hr_security.xml#L9-L14>`_.
.. admonition:: what is the *category_id*?
``category_id`` a *module category*, it is automatically generated from the
:ref:`category defined in module manifest files <howto/rdtraining/03_newapp>`.
.. todo:: the demo module needs to have the category set, to
*Real Estate/Brokerage*, ideally the newapp part would already do
that
.. exercise::
Create the ``security.xml`` file in the appropriate folder and add it to the
``__manifest__.py`` file.
#. Create the ``security.xml`` file in the appropriate folder and add it to the ``__manifest__.py`` file.
Add a record creating a group with the id ``estate_group_user``, the name
"Agent" and the category ``base.module_category_real_estate_brokerage``.
#. If not already, add a ``'category'`` field to your ``__manifest__.py`` with value ``Real Estate/Brokerage``.
Below that, add a record creating a group with the id
``estate_group_manager``, the name "Manager" and the category
``base.module_category_real_estate_brokerage``. The ``estate_group_manager``
group needs to imply ``estate_group_user``.
#. Add a record creating a group with the id ``estate_group_user``, the name "Agent"
and the category ``base.module_category_real_estate_brokerage``.
#. Below that, add a record creating a group with the id ``estate_group_manager``,
the name "Manager" and the category ``base.module_category_real_estate_brokerage``.
The ``estate_group_manager`` group needs to imply ``estate_group_user``.
.. note::
Where does that **category** comes from ? It's a *module category*.
Here we used the category id ``base.module_category_real_estate_brokerage``
which was automatically generated by Odoo based on the `category` set in the ``__manifest__.py`` of the module.
You can also find here the list of
`default module categories <https://github.com/odoo/odoo/blob/71da80deb044852a2af6b111d695f94aad7803ac/odoo/addons/base/data/ir_module_category_data.xml>`_
provided by Odoo.
.. tip::