|
@@ -13,27 +13,29 @@ import time
|
|
|
|
|
|
|
|
|
|
class OdooContainer(models.Model):
|
|
class OdooContainer(models.Model):
|
|
- _name = 'odoo.management.odoo.container'
|
|
|
|
|
|
+ _name = 'odoo.container'
|
|
|
|
|
|
CONTAINER_STATUS = [
|
|
CONTAINER_STATUS = [
|
|
- ('to_activate', 'Por activar'),
|
|
|
|
|
|
+ ('draft', 'Por activar'),
|
|
('activated', 'Activado'),
|
|
('activated', 'Activado'),
|
|
('disapproved', 'No aprobado'),
|
|
('disapproved', 'No aprobado'),
|
|
('suspended', 'Suspendido'),
|
|
('suspended', 'Suspendido'),
|
|
('destroyed', 'Eliminado')
|
|
('destroyed', 'Eliminado')
|
|
]
|
|
]
|
|
|
|
|
|
- normalized_name = fields.Char(string='Normalized Name', compute='_normalize_name', size=50)
|
|
|
|
|
|
+ name = fields.Char(string='Name', size=50)
|
|
|
|
+ normalized_name = fields.Char(string='Normalized name', compute='_normalize_name', size=50)
|
|
logo = fields.Binary(string='Logo')
|
|
logo = fields.Binary(string='Logo')
|
|
internal_ip = fields.Char(string='Internal IP', size=15)
|
|
internal_ip = fields.Char(string='Internal IP', size=15)
|
|
- internal_port = fields.Integer(string='Internal Port')
|
|
|
|
|
|
+ internal_port = fields.Integer(string='Internal port')
|
|
external_ip = fields.Char(string='External IP', size=15)
|
|
external_ip = fields.Char(string='External IP', size=15)
|
|
- external_port = fields.Integer(string='External Port')
|
|
|
|
- expose_service = fields.Boolean(string='Expose Service', default=True)
|
|
|
|
- status = fields.Selection(string='Estado', selection=CONTAINER_STATUS, default='draft')
|
|
|
|
|
|
+ external_port = fields.Integer(string='External port')
|
|
|
|
+ expose_ip = fields.Boolean(string='Expose IP', default=True)
|
|
|
|
+ state = fields.Selection(string='Estado', selection=CONTAINER_STATUS, default='draft')
|
|
demo = fields.Boolean(string='Is Demo?', default=False)
|
|
demo = fields.Boolean(string='Is Demo?', default=False)
|
|
|
|
+ domain = fields.Char(string='Dominio', size=100)
|
|
active = fields.Boolean(string='Is Active', default=False)
|
|
active = fields.Boolean(string='Is Active', default=False)
|
|
- payment_plan_id = fields.Many2one(string='Payment Plan', comodel_name='odoo.management.payment.plan', required=True)
|
|
|
|
|
|
+ payment_plan_id = fields.Many2one(string='Payment plan', comodel_name='payment.plan', required=True)
|
|
|
|
|
|
@api.one
|
|
@api.one
|
|
# @api.depends('name')
|
|
# @api.depends('name')
|
|
@@ -48,6 +50,10 @@ class OdooContainer(models.Model):
|
|
name = stringcase.lowercase(name)
|
|
name = stringcase.lowercase(name)
|
|
self.normalized_name = stringcase.snakecase(name)
|
|
self.normalized_name = stringcase.snakecase(name)
|
|
|
|
|
|
|
|
+ @api.one
|
|
|
|
+ def action_activate(self):
|
|
|
|
+ print(self)
|
|
|
|
+
|
|
def check_existence(self):
|
|
def check_existence(self):
|
|
root_path = config['odoo_root_path'] or None
|
|
root_path = config['odoo_root_path'] or None
|
|
|
|
|