summaryrefslogtreecommitdiff
path: root/addons/website_mass_mailing/models/res_users.py
diff options
context:
space:
mode:
authorYannick Tivisse <yti@odoo.com>2018-04-25 15:21:02 +0200
committerYannick Tivisse <yti@odoo.com>2018-04-26 15:13:38 +0200
commit99f497b390e680629dce3a7e2e282ada74ee9884 (patch)
tree3eb22b0bdcbe3d9709246309ff0dd0e404d1d259 /addons/website_mass_mailing/models/res_users.py
parentab179bb2d7b8f890e04ea79e70d7bc0898e7599f (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/website_mass_mailing/models/res_users.py')
-rw-r--r--addons/website_mass_mailing/models/res_users.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/addons/website_mass_mailing/models/res_users.py b/addons/website_mass_mailing/models/res_users.py
new file mode 100644
index 00000000000..6024234dfb9
--- /dev/null
+++ b/addons/website_mass_mailing/models/res_users.py
@@ -0,0 +1,13 @@
+# -*- 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_website_popup_on_exit = fields.Boolean(
+ 'Use subscription pop up on the website',
+ compute='_compute_groups_id', inverse='_inverse_groups_id',
+ group_xml_id='website_mass_mailing.group_website_popup_on_exit')