diff --git a/models/acc_operation.py b/models/acc_operation.py index 9074a778d58b8fc2b50b846321f5a292e6cc802d..e9f57af6e3b6ea64ebbb8dc03fe1e88506a49205 100644 --- a/models/acc_operation.py +++ b/models/acc_operation.py @@ -70,17 +70,33 @@ class AccOperation(models.Model): return AccessError(_("You are not allowed to call perimeter API")) view_id = self.env.ref("oacc.acc_logs_form").id + + if self.env.user.has_group("oacc.group_operation_superadmin"): + return { + "name": "LOGS", + "view_type": "form", + "view_mode": "form", + "views": [(view_id, "form")], + "res_model": "acc.logs", + "view_id": view_id, + "type": "ir.actions.act_window", + "res_id": log_id.id, + "target": "new", + "flags": {"initial_mode": "view"}, + } + return { - "name": "LOGS", - "view_type": "form", - "view_mode": "form", - "views": [(view_id, "form")], - "res_model": "acc.logs", - "view_id": view_id, - "type": "ir.actions.act_window", - "res_id": log_id.id, - "target": "new", - "flags": {"initial_mode": "view"}, + 'type': 'ir.actions.client', + 'tag': 'display_notification', + 'params': { + 'title': _('Actualisation du périmètre.'), + 'type': 'info', + 'message': "Le périmètre de l'opération a bien été mis à jour dans les onglets 'Points d'injection' et 'Points de soutirage'.", + 'sticky': True, + 'next': { + 'type': 'ir.actions.act_window_close', + } + } } def _get_monthly_enedis_data(self, from_cron):