[FIX] account: avoid tax on name search to execute request with empty journal (if...
authorMartin Trigaux <mat@openerp.com>
Tue, 22 Apr 2014 13:50:12 +0000 (15:50 +0200)
committerMartin Trigaux <mat@openerp.com>
Tue, 22 Apr 2014 13:50:12 +0000 (15:50 +0200)
bzr revid: mat@openerp.com-20140422135012-6faelx7cf0p8cvab

addons/account/account.py
addons/note/__openerp__.py

index 36d0ba0..6368149 100644 (file)
@@ -1956,15 +1956,17 @@ class account_tax(osv.osv):
         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):
+        if context is None:
+            context = {}
         journal_pool = self.pool.get('account.journal')
 
-        if context and context.has_key('type'):
+        if context.get('type'):
             if context.get('type') in ('out_invoice','out_refund'):
                 args += [('type_tax_use','in',['sale','all'])]
             elif context.get('type') in ('in_invoice','in_refund'):
                 args += [('type_tax_use','in',['purchase','all'])]
 
-        if context and context.get('journal_id'):
+        if context.get('journal_id'):
             journal = journal_pool.browse(cr, uid, context.get('journal_id'))
             if journal.type in ('sale', 'purchase'):
                 args += [('type_tax_use','in',[journal.type,'all'])]
index 2653c55..e94a5f6 100644 (file)
@@ -27,8 +27,8 @@
 This module allows users to create their own notes inside OpenERP
 =================================================================
 
-Use notes to write meeting minutes, organize ideas, organize personnal todo
-lists, etc. Each user manages his own personnal Notes. Notes are available to
+Use notes to write meeting minutes, organize ideas, organize personal todo
+lists, etc. Each user manages his own personal Notes. Notes are available to
 their authors only, but they can share notes to others users so that several
 people can work on the same note in real time. It's very efficient to share
 meeting minutes.