Add restart vps in portal
This commit is contained in:
@@ -89,7 +89,11 @@ class VPSServer(models.Model):
|
||||
status = self._proxmox_request('GET', f'nodes/pve/{vm_type}/{vm_id}/status/current')
|
||||
server.state = 'running' if status['data']['status'] == 'running' else 'stopped'
|
||||
|
||||
|
||||
def action_restart_from_portal(self):
|
||||
self.ensure_one()
|
||||
if self.env.user.partner_id != self.customer_id:
|
||||
raise AccessError(_("You don't have permission to restart this VPS."))
|
||||
return self.action_reboot()
|
||||
|
||||
def action_fetch_proxmox_data(self):
|
||||
self.ensure_one()
|
||||
|
||||
Reference in New Issue
Block a user