From 27ca1f1ea1f5ea7f487beb29f8c1265b8a71e4ea Mon Sep 17 00:00:00 2001 From: Mustufa Rangwala Date: Thu, 23 Sep 2010 16:04:45 +0530 Subject: [PATCH] [FIX] Account: account tax -> correct attrs and put the 0 if the type is none or python code bzr revid: mra@mra-laptop-20100923103445-88r6hax8nd6beg60 --- addons/account/account.py | 5 +++++ addons/account/account_view.xml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/addons/account/account.py b/addons/account/account.py index 282233276c6..0c1bfa62409 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -1701,6 +1701,11 @@ class account_tax(osv.osv): ids = self.search(cr, user, args, limit=limit, context=context) return self.name_get(cr, user, ids, context=context) + def write(self, cr, uid, ids, vals, context=None): + if vals.get('type', False) and vals['type'] in ('none', 'code'): + vals.update({'amount': 0.0}) + return super(account_tax, self).write(cr, uid, ids, vals, context=context) + def search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False): journal_pool = self.pool.get('account.journal') diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index bfe32537708..6d3f63118e1 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -849,7 +849,7 @@ - +