[tryton-debian-vcs] tryton-server branch debian-jessie-3.2 updated. debian/3.2.9-1-2-gcec708a
Mathias Behrle
tryton-debian-vcs at alioth.debian.org
Fri Nov 13 19:32:00 UTC 2015
The following commit has been merged in the debian-jessie-3.2 branch:
https://alioth.debian.org/plugins/scmgit/cgi-bin/gitweb.cgi/?p=tryton/tryton-server.git;a=commitdiff;h=debian/3.2.9-1-2-gcec708a
commit cec708a0f23765a98757188b6efd016f7df404d2
Author: Mathias Behrle <mathiasb at m9s.biz>
Date: Fri Nov 13 18:25:16 2015 +0100
Releasing debian version 3.2.10-1.
Signed-off-by: Mathias Behrle <mathiasb at m9s.biz>
diff --git a/debian/changelog b/debian/changelog
index af06338..9bcb90d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+tryton-server (3.2.10-1) unstable; urgency=medium
+
+ * Merging upstream version 3.2.10.
+
+ -- Mathias Behrle <mathiasb at m9s.biz> Fri, 13 Nov 2015 18:25:16 +0100
+
tryton-server (3.2.9-1) unstable; urgency=medium
* Merging upstream version 3.2.9.
commit 6e02e0ec2ba7d884fbc7d5076100bfb0bcc52050
Author: Mathias Behrle <mathiasb at m9s.biz>
Date: Fri Nov 13 18:25:16 2015 +0100
Merging upstream version 3.2.10.
diff --git a/CHANGELOG b/CHANGELOG
index fae7c9c..3c766d7 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,6 @@
+Version 3.2.10 - 2015-11-09
+* Bug fixes (see mercurial logs for details)
+
Version 3.2.9 - 2015-09-07
* Bug fixes (see mercurial logs for details)
diff --git a/PKG-INFO b/PKG-INFO
index 63140e1..901d0c6 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: trytond
-Version: 3.2.9
+Version: 3.2.10
Summary: Tryton server
Home-page: http://www.tryton.org/
Author: Tryton
diff --git a/trytond.egg-info/PKG-INFO b/trytond.egg-info/PKG-INFO
index 63140e1..901d0c6 100644
--- a/trytond.egg-info/PKG-INFO
+++ b/trytond.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: trytond
-Version: 3.2.9
+Version: 3.2.10
Summary: Tryton server
Home-page: http://www.tryton.org/
Author: Tryton
diff --git a/trytond/convert.py b/trytond/convert.py
index 378da55..73cb98c 100644
--- a/trytond/convert.py
+++ b/trytond/convert.py
@@ -798,10 +798,10 @@ def post_import(pool, module, to_delete):
object_name_list = set(pool.object_name_list())
for mrec in mdata:
- model, db_id = mrec.model, mrec.db_id
+ model, db_id, fs_id = mrec.model, mrec.db_id, mrec.fs_id
logging.getLogger("convert").info(
- 'Deleting %s@%s' % (db_id, model))
+ 'Deleting %s@%s from %s.%s', db_id, model, module, fs_id)
try:
# Deletion of the record
if model in object_name_list:
@@ -825,9 +825,15 @@ def post_import(pool, module, to_delete):
'Exception: %s' %
(db_id, model, tb_s))
if 'active' in Model._fields:
- Model.write([Model(db_id)], {
- 'active': False,
- })
+ try:
+ Model.write([Model(db_id)], {
+ 'active': False,
+ })
+ except Exception:
+ cursor.rollback()
+ logging.getLogger("convert").error(
+ 'Could not inactivate id: %d of model %s\n',
+ db_id, model, exc_info=True)
# Clean model_data:
if mdata_delete:
diff --git a/trytond/model/modelsql.py b/trytond/model/modelsql.py
index cf4f089..daf8e4b 100644
--- a/trytond/model/modelsql.py
+++ b/trytond/model/modelsql.py
@@ -967,7 +967,7 @@ class ModelSQL(ModelStorage):
cursor.execute(*table.delete(where=red_sql))
except DatabaseIntegrityError, exception:
with Transaction().new_cursor():
- cls.__raise_integrity_error(exception, [])
+ cls.__raise_integrity_error(exception, {})
raise
Translation.delete_ids(cls.__name__, 'model', ids)
@@ -1176,10 +1176,24 @@ class ModelSQL(ModelStorage):
raise Exception('ValidateError',
'You can not update fields: "%s", "%s"' %
(field.left, field.right))
+
+ # Nested creation require a rebuild
+ # because initial values are 0
+ # and thus _update_tree can not find the children
+ table = cls.__table__()
+ parent = cls.__table__()
+ cursor.execute(*table.join(parent,
+ condition=Column(table, field_name) == parent.id
+ ).select(table.id,
+ where=(Column(parent, field.left) == 0)
+ & (Column(parent, field.right) == 0)))
+ nested_create = cursor.fetchone()
+
if count is None:
- cursor.execute(*cls.__table__().select(Count(Literal(1))))
+ cursor.execute(*table.select(Count(Literal(1))))
count, = cursor.fetchone()
- if len(ids) < count / 4:
+
+ if not nested_create and len(ids) < count / 4:
for id_ in ids:
cls._update_tree(id_, field_name,
field.left, field.right)
diff --git a/trytond/model/modelstorage.py b/trytond/model/modelstorage.py
index 1982ab2..358f9c9 100644
--- a/trytond/model/modelstorage.py
+++ b/trytond/model/modelstorage.py
@@ -288,9 +288,18 @@ class ModelStorage(Model):
del data['id']
return data
+ # Reset MPTT field to the default value
+ mptt = set()
+ for field in cls._fields.itervalues():
+ if (isinstance(field, fields.Many2One)
+ and field.model_name == cls.__name__
+ and field.left and field.right):
+ mptt.add(field.left)
+ mptt.add(field.right)
fields_names = [n for n, f in cls._fields.iteritems()
if (not isinstance(f, fields.Function)
- or isinstance(f, fields.Property))]
+ or isinstance(f, fields.Property))
+ and n not in mptt]
ids = map(int, records)
datas = cls.read(ids, fields_names=fields_names)
datas = dict((d['id'], d) for d in datas)
diff --git a/trytond/version.py b/trytond/version.py
index c154501..5bafe45 100644
--- a/trytond/version.py
+++ b/trytond/version.py
@@ -1,6 +1,6 @@
#This file is part of Tryton. The COPYRIGHT file at the top level of
#this repository contains the full copyright notices and license terms.
PACKAGE = "trytond"
-VERSION = "3.2.9"
+VERSION = "3.2.10"
LICENSE = "GPL-3"
WEBSITE = "http://www.tryton.org/"
--
tryton-server
More information about the tryton-debian-vcs
mailing list