
from openerp import api, models, tools


class IrConfigParameter(models.Model):
    _inherit = 'ir.config_parameter'

    @api.model
    def get_param(self, key, default=False):
        if key == 'server.environment':
            return tools.config.get('server.environment') or default
        if key == 'max_upload_size':
            return tools.config.get('max_upload_size') or default
        return super(IrConfigParameter, self).get_param(key, default)


from openerp import api, models, tools


class IrConfigParameter(models.Model):
    _inherit = 'ir.config_parameter'

    @api.model
    def get_param(self, key, default=False):
        if key in tools.config.options:
            return tools.config.get(key)
        return super(IrConfigParameter, self).get_param(key, default)

Allow to override any config parameter via config file
[IMP] Allow to override any config parameter via config file
  
  from openerp import api, models, tools
  
  
  class IrConfigParameter(models.Model):
      _inherit = 'ir.config_parameter'
  
      @api.model
      def get_param(self, key, default=False):
+         if key in tools.config.options:
+             return tools.config.get(key)
-         if key == 'server.environment':
-             return tools.config.get('server.environment') or default
-         if key == 'max_upload_size':
-             return tools.config.get('max_upload_size') or default
          return super(IrConfigParameter, self).get_param(key, default)
  
Allow to override any config parameter via config file
## Code Before:

from openerp import api, models, tools


class IrConfigParameter(models.Model):
    _inherit = 'ir.config_parameter'

    @api.model
    def get_param(self, key, default=False):
        if key == 'server.environment':
            return tools.config.get('server.environment') or default
        if key == 'max_upload_size':
            return tools.config.get('max_upload_size') or default
        return super(IrConfigParameter, self).get_param(key, default)

## Instruction:
Allow to override any config parameter via config file
## Code After:

from openerp import api, models, tools


class IrConfigParameter(models.Model):
    _inherit = 'ir.config_parameter'

    @api.model
    def get_param(self, key, default=False):
        if key in tools.config.options:
            return tools.config.get(key)
        return super(IrConfigParameter, self).get_param(key, default)
