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