From 3a9d55cd6151e6a9c366fbd6549b838c1f2163dc Mon Sep 17 00:00:00 2001
From: Fabien Morin <fabien@nexedi.com>
Date: Fri, 11 Dec 2009 15:55:53 +0000
Subject: [PATCH] - improve the way to store attributes. - remove "if new_node
 is not None" expression because now their is a render_odg   method defined on
 Widget Class

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@31250 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5OOo/FormPrintout.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/product/ERP5OOo/FormPrintout.py b/product/ERP5OOo/FormPrintout.py
index 845054eba0..a0845a7fa5 100644
--- a/product/ERP5OOo/FormPrintout.py
+++ b/product/ERP5OOo/FormPrintout.py
@@ -956,8 +956,8 @@ class ODGStrategy(ODFStrategy):
       node_list = element_tree.xpath(text_xpath, namespaces=element_tree.nsmap)
       for target_node in node_list:
         attr_dict = {}
-        attr_dict.update(target_node.attrib)
+        # store child style using their local-name as key
+        for descendant in target_node.iterdescendants():
+          attr_dict.setdefault(descendant.tag, {}).update(descendant.attrib)
         new_node = field.render_odg(attr_dict=attr_dict)
-        if new_node is not None: # XXX None node exists because render_odg is
-                                 # not yet writed for all fields, but it should
-          parent_node = target_node.getparent().replace(target_node, new_node)
+        parent_node = target_node.getparent().replace(target_node, new_node)
-- 
2.30.9