From 9e9d9e6490c704f35db23fa3375ce9062c06b47e Mon Sep 17 00:00:00 2001 From: Haresh Shyara Date: Wed, 19 Apr 2017 10:55:30 +0200 Subject: [PATCH] [IMP] maintenance : team form and team members This commit changes the maintenance team: -In the form view -> replace Category name by Team name -Replace the partner by a many2many with users -Display the from view instead of editable list view of teams In the model, the partner field is replaced by member_ids. However this field is never used except in the form view. --- addons/maintenance/models/maintenance.py | 2 +- addons/maintenance/views/maintenance_views.xml | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/addons/maintenance/models/maintenance.py b/addons/maintenance/models/maintenance.py index 62a98d5dfc0..3e14687d35e 100644 --- a/addons/maintenance/models/maintenance.py +++ b/addons/maintenance/models/maintenance.py @@ -360,7 +360,7 @@ class MaintenanceTeam(models.Model): _description = 'Maintenance Teams' name = fields.Char(required=True) - partner_id = fields.Many2one('res.partner', string='Subcontracting Partner') + member_ids = fields.Many2many('res.users', 'maintenance_team_users_rel', string="Team Members") color = fields.Integer("Color Index", default=1) request_ids = fields.One2many('maintenance.request', 'maintenance_team_id', copy=False) equipment_ids = fields.One2many('maintenance.equipment', 'maintenance_team_id', copy=False) diff --git a/addons/maintenance/views/maintenance_views.xml b/addons/maintenance/views/maintenance_views.xml index 9106107442c..1fc21496b7e 100644 --- a/addons/maintenance/views/maintenance_views.xml +++ b/addons/maintenance/views/maintenance_views.xml @@ -658,12 +658,16 @@
-
- + + + + +
@@ -673,7 +677,7 @@ maintenance.team.tree maintenance.team - + @@ -800,9 +804,8 @@ Teams maintenance.team - tree form - + tree,form

Click to add a team in the maintenance request.