Don't write empty taxes when updating account taxes

This commit is contained in:
Cédric Krier committed 2008-12-24 15:46:18 +01:00
1 parent 55cced068a
commit cfa0918629
1 file changed
+5 -3
+5 -3
View File
@@ -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: