From 68eb57dce98265acb89c02e75774deb411be28eb Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 18 Jan 2012 10:41:04 +0100 Subject: [PATCH] [FIX] typo (lp:c2c-addons/6.1 rev 30) --- ir_config_parameter_viewer/__init__.py | 0 ir_config_parameter_viewer/__openerp__.py | 20 -------- .../ir_config_parameter_view.xml | 38 --------------- mail_environment/__init__.py | 7 ++- mail_environment/__openerp__.py | 21 +-------- mail_environment/env_mail.py | 20 +------- security_protector/__init__.py | 1 - security_protector/__openerp__.py | 24 ---------- security_protector/data.xml | 8 ---- security_protector/security_protector.py | 47 ------------------- security_protector/security_view.xml | 8 ---- .../__init__.py | 15 +++--- .../__openerp__.py | 14 +++--- .../base_external_referentials.py | 23 ++++----- 14 files changed, 31 insertions(+), 215 deletions(-) delete mode 100644 ir_config_parameter_viewer/__init__.py delete mode 100644 ir_config_parameter_viewer/__openerp__.py delete mode 100644 ir_config_parameter_viewer/ir_config_parameter_view.xml delete mode 100644 security_protector/__init__.py delete mode 100644 security_protector/__openerp__.py delete mode 100644 security_protector/data.xml delete mode 100644 security_protector/security_protector.py delete mode 100644 security_protector/security_view.xml diff --git a/ir_config_parameter_viewer/__init__.py b/ir_config_parameter_viewer/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/ir_config_parameter_viewer/__openerp__.py b/ir_config_parameter_viewer/__openerp__.py deleted file mode 100644 index f7076cf04..000000000 --- a/ir_config_parameter_viewer/__openerp__.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# Author Nicolas Bessi. Copyright Camptocamp SA -############################################################################## -{'name': 'Ir.config_parameter view', - 'version': '0.1', - 'category': 'Tools', - 'description': """ - Create view to inspect/change technical parameters - """, - 'author': 'Camptocamp', - 'website': 'http://openerp.camptocamp.com', - 'depends': ['base'], - 'init_xml': [], - 'update_xml': ['ir_config_parameter_view.xml'], - 'demo_xml': [], - 'installable': True, - 'auto_install': False} -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/ir_config_parameter_viewer/ir_config_parameter_view.xml b/ir_config_parameter_viewer/ir_config_parameter_view.xml deleted file mode 100644 index b0ebadcf3..000000000 --- a/ir_config_parameter_viewer/ir_config_parameter_view.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - ir.config_parameter.list - ir.config_parameter - tree - - - - - - - - - - ir.config_parameter.form - ir.config_parameter - form - - -
- - - - -
- - Technical config parameters - ir.actions.act_window - ir.config_parameter - form - - - - -
-
\ No newline at end of file diff --git a/mail_environment/__init__.py b/mail_environment/__init__.py index be0b4da9a..beab69dc0 100644 --- a/mail_environment/__init__.py +++ b/mail_environment/__init__.py @@ -1 +1,6 @@ -from . import env_mail +# -*- encoding: utf-8 -*- +############################################################################## +# +# Author Nicolas Bessi. Copyright Camptocamp SA +############################################################################## +from . import env_mail \ No newline at end of file diff --git a/mail_environment/__openerp__.py b/mail_environment/__openerp__.py index fce396f8d..49544f577 100644 --- a/mail_environment/__openerp__.py +++ b/mail_environment/__openerp__.py @@ -1,24 +1,8 @@ -# -*- coding: utf-8 -*- +# -*- encoding: utf-8 -*- ############################################################################## # -# Author: Nicolas Bessi -# Copyright 2012 Camptocamp SA -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# +# Author Nicolas Bessi. Copyright Camptocamp SA ############################################################################## - { 'name': 'Server env config for mail + fetchmail', 'version': '0.1', @@ -55,7 +39,6 @@ password = openerp """, 'author': 'Camptocamp', - 'license': 'AGPL-3', 'website': 'http://openerp.camptocamp.com', 'depends': ['mail', 'fetchmail', 'server_environment', 'server_environment_files', 'crm'], 'init_xml': [], diff --git a/mail_environment/env_mail.py b/mail_environment/env_mail.py index 59d5f5fe9..77d265b38 100644 --- a/mail_environment/env_mail.py +++ b/mail_environment/env_mail.py @@ -1,24 +1,8 @@ -# -*- coding: utf-8 -*- +# -*- encoding: utf-8 -*- ############################################################################## # -# Author: Nicolas Bessi -# Copyright 2012 Camptocamp SA -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# +# Author Nicolas Bessi. Copyright Camptocamp SA ############################################################################## - from osv import fields from osv import osv diff --git a/security_protector/__init__.py b/security_protector/__init__.py deleted file mode 100644 index fca2713dc..000000000 --- a/security_protector/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from . import security_protector \ No newline at end of file diff --git a/security_protector/__openerp__.py b/security_protector/__openerp__.py deleted file mode 100644 index 009df10ce..000000000 --- a/security_protector/__openerp__.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# Author Nicolas Bessi. Copyright Camptocamp SA -############################################################################## -{'name': 'Security protector', - 'version': '0.1', - 'category': 'Tools', - 'description': """ - Prevent security to be changed when module is updated - This module overwrite ir model acces write delete function. - Only acces edited trough the UI or with manual_security_override in context set to True will be altered. - When you try to delete a acces write it simply set all perms to false - you can deactivate this behavior in ir.config_parameter by chanching the protect_security? key to 0 - """, - 'author': 'Camptocamp', - 'website': 'http://openerp.camptocamp.com', - 'depends': ['base'], - 'init_xml': ['data.xml'], - 'update_xml': ['security_view.xml'], - 'demo_xml': [], - 'installable': True, - 'auto_install': False} -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/security_protector/data.xml b/security_protector/data.xml deleted file mode 100644 index 81e6df16f..000000000 --- a/security_protector/data.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - protect_security? - 1 - - - \ No newline at end of file diff --git a/security_protector/security_protector.py b/security_protector/security_protector.py deleted file mode 100644 index b082d16f4..000000000 --- a/security_protector/security_protector.py +++ /dev/null @@ -1,47 +0,0 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# Author Nicolas Bessi. Copyright Camptocamp SA -############################################################################## -from osv import fields, osv - -class IrModelAccess(osv.osv): - "We inherit ir model access to add specific write unlink and copy behavior" - _name = 'ir.model.access' - _inherit = "ir.model.access" - - def _acces_can_be_modified(self, cr, uid, context=None): - context = context or {} - on = self.pool.get('ir.config_parameter').get_param(cr, uid, 'protect_security?', default=False, context=context) - if on in (1, "1", "YES", True): - if context.get('manual_security_override', False): - return True - return False - - else: - return True - - def write(self, cr, uid, ids, vals, context=None): - res =True - context = context or {} - if self._acces_can_be_modified(cr, uid, context=context): - res = super(IrModelAccess, self).write(cr, uid, ids, vals, context=context) - return res - - - def unlink(self, cr, uid, ids, context=None): - res = True - context = context or {} - # I'm note sur about this one maybe we should do nothing - if self._acces_can_be_modified(cr, uid, context=context): - vals = {'perm_read':False, - 'perm_write': False, - 'perm_unlink': False, - 'perm_create': False} - super(IrModelAccess, self).write(cr, uid, ids, vals, context=context) - else: - res = super(IrModelAccess, self).unlink(cr, uid, ids, context=context) - - return res - -IrModelAccess() \ No newline at end of file diff --git a/security_protector/security_view.xml b/security_protector/security_view.xml deleted file mode 100644 index 6f3a83a2e..000000000 --- a/security_protector/security_view.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - {'manual_security_override': 1} - - - \ No newline at end of file diff --git a/server_env_base_external_referentials/__init__.py b/server_env_base_external_referentials/__init__.py index 3934b6ed9..74e3c6a64 100644 --- a/server_env_base_external_referentials/__init__.py +++ b/server_env_base_external_referentials/__init__.py @@ -1,22 +1,21 @@ # -*- coding: utf-8 -*- ############################################################################## # -# Author: Guewen Baconnier -# Copyright 2012 Camptocamp SA +# Author Guewen Baconnier. Copyright Camptocamp SA # # This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. +# GNU General Public License for more details. # -# You should have received a copy of the GNU Affero General Public License +# You should have received a copy of the GNU General Public License # along with this program. If not, see . # ############################################################################## -import base_external_referentials +import base_external_referentials \ No newline at end of file diff --git a/server_env_base_external_referentials/__openerp__.py b/server_env_base_external_referentials/__openerp__.py index ebcb918d2..5c8eb7442 100644 --- a/server_env_base_external_referentials/__openerp__.py +++ b/server_env_base_external_referentials/__openerp__.py @@ -1,20 +1,19 @@ # -*- coding: utf-8 -*- ############################################################################## # -# Author: Guewen Baconnier -# Copyright 2011-2012 Camptocamp SA +# Author Guewen Baconnier. Copyright Camptocamp SA # # This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. +# GNU General Public License for more details. # -# You should have received a copy of the GNU Affero General Public License +# You should have received a copy of the GNU General Public License # along with this program. If not, see . # ############################################################################## @@ -24,7 +23,6 @@ "version": "1.0", "depends": ["base", 'server_environment', 'base_external_referentials'], "author": "Camptocamp", - 'license': 'AGPL-3', "description": """This module is based on the server_environment module to use files for configuration. Thus we can have a different file for each environment (dev, test, staging, prod). This module define the config variables for the base_external_referential module. diff --git a/server_env_base_external_referentials/base_external_referentials.py b/server_env_base_external_referentials/base_external_referentials.py index 091df55ee..735306fdb 100644 --- a/server_env_base_external_referentials/base_external_referentials.py +++ b/server_env_base_external_referentials/base_external_referentials.py @@ -1,28 +1,25 @@ # -*- coding: utf-8 -*- ############################################################################## # -# Author: Guewen Baconnier -# Copyright 2011-2012 Camptocamp SA +# Author Guewen Baconnier. Copyright Camptocamp SA # # This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. +# GNU General Public License for more details. # -# You should have received a copy of the GNU Affero General Public License +# You should have received a copy of the GNU General Public License # along with this program. If not, see . # ############################################################################## from osv import fields, osv from server_environment import serv_config -import logging - class external_referential(osv.osv): @@ -34,12 +31,8 @@ class external_referential(osv.osv): values[referential.id] = {} for field_name in field_names: section_name = '.'.join((self._name.replace('.', '_'), referential.name)) - try: - value = serv_config.get(section_name, field_name) - values[referential.id].update({field_name: value}) - except: - logger = logging.getLogger(__name__) - logger.exception('error trying to read field %s in section %s', field_name, section_name) + value = serv_config.get(section_name, field_name) + values[referential.id].update({field_name: value}) return values _columns = {