[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:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user