From a60364a5e44d27514af021580cb9f5b12ca0cbce Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Fri, 14 Feb 2020 10:57:36 +0100 Subject: [PATCH] [FIX] rendering of tables with merged cells Merged cells in the first columns were not rendered correctly and values from other columns would be placed in the wrong columns. --- _extensions/odoo/translator.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/_extensions/odoo/translator.py b/_extensions/odoo/translator.py index 168262350..f95622e0f 100644 --- a/_extensions/odoo/translator.py +++ b/_extensions/odoo/translator.py @@ -433,7 +433,12 @@ class BootstrapTranslator(nodes.NodeVisitor, object): tagname = 'th' else: tagname = 'td' - self.body.append(self.starttag(node, tagname)) + attrs = {} + if 'morerows' in node: + attrs['rowspan'] = node['morerows']+1 + if 'morecols' in node: + attrs['colspan'] = node['morecols']+1 + self.body.append(self.starttag(node, tagname, **attrs)) self.context.append(tagname) def depart_entry(self, node): self.body.append(u''.format(self.context.pop()))