From 3a5ce2a3120f453d5fcb7c5cc6605e1ccd91b2dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Tue, 20 Mar 2012 15:45:48 +0100 Subject: [PATCH] [IMP] Minor tweak: protected a dictionary access with dict.get bzr revid: tde@openerp.com-20120320144548-coumjq28pn7ce4zg --- addons/account/account_invoice.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index 569abbd32ed..7c4bd88e3c5 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -1247,9 +1247,11 @@ class account_invoice(osv.osv): # Update the stored value (fields.function), so we write to trigger recompute self.pool.get('account.invoice').write(cr, uid, ids, {}, context=context) return True - # ----------------------------- - # OpenChatter and notifications - # ----------------------------- + + # ----------------------------------------- + # OpenChatter notifications and need_action + # ----------------------------------------- + def _get_document_type(self, type): type_dict = { 'out_invoice': 'Customer invoice', @@ -1257,7 +1259,7 @@ class account_invoice(osv.osv): 'out_refund': 'Customer Refund', 'in_refund': 'Supplier Refund', } - return type_dict[type] + return type_dict.get(type, 'Invoice') def create_send_note(self, cr, uid, ids, context=None): for obj in self.browse(cr, uid, ids, context=context):