From d3e1323de023af16a0273a794d35a30865858224 Mon Sep 17 00:00:00 2001 From: Sergi Almacellas Abellana Date: Wed, 5 Nov 2014 17:37:46 +0100 Subject: [PATCH] Migrate to version 3.4 --- CHANGELOG | 1 + babi.py | 20 ++++++++++---------- cron.py | 5 ++--- tryton.cfg | 2 +- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 70af0b4..63baccb 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,4 @@ +Version 3.4.0 - 2014-11-03 * Open history data with the correct __history values * Fix user permisions diff --git a/babi.py b/babi.py index 6d1451f..cddd87c 100644 --- a/babi.py +++ b/babi.py @@ -23,9 +23,9 @@ from trytond.pyson import Eval, Bool, PYSONEncoder, Id, In, Not, PYSONDecoder from trytond.pool import Pool, PoolMeta from trytond.transaction import Transaction from trytond.tools import safe_eval -from trytond.config import CONFIG +from trytond.config import config from trytond import backend -from trytond.protocols.jsonrpc import object_hook, JSONEncoder +from trytond.protocols.jsonrpc import JSONDecoder, JSONEncoder from .babi_eval import babi_eval @@ -82,13 +82,14 @@ def unaccent(text): def start_celery(): - celery_start = CONFIG.get('celery_start', True) + celery_start = config.get('celery', 'auto_start', True) if not CELERY_AVAILABLE or not celery_start: return db = Transaction().cursor.database_name env = { 'TRYTON_DATABASE': db, - 'TRYTON_CONFIG': CONFIG.configfile + # TODO: Save current config to a file and update the setting + 'TRYTON_CONFIG': '', } # Copy environment variables in order to get virtualenvs working for key, value in os.environ.iteritems(): @@ -1122,7 +1123,7 @@ class ReportExecution(ModelSQL, ModelView): if not self.filter_values: self.raise_user_error('filter_parameters', self.rec_name) filter_data = json.loads(self.filter_values.encode('utf-8'), - object_hook=object_hook) + object_hook=JSONDecoder()) values = {} for key, value in filter_data.iteritems(): key = '_'.join(key.split('_')[:-1]) @@ -1483,13 +1484,13 @@ class OpenExecutionSelect(ModelView): execution_readonly = fields.Boolean('Execution Readonly') @classmethod - def default_get(cls, fields, with_rec_name=True, with_on_change=True): + def default_get(cls, fields, with_rec_name=True): pool = Pool() Execution = pool.get('babi.report.execution') Menu = pool.get('ir.ui.menu') result = super(OpenExecutionSelect, cls).default_get(fields, - with_rec_name, with_on_change) + with_rec_name) active_id = Transaction().context.get('active_id') model_name = Transaction().context.get('active_model') @@ -2245,7 +2246,7 @@ class OpenChartStart(ModelView): depends=['execution']) @classmethod - def default_get(cls, fields, with_rec_name=True, with_on_change=True): + def default_get(cls, fields, with_rec_name=True): pool = Pool() Execution = pool.get('babi.report.execution') model_name = Transaction().context.get('active_model') @@ -2253,8 +2254,7 @@ class OpenChartStart(ModelView): ('babi_model.model', '=', model_name), ], limit=1) - result = super(OpenChartStart, cls).default_get(fields, with_rec_name, - with_on_change) + result = super(OpenChartStart, cls).default_get(fields, with_rec_name) if len(executions) != 1: return result execution, = executions diff --git a/cron.py b/cron.py index 20e4a65..05a12dc 100644 --- a/cron.py +++ b/cron.py @@ -38,10 +38,9 @@ class Cron: return super(Cron, cls).create(vlist) @classmethod - def default_get(cls, fields, with_rec_name=True, with_on_change=True): + def default_get(cls, fields, with_rec_name=True): User = Pool().get('res.user') - res = super(Cron, cls).default_get(fields, with_rec_name, - with_on_change) + res = super(Cron, cls).default_get(fields, with_rec_name) cron_user, = User.search([ ('active', '=', False), ('login', '=', 'user_cron_trigger'), diff --git a/tryton.cfg b/tryton.cfg index 4bf4d8d..783875e 100644 --- a/tryton.cfg +++ b/tryton.cfg @@ -1,5 +1,5 @@ [tryton] -version=3.2.0 +version=3.4.0 depends: ir res