[IMP] maintenance_server_data: add active field in service.instance model
and make the active field value follow the equipement active field
This commit is contained in:
@@ -21,3 +21,11 @@ class MaintenanceEquipment(models.Model):
|
||||
def _compute_name_fr(self):
|
||||
for record in self:
|
||||
record.name_fr = record.with_context(lang="fr_FR").name
|
||||
|
||||
def write(self, vals):
|
||||
res = super().write(vals)
|
||||
if "active" in vals:
|
||||
self.with_context(active_test=False).service_ids.write(
|
||||
{"active": vals["active"]}
|
||||
)
|
||||
return res
|
||||
|
||||
@@ -19,6 +19,7 @@ class ServiceInstance(models.Model):
|
||||
service_id = fields.Many2one('service', string='Service', required=True)
|
||||
version_id = fields.Many2one('service.version', string='Version')
|
||||
service_url = fields.Char(string='Service Url')
|
||||
active = fields.Boolean(default=True)
|
||||
|
||||
|
||||
class BackupServer(models.Model):
|
||||
|
||||
Reference in New Issue
Block a user