From a437ed28445ff31a9a209b2f4d5d2191eb5a3307 Mon Sep 17 00:00:00 2001 From: Arnaud Pineux Date: Fri, 2 Nov 2012 14:35:40 +0100 Subject: [PATCH] Lunch bzr revid: api@openerp.com-20121102133540-274avzvzg1klo6d0 --- addons/lunch/lunch.py | 3 ++- addons/lunch/lunch_view.xml | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/lunch/lunch.py b/addons/lunch/lunch.py index c0e5ed78e3e..eb22c3133ce 100644 --- a/addons/lunch/lunch.py +++ b/addons/lunch/lunch.py @@ -225,7 +225,8 @@ class lunch_order(osv.Model): doc = etree.XML(res['arch']) node = doc.xpath("//div[@name='preferences']") to_add = etree.fromstring(text_xml) - node[0].append(to_add) + if node and len(node)>0: + node[0].append(to_add) res['arch'] = etree.tostring(doc) return res diff --git a/addons/lunch/lunch_view.xml b/addons/lunch/lunch_view.xml index 8fa9962193a..5efc0eed12c 100644 --- a/addons/lunch/lunch_view.xml +++ b/addons/lunch/lunch_view.xml @@ -312,6 +312,7 @@ Orders Tree View lunch.order + tree