[IMP] fleet: add responsible on fleet vehicle log contract model

Currently there is no place to indicate who is responsible of managing
fleet contracts. As we plan to integrate activities to fleet app having
responsible to push notifications is necessary.

This commit adds a responsible field following Odoo convention, aka a
user_id field linking res.users records. It is also added on the view.
This commit is contained in:
Thibault Delavallée
2018-03-27 16:31:00 +02:00
parent 17c9b7afee
commit fce33767af
2 changed files with 3 additions and 1 deletions
+2 -1
View File
@@ -95,7 +95,8 @@ class FleetVehicleLogContract(models.Model):
name = fields.Text(compute='_compute_contract_name', store=True)
active = fields.Boolean(default=True)
start_date = fields.Date('Contract Start Date', default=fields.Date.context_today,
user_id = fields.Many2one('res.users', 'Responsible', default=lambda self: self.env.user, index=True)
start_date = fields.Date('Contract Start Date', default=fields.Date.context_today,
help='Date when the coverage of the contract begins')
expiration_date = fields.Date('Contract Expiration Date', default=lambda self:
self.compute_next_year_date(fields.Date.context_today(self)),
@@ -187,6 +187,7 @@
<group string="Contract details">
<field name="vehicle_id"/>
<field name="cost_subtype_id" required="1" domain="['|',('category','=','contract'),('category','=','both')]"/>
<field name="user_id"/>
<field name="amount" string="Activation Cost" help="Cost that is paid only once at the creation of the contract"/>
<label for="cost_generated"/>
<div>