[IMP] fleet: Make the image readonly on the vehicle and model
Currently when user change the image on a vehicle, it change it for the car manufacturer and the goal of this image is to recognize the manufacturer of the vehicle. After this commit is applied, the model and vehicle image will be fixed as per the selected brand image. user will not be able to change from the vehicle and model. closes odoo/odoo#44153 Taskid: 2168922 Closes: #44153 Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
This commit is contained in:
committed by
Barad Mahendra
parent
e28809a1d6
commit
ff23944ad7
@@ -78,7 +78,7 @@ class FleetVehicle(models.Model):
|
||||
horsepower_tax = fields.Float('Horsepower Taxation')
|
||||
power = fields.Integer('Power', help='Power in kW of the vehicle')
|
||||
co2 = fields.Float('CO2 Emissions', help='CO2 emissions of the vehicle')
|
||||
image_128 = fields.Image(related='model_id.image_128', readonly=False)
|
||||
image_128 = fields.Image(related='model_id.image_128', readonly=True)
|
||||
contract_renewal_due_soon = fields.Boolean(compute='_compute_contract_reminder', search='_search_contract_renewal_due_soon',
|
||||
string='Has Contracts to renew', multi='contract_info')
|
||||
contract_renewal_overdue = fields.Boolean(compute='_compute_contract_reminder', search='_search_get_overdue_contract_reminder',
|
||||
|
||||
@@ -14,7 +14,7 @@ class FleetVehicleModel(models.Model):
|
||||
vendors = fields.Many2many('res.partner', 'fleet_vehicle_model_vendors', 'model_id', 'partner_id', string='Vendors')
|
||||
manager_id = fields.Many2one('res.users', 'Fleet Manager', default=lambda self: self.env.uid,
|
||||
domain=lambda self: [('groups_id', 'in', self.env.ref('fleet.fleet_group_manager').id)])
|
||||
image_128 = fields.Image(related='brand_id.image_128', readonly=False)
|
||||
image_128 = fields.Image(related='brand_id.image_128', readonly=True)
|
||||
active = fields.Boolean(default=True)
|
||||
|
||||
@api.depends('name', 'brand_id')
|
||||
|
||||
Reference in New Issue
Block a user