Skip to content

Commit

Permalink
[IMP] maintenance : team form and team members
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
hsh-odoo authored and pimodoo committed Apr 27, 2017
1 parent e98f286 commit 9e9d9e6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion addons/maintenance/models/maintenance.py
Expand Up @@ -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)
Expand Down
13 changes: 8 additions & 5 deletions addons/maintenance/views/maintenance_views.xml
Expand Up @@ -658,12 +658,16 @@
<form string="Maintenance Team">
<sheet>
<div class="oe_title">
<label for="name" class="oe_edit_only" string="Category Name"/>
<label for="name" class="oe_edit_only" string="Team Name"/>
<h1>
<field name="name"/>
</h1>
</div>
<field name="partner_id"/>
<group>
<group>
<field name="member_ids" widget="many2many_tags"/>
</group>
</group>
</sheet>
</form>
</field>
Expand All @@ -673,7 +677,7 @@
<field name="name">maintenance.team.tree</field>
<field name="model">maintenance.team</field>
<field name="arch" type="xml">
<tree string="Maintenance Team" editable="top">
<tree string="Maintenance Team">
<field name="name"/>
</tree>
</field>
Expand Down Expand Up @@ -800,9 +804,8 @@
<record id="maintenance_team_action_settings" model="ir.actions.act_window">
<field name="name">Teams</field>
<field name="res_model">maintenance.team</field>
<field name="view_mode">tree</field>
<field name="view_type">form</field>
<field name="view_id" ref="maintenance_team_view_tree"/>
<field name="view_mode">tree,form</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to add a team in the maintenance request.
Expand Down

0 comments on commit 9e9d9e6

Please sign in to comment.