Release v6.0
This commit is contained in:
parent
c92390931c
commit
fe44fa857a
|
@ -1,9 +1,10 @@
|
|||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
from trytond.pool import Pool
|
||||
import configuration
|
||||
import server
|
||||
import supplier
|
||||
from . import configuration
|
||||
from . import server
|
||||
from . import supplier
|
||||
|
||||
|
||||
def register():
|
||||
Pool.register(
|
||||
|
|
|
@ -3,8 +3,6 @@
|
|||
from trytond.model import ModelView, ModelSQL, fields, ModelSingleton
|
||||
from trytond.pyson import Eval, If
|
||||
|
||||
__all__ = ['Configuration']
|
||||
|
||||
|
||||
class Configuration(ModelSingleton, ModelSQL, ModelView):
|
||||
'Vps manager Configuration'
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
|
||||
from trytond.model.exceptions import ValidationError
|
||||
from trytond.exceptions import UserError, UserWarning
|
||||
|
||||
|
||||
class DisableDatabaseWarning(UserWarning):
|
||||
pass
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0"?>
|
||||
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
this repository contains the full copyright notices and license terms. -->
|
||||
<tryton>
|
||||
<data grouped="1">
|
||||
<record model="ir.message" id="msg_disable_warning">
|
||||
<field name="text">Sure you want to disable database!</field>
|
||||
</record>
|
||||
</data>
|
||||
</tryton>
|
11
server.py
11
server.py
|
@ -12,9 +12,8 @@ from trytond.wizard import Wizard, StateTransition
|
|||
import psycopg2
|
||||
from psycopg2 import Error
|
||||
import os
|
||||
|
||||
|
||||
__all__ = ['Server', 'Database', 'PricePlan']
|
||||
from .exceptions import DisableDatabaseWarning
|
||||
from trytond.i18n import gettext
|
||||
|
||||
STATES = {
|
||||
'readonly': Eval('state') != 'draft',
|
||||
|
@ -61,9 +60,6 @@ class Database(Workflow, ModelSQL, ModelView):
|
|||
'invisible': Eval('state') != 'disable',
|
||||
},
|
||||
})
|
||||
cls._error_messages.update({
|
||||
'disable_warning': ('Sure you want to disable database!'),
|
||||
})
|
||||
|
||||
@staticmethod
|
||||
def default_state():
|
||||
|
@ -74,6 +70,7 @@ class Database(Workflow, ModelSQL, ModelView):
|
|||
@Workflow.transition('disable')
|
||||
def disable(cls, records):
|
||||
for record in records:
|
||||
raise DisableDatabaseWarning(gettext('vps.msg_disable_warning'))
|
||||
record.allow_connections_database(False)
|
||||
pass
|
||||
|
||||
|
@ -192,8 +189,6 @@ class Database(Workflow, ModelSQL, ModelView):
|
|||
Database.write([database], {'sended_email': True})
|
||||
|
||||
|
||||
|
||||
|
||||
class Server(ModelSQL, ModelView):
|
||||
'Vps Server'
|
||||
__name__ = 'vps.server'
|
||||
|
|
12
supplier.py
12
supplier.py
|
@ -13,9 +13,6 @@ import psycopg2
|
|||
from psycopg2 import Error
|
||||
import os
|
||||
|
||||
|
||||
__all__ = ['SupplierVps']
|
||||
|
||||
STATES = {
|
||||
'readonly': Eval('state') != 'draft',
|
||||
}
|
||||
|
@ -29,13 +26,6 @@ class SupplierVps(ModelSQL, ModelView):
|
|||
servers = fields.Function(fields.One2Many('vps.server', None,
|
||||
'Servers', add_remove=[]), 'get_servers')
|
||||
|
||||
# @classmethod
|
||||
# def __setup__(cls):
|
||||
# super(SupplierVps, cls).__setup__()
|
||||
# cls._order = [
|
||||
# ('party', 'DESC'),
|
||||
# ]
|
||||
|
||||
def get_servers(self, name):
|
||||
Server = Pool().get('vps.server')
|
||||
|
||||
|
@ -45,8 +35,6 @@ class SupplierVps(ModelSQL, ModelView):
|
|||
|
||||
return [server.id for server in servers]
|
||||
|
||||
|
||||
|
||||
def get_rec_name(self, name):
|
||||
rec_name = self.party.name
|
||||
self._rec_name = rec_name
|
||||
|
|
|
@ -27,7 +27,7 @@ this repository contains the full copyright notices and license terms. -->
|
|||
<field name="view" ref="vps_supplier_view_form"/>
|
||||
<field name="act_window" ref="act_vps_supplier_form"/>
|
||||
</record>
|
||||
<menuitem parent="menu_vps" sequence="40"
|
||||
<menuitem parent="menu_vps" sequence="140"
|
||||
action="act_vps_supplier_form" id="menu_vps_form_supplier"/>
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[tryton]
|
||||
version=5.0.0
|
||||
version=6.0.0
|
||||
depends:
|
||||
party
|
||||
company
|
||||
|
|
Loading…
Reference in New Issue