server_environment_ir_config_parameter: migrate to 10.0

This commit is contained in:
Stéphane Bidoul (ACSONE) 2016-12-09 11:35:20 +01:00 committed by Benoit Aimont
parent 15b6f00c9d
commit baac491db2
4 changed files with 12 additions and 12 deletions

View File

@ -38,7 +38,7 @@ For example you can use this module in combination with web_environment_ribbon:
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/149/9.0
:target: https://runbot.odoo-community.org/runbot/149/10.0
Known issues / Roadmap
======================

View File

@ -6,7 +6,7 @@
'name': 'Server Environment Ir Config Parameter',
'summary': """
Override System Parameters from server environment file""",
'version': '9.0.1.0.0',
'version': '10.0.1.0.0',
'license': 'AGPL-3',
'author': 'ACSONE SA/NV,Odoo Community Association (OCA)',
'website': 'https://odoo-community.org/',

View File

@ -2,9 +2,9 @@
# Copyright 2016 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from openerp import api, models, _, SUPERUSER_ID
from openerp.exceptions import UserError
from openerp.addons.server_environment import serv_config
from odoo import api, models, _
from odoo.exceptions import UserError
from odoo.addons.server_environment import serv_config
SECTION = 'ir.config_parameter'
@ -14,9 +14,9 @@ class IrConfigParameter(models.Model):
_inherit = 'ir.config_parameter'
def get_param(self, cr, uid, key, default=False, context=None):
value = super(IrConfigParameter, self).get_param(
cr, uid, key, default=None, context=context)
@api.model
def get_param(self, key, default=False):
value = super(IrConfigParameter, self).get_param(key, default=None)
if serv_config.has_option(SECTION, key):
cvalue = serv_config.get(SECTION, key)
if not cvalue:
@ -28,7 +28,7 @@ class IrConfigParameter(models.Model):
# should we have preloaded values in database at,
# server startup, modules loading their parameters
# from data files would break on unique key error.
self.set_param(cr, SUPERUSER_ID, key, cvalue)
self.set_param(key, cvalue)
value = cvalue
if value is None:
return default

View File

@ -4,9 +4,9 @@
from cStringIO import StringIO
from openerp.exceptions import UserError
from openerp.tests import common
from openerp.tools import convert
from odoo.exceptions import UserError
from odoo.tests import common
from odoo.tools import convert
class TestEnv(common.TransactionCase):