From cfa0918629cc2305654ae3256c735011a67c827b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 24 Dec 2008 15:46:18 +0100 Subject: [PATCH] Don't write empty taxes when updating account taxes --- account.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/account.py b/account.py index a94aabe084..f0dc8b8eb7 100644 --- a/account.py +++ b/account.py @@ -411,9 +411,11 @@ class AccountTemplate(OSV): template = self.browse(cursor, user, template, context=context) if template.id not in template_done: - account_obj.write(cursor, user, template2account[template.id], { - 'taxes': [('add', template2tax[x.id]) for x in template.taxes], - }, context=context) + if template.taxes: + account_obj.write(cursor, user, template2account[template.id], { + 'taxes': [ + ('add', template2tax[x.id]) for x in template.taxes], + }, context=context) template_done.append(template.id) for child in template.childs: