[FIX] models: in _write(), the smallest parent_left is 0 instead of 1

This commit is contained in:
Raphael Collet
2016-06-16 16:50:47 +02:00
parent 19561727a7
commit 5161e25112
+1 -1
View File
@@ -4078,7 +4078,7 @@ class BaseModel(object):
if not pleft1:
# the current record is the first node of the parent
if not parent_val:
pleft1 = 1
pleft1 = 0 # the first node starts at 0
else:
cr.execute('SELECT parent_left FROM %s WHERE id=%%s' % self._table, (parent_val,))
pleft1 = cr.fetchone()[0] + 1