diff options
| author | Olivier Dony <odo@openerp.com> | 2011-02-04 00:00:23 +0100 |
|---|---|---|
| committer | Olivier Dony <odo@openerp.com> | 2011-02-04 00:00:23 +0100 |
| commit | 1eca241d52d7637ad5b7195e12e79997c945a854 (patch) | |
| tree | 73983e0812ba419afaac50772c968def151793cd /bin | |
| parent | 4900c4184256e7f7ac535ac78a6f08cf87ab52bf (diff) | |
| parent | 22a2fc6aa6d1a64a57be706c88daeae07e43b4fb (diff) | |
[MERGE] merged latest fixes from 6.0, up to rev 3334
bzr revid: odo@openerp.com-20110203230023-o2a0b5tovewu0ft2
Diffstat (limited to 'bin')
| -rw-r--r-- | bin/osv/orm.py | 9 | ||||
| -rw-r--r-- | bin/release.py | 2 |
2 files changed, 8 insertions, 3 deletions
diff --git a/bin/osv/orm.py b/bin/osv/orm.py index 20e7089057d..df458553d3b 100644 --- a/bin/osv/orm.py +++ b/bin/osv/orm.py @@ -3426,14 +3426,19 @@ class orm(orm_template): clause, params = '%s=%%s' % (self._parent_name,), (parent_val,) else: clause, params = '%s IS NULL' % (self._parent_name,), () - cr.execute('SELECT parent_right, id FROM %s WHERE %s ORDER BY %s' % (self._table, clause, order), params) - parents = cr.fetchall() for id in parents_changed: cr.execute('SELECT parent_left, parent_right FROM %s WHERE id=%%s' % (self._table,), (id,)) pleft, pright = cr.fetchone() distance = pright - pleft + 1 + # Positions of current siblings, to locate proper insertion point; + # this can _not_ be fetched outside the loop, as it needs to be refreshed + # after each update, in case several nodes are sequentially inserted one + # next to the other (i.e computed incrementally) + cr.execute('SELECT parent_right, id FROM %s WHERE %s ORDER BY %s' % (self._table, clause, order), params) + parents = cr.fetchall() + # Find Position of the element position = None for (parent_pright, parent_id) in parents: diff --git a/bin/release.py b/bin/release.py index 56885f02d1e..5ae15a05bd9 100644 --- a/bin/release.py +++ b/bin/release.py @@ -21,7 +21,7 @@ ############################################################################## name = 'openerp-server' -version = '6.0.0' +version = '6.0.1' major_version = '6.0' description = 'OpenERP Server' long_desc = '''OpenERP is a complete ERP and CRM. The main features are accounting (analytic |
