From 5161e25112f443401a11835798b0a2cf38ae2ef8 Mon Sep 17 00:00:00 2001 From: Raphael Collet Date: Mon, 23 May 2016 16:07:12 +0200 Subject: [PATCH] [FIX] models: in `_write()`, the smallest `parent_left` is 0 instead of 1 --- openerp/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openerp/models.py b/openerp/models.py index 6f9fb12c11f..440bfb374bf 100644 --- a/openerp/models.py +++ b/openerp/models.py @@ -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