Newer
Older
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 XCG Consulting (www.xcg-consulting.fr)
#
# 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 <http://www.gnu.org/licenses/>.
#
##############################################################################
Jérémie Gavrel
committed
# Before loading the module, if the analytic_size option is given, check it.
# Its value must be an integer greater or equal to the default value.
from openerp.tools import config
Jérémie Gavrel
committed
errors = ["[analytic]"]
Jérémie Gavrel
committed
try:
Jérémie Gavrel
committed
assert int(config.get_misc('analytic', 'analytic_size', 5)) >= 5
Jérémie Gavrel
committed
except (ValueError, AssertionError):
Jérémie Gavrel
committed
errors.append("analytic_size must be an integer greater/equal to 5.")
try:
assert config.get_misc('analytic', 'translate', False) in [True, False]
except (AssertionError):
errors.append("translate must be a boolean value.")
if len(errors) > 1:
config.parser.error("\n * ".join(errors))
Jérémie Gavrel
committed
Jérémie Gavrel
committed
import MetaAnalytic
import analytic_code
import analytic_dimension
import analytic_structure