From 3ac210297aabbbd43ea65732f8bd5ce105bfba9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 29 May 2008 11:22:12 +0200 Subject: [PATCH] Remove group tag if there is no root analytic account --- account.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/account.py b/account.py index 0139a940ac..b02ec89568 100644 --- a/account.py +++ b/account.py @@ -239,6 +239,9 @@ class Account(OSV): root_account_ids = self.search(cursor, user, [ ('parent', '=', False), ], context=context) + if not root_account_ids: + node_accounts.parentNode.parentNode.removeChild(node_accounts.parentNode) + return for account_id in root_account_ids: newnode = node_accounts.cloneNode(1) newnode.tagName = 'label'