[MIG] server_environment: Migration to 11.0
This commit is contained in:
parent
bd44c2c287
commit
968d9d3e8b
|
|
@ -1,4 +1,3 @@
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
#
|
#
|
||||||
# Adapted by Nicolas Bessi. Copyright Camptocamp SA
|
# Adapted by Nicolas Bessi. Copyright Camptocamp SA
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
#
|
#
|
||||||
# Adapted by Nicolas Bessi. Copyright Camptocamp SA
|
# Adapted by Nicolas Bessi. Copyright Camptocamp SA
|
||||||
|
|
@ -21,7 +20,7 @@
|
||||||
|
|
||||||
{
|
{
|
||||||
"name": "server configuration environment files",
|
"name": "server configuration environment files",
|
||||||
"version": "10.0.1.2.0",
|
"version": "11.0.1.0.0",
|
||||||
"depends": ["base", "server_environment_files"],
|
"depends": ["base", "server_environment_files"],
|
||||||
"author": "Camptocamp,Odoo Community Association (OCA)",
|
"author": "Camptocamp,Odoo Community Association (OCA)",
|
||||||
"summary": "move some configurations out of the database",
|
"summary": "move some configurations out of the database",
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
#
|
#
|
||||||
# Adapted by Nicolas Bessi. Copyright Camptocamp SA
|
# Adapted by Nicolas Bessi. Copyright Camptocamp SA
|
||||||
|
|
@ -20,7 +19,7 @@
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import ConfigParser
|
import configparser
|
||||||
from lxml import etree
|
from lxml import etree
|
||||||
from itertools import chain
|
from itertools import chain
|
||||||
|
|
||||||
|
|
@ -91,7 +90,7 @@ def _load_config():
|
||||||
else:
|
else:
|
||||||
conf_files = _listconf(running_env)
|
conf_files = _listconf(running_env)
|
||||||
|
|
||||||
config_p = ConfigParser.SafeConfigParser()
|
config_p = configparser.SafeConfigParser()
|
||||||
# options are case-sensitive
|
# options are case-sensitive
|
||||||
config_p.optionxform = str
|
config_p.optionxform = str
|
||||||
try:
|
try:
|
||||||
|
|
@ -144,9 +143,9 @@ class ServerConfiguration(models.TransientModel):
|
||||||
def _add_columns(cls):
|
def _add_columns(cls):
|
||||||
"""Add columns to model dynamically"""
|
"""Add columns to model dynamically"""
|
||||||
cols = chain(
|
cols = chain(
|
||||||
cls._get_base_cols().items(),
|
list(cls._get_base_cols().items()),
|
||||||
cls._get_env_cols().items(),
|
list(cls._get_env_cols().items()),
|
||||||
cls._get_system_cols().items()
|
list(cls._get_system_cols().items())
|
||||||
)
|
)
|
||||||
for col, value in cols:
|
for col, value in cols:
|
||||||
col_name = col.replace('.', '_')
|
col_name = col.replace('.', '_')
|
||||||
|
|
@ -159,7 +158,7 @@ class ServerConfiguration(models.TransientModel):
|
||||||
def _get_base_cols(cls):
|
def _get_base_cols(cls):
|
||||||
""" Compute base fields"""
|
""" Compute base fields"""
|
||||||
res = {}
|
res = {}
|
||||||
for col, item in system_base_config.options.items():
|
for col, item in list(system_base_config.options.items()):
|
||||||
key = cls._format_key('odoo', col)
|
key = cls._format_key('odoo', col)
|
||||||
res[key] = item
|
res[key] = item
|
||||||
return res
|
return res
|
||||||
|
|
@ -199,8 +198,7 @@ class ServerConfiguration(models.TransientModel):
|
||||||
@classmethod
|
@classmethod
|
||||||
def _build_osv(cls):
|
def _build_osv(cls):
|
||||||
"""Build the view for the current configuration."""
|
"""Build the view for the current configuration."""
|
||||||
arch = ('<?xml version="1.0" encoding="utf-8"?>'
|
arch = ('<form string="Configuration Form">'
|
||||||
'<form string="Configuration Form">'
|
|
||||||
'<notebook colspan="4">')
|
'<notebook colspan="4">')
|
||||||
|
|
||||||
# Odoo server configuration
|
# Odoo server configuration
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
#
|
#
|
||||||
# Adapted by Nicolas Bessi. Copyright Camptocamp SA
|
# Adapted by Nicolas Bessi. Copyright Camptocamp SA
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
#
|
#
|
||||||
# Author: Nicolas Bessi
|
# Author: Nicolas Bessi
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
#
|
#
|
||||||
# Author: Nicolas Bessi
|
# Author: Nicolas Bessi
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue