Files
odoo_vm_proxmox/ow_vm_management/models/vps_server.py
2024-08-04 01:30:06 +02:00

19 lines
756 B
Python

from odoo import models, fields, api
class VPSServer(models.Model):
_name = 'vps.server'
_description = 'VPS Server'
_inherit = ['portal.mixin', 'mail.thread', 'mail.activity.mixin']
name = fields.Char(string='Server Name', required=True)
ip_address = fields.Char(string='IP Address', required=True)
cpu = fields.Integer(string='CPU Cores')
ram = fields.Float(string='RAM (GB)')
storage = fields.Float(string='Storage (GB)')
os = fields.Char(string='Operating System')
customer_id = fields.Many2one('res.partner', string='Customer', required=True)
def _compute_access_url(self):
super()._compute_access_url()
for server in self:
server.access_url = '/my/vps-servers/%s' % server.id