[MIG] server_environment: Migration to 11.0
This commit is contained in:
parent
6f908a8566
commit
d446152585
|
|
@ -21,7 +21,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",
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,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 +91,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 +144,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 +159,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
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue