Skip to content

Commit

Permalink
[MERGE] base: Revert #26831
Browse files Browse the repository at this point in the history
Purpose
=======

The reified view removal makes sense from a functional point of view
as it allows to customize the res.users configuration view.

But this PR is also impossible to migrate efficiently as all the custom
groups that are not defined on the res.users model and that are not included
in the res.users view wont be displayed anymore.

It is still possible to add the group by hand in debug mode, but actually it is
not the clean workaround.

This could be done again in a better way, for example by defining a new field
like "UserGroup" and by allowing a easy customization with the Odoo Studio feature

Specification
=============

- Remove the generic methods to define the user's group computed fields
- Reintroduce the reified view
- Keep the main interesting feature of the original PR: Display the user's type
  (Internal User, Public, Portal) as a selection field.
  • Loading branch information
tivisse committed Sep 10, 2018
2 parents 29cd2c3 + 73d0205 commit 1199451
Show file tree
Hide file tree
Showing 146 changed files with 441 additions and 1,347 deletions.
1 change: 0 additions & 1 deletion addons/account/__manifest__.py
Expand Up @@ -65,7 +65,6 @@
'views/account_dashboard_setup_bar.xml',
'wizard/account_report_tax_view.xml',
'views/report_tax.xml',
'views/res_users_views.xml',
'data/service_cron_reverse.xml',
'views/account_fiscal_year_view.xml',
],
Expand Down
1 change: 0 additions & 1 deletion addons/account/models/__init__.py
Expand Up @@ -15,4 +15,3 @@
from . import res_config_settings
from . import account_cash_rounding
from . import reconciliation_widget
from . import res_users
21 changes: 0 additions & 21 deletions addons/account/models/res_users.py

This file was deleted.

3 changes: 3 additions & 0 deletions addons/account/security/account_security.xml
Expand Up @@ -10,6 +10,7 @@

<record id="group_account_user" model="res.groups">
<field name="name">Show Full Accounting Features</field>
<field name="category_id" ref="base.module_category_hidden"/>
</record>

<record id="group_account_manager" model="res.groups">
Expand All @@ -28,10 +29,12 @@

<record id="group_warning_account" model="res.groups">
<field name="name">A warning can be set on a partner (Account)</field>
<field name="category_id" ref="base.module_category_hidden"/>
</record>

<record id="group_cash_rounding" model="res.groups">
<field name="name">Allow the cash rounding management</field>
<field name="category_id" ref="base.module_category_hidden"/>
</record>

<record id="group_fiscal_year" model="res.groups">
Expand Down
24 changes: 0 additions & 24 deletions addons/account/views/res_users_views.xml

This file was deleted.

1 change: 0 additions & 1 deletion addons/analytic/__manifest__.py
Expand Up @@ -19,7 +19,6 @@
'security/analytic_security.xml',
'security/ir.model.access.csv',
'views/analytic_account_views.xml',
'views/res_users_views.xml',
],
'demo': [
'data/analytic_demo.xml',
Expand Down
1 change: 0 additions & 1 deletion addons/analytic/models/__init__.py
Expand Up @@ -2,4 +2,3 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.

from . import analytic_account
from . import res_users
16 changes: 0 additions & 16 deletions addons/analytic/models/res_users.py

This file was deleted.

2 changes: 2 additions & 0 deletions addons/analytic/security/analytic_security.xml
Expand Up @@ -34,10 +34,12 @@

<record id="group_analytic_accounting" model="res.groups">
<field name="name">Analytic Accounting</field>
<field name="category_id" ref="base.module_category_hidden"/>
</record>

<record id="group_analytic_tags" model="res.groups">
<field name="name">Analytic Accounting Tags</field>
<field name="category_id" ref="base.module_category_hidden"/>
</record>

</data>
Expand Down
20 changes: 0 additions & 20 deletions addons/analytic/views/res_users_views.xml

This file was deleted.

1 change: 0 additions & 1 deletion addons/crm/__manifest__.py
Expand Up @@ -43,7 +43,6 @@
'report/crm_activity_report_views.xml',
'report/crm_opportunity_report_views.xml',
'views/crm_team_views.xml',
'views/res_users_views.xml',
],
'demo': [
'data/crm_demo.xml',
Expand Down
5 changes: 1 addition & 4 deletions addons/crm/models/res_users.py
Expand Up @@ -5,11 +5,8 @@


class Users(models.Model):

_inherit = 'res.users'

target_sales_won = fields.Integer('Won in Opportunities Target')
target_sales_done = fields.Integer('Activities Done Target')

has_group_use_lead = fields.Boolean(
'Show Lead Menu', compute='_compute_groups_id', inverse='_inverse_groups_id',
group_xml_id='crm.group_use_lead')
1 change: 1 addition & 0 deletions addons/crm/security/crm_security.xml
Expand Up @@ -5,6 +5,7 @@

<record id="group_use_lead" model="res.groups">
<field name="name">Show Lead Menu</field>
<field name="category_id" ref="base.module_category_hidden"/>
</record>

<record model="res.users" id="base.user_root">
Expand Down
16 changes: 0 additions & 16 deletions addons/crm/views/res_users_views.xml

This file was deleted.

2 changes: 0 additions & 2 deletions addons/event/__manifest__.py
Expand Up @@ -30,8 +30,6 @@
'views/res_config_settings_views.xml',
'views/event_templates.xml',
'views/res_partner_views.xml',
'views/res_users_views.xml',

],
'demo': [
'data/event_demo.xml',
Expand Down
1 change: 0 additions & 1 deletion addons/event/models/__init__.py
Expand Up @@ -5,4 +5,3 @@
from . import event_mail
from . import res_config_settings
from . import res_partner
from . import res_users
3 changes: 1 addition & 2 deletions addons/event/models/res_partner.py
Expand Up @@ -3,11 +3,10 @@

from odoo import api, fields, models


class ResPartner(models.Model):
_inherit = 'res.partner'

event_count = fields.Integer("Events Count", compute='_compute_event_count', help="Number of events the partner has participated.")
event_count = fields.Integer("Events", compute='_compute_event_count', help="Number of events the partner has participated.")

def _compute_event_count(self):
if not self.user_has_groups('event.group_event_user'):
Expand Down
13 changes: 0 additions & 13 deletions addons/event/models/res_users.py

This file was deleted.

14 changes: 0 additions & 14 deletions addons/event/views/res_users_views.xml

This file was deleted.

1 change: 0 additions & 1 deletion addons/fleet/__manifest__.py
Expand Up @@ -36,7 +36,6 @@
'views/fleet_vehicle_cost_views.xml',
'views/fleet_board_view.xml',
'views/mail_activity_views.xml',
'views/res_users_views.xml',
'data/fleet_cars_data.xml',
'data/fleet_data.xml',
'data/mail_data.xml',
Expand Down
1 change: 0 additions & 1 deletion addons/fleet/models/__init__.py
Expand Up @@ -4,4 +4,3 @@
from . import fleet_vehicle
from . import fleet_vehicle_cost
from . import fleet_vehicle_model
from . import res_users
13 changes: 0 additions & 13 deletions addons/fleet/models/res_users.py

This file was deleted.

14 changes: 0 additions & 14 deletions addons/fleet/views/res_users_views.xml

This file was deleted.

1 change: 0 additions & 1 deletion addons/hr/__manifest__.py
Expand Up @@ -27,7 +27,6 @@
'views/hr_views.xml',
'views/hr_templates.xml',
'views/res_config_settings_views.xml',
'views/res_users_views.xml',
'data/hr_data.xml',
],
'demo': [
Expand Down
6 changes: 0 additions & 6 deletions addons/hr/models/res_users.py
Expand Up @@ -11,12 +11,6 @@ class User(models.Model):

employee_ids = fields.One2many('hr.employee', 'user_id', string='Related employees')

group_hr_user = fields.Selection(
selection=lambda self: self._get_group_selection('base.module_category_human_resources'),
string="Human Resources", compute='_compute_groups_id', inverse='_inverse_groups_id',
category_xml_id='base.module_category_human_resources',
help='Officer: The user will be able to approve document created by employees.\nManager: The user will have access to the human resources configuration as well as statistic reports.')

@api.multi
def write(self, vals):
""" When renaming admin user, we want its new name propagated to its related employees """
Expand Down
14 changes: 0 additions & 14 deletions addons/hr/views/res_users_views.xml

This file was deleted.

1 change: 0 additions & 1 deletion addons/hr_attendance/__manifest__.py
Expand Up @@ -26,7 +26,6 @@
'views/hr_department_view.xml',
'views/hr_employee_view.xml',
'views/res_config_settings_views.xml',
'views/res_users_views.xml',
],
'demo': [
'data/hr_attendance_demo.xml'
Expand Down
1 change: 0 additions & 1 deletion addons/hr_attendance/models/__init__.py
Expand Up @@ -3,4 +3,3 @@
from . import res_config_settings
from . import hr_attendance
from . import hr_employee
from . import res_users
23 changes: 0 additions & 23 deletions addons/hr_attendance/models/res_users.py

This file was deleted.

1 change: 1 addition & 0 deletions addons/hr_attendance/security/hr_attendance_security.xml
Expand Up @@ -34,6 +34,7 @@

<record id="group_hr_attendance_use_pin" model="res.groups">
<field name="name">Enable PIN use</field>
<field name="category_id" ref="base.module_category_hidden"/>
<field name="comment">The user will have to enter his PIN to check in and out manually at the company screen.</field>
</record>

Expand Down
24 changes: 0 additions & 24 deletions addons/hr_attendance/views/res_users_views.xml

This file was deleted.

0 comments on commit 1199451

Please sign in to comment.