diff options
| author | Yannick Tivisse <yti@odoo.com> | 2018-04-25 15:21:02 +0200 |
|---|---|---|
| committer | Yannick Tivisse <yti@odoo.com> | 2018-04-26 15:13:38 +0200 |
| commit | 99f497b390e680629dce3a7e2e282ada74ee9884 (patch) | |
| tree | 3eb22b0bdcbe3d9709246309ff0dd0e404d1d259 /addons/analytic/models | |
| parent | ab179bb2d7b8f890e04ea79e70d7bc0898e7599f (diff) | |
[IMP] *: Define groups on res.users models
The reified view on the res users will be dropped in the following commit.
The previous commit adds support to define each group as a computed field on the res users.
This commit defines:
- A boolean field for each 'isolated' res.group, i.e. a group in the hidden category.
- A selection field for each 'Application' res.group, i.e. a group in a application category.
Example:
- The group to manage pricelist in sales becomes a boolean field
- The groups project user/manager become a selection field
Diffstat (limited to 'addons/analytic/models')
| -rw-r--r-- | addons/analytic/models/__init__.py | 1 | ||||
| -rw-r--r-- | addons/analytic/models/res_users.py | 16 |
2 files changed, 17 insertions, 0 deletions
diff --git a/addons/analytic/models/__init__.py b/addons/analytic/models/__init__.py index d1fd64b96f8..2e5e553c626 100644 --- a/addons/analytic/models/__init__.py +++ b/addons/analytic/models/__init__.py @@ -2,3 +2,4 @@ # Part of Odoo. See LICENSE file for full copyright and licensing details. from . import analytic_account +from . import res_users diff --git a/addons/analytic/models/res_users.py b/addons/analytic/models/res_users.py new file mode 100644 index 00000000000..f1363c0d123 --- /dev/null +++ b/addons/analytic/models/res_users.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. + +from odoo import fields, models + + +class ResUsers(models.Model): + _inherit = 'res.users' + + has_group_analytic_accounting = fields.Boolean( + 'Analytic Accounting', compute='_compute_groups_id', inverse='_inverse_groups_id', + group_xml_id='analytic.group_analytic_accounting') + + has_group_analytic_tags = fields.Boolean( + 'Analytic Accounting Tags', compute='_compute_groups_id', inverse='_inverse_groups_id', + group_xml_id='analytic.group_analytic_tags') |
