From 8d225e0ef286845075daa2fbbddf4a9c746adb26 Mon Sep 17 00:00:00 2001 From: "Somesh(OpenERP)" <> Date: Tue, 1 Feb 2011 12:12:45 +0530 Subject: [PATCH] [FIX] Automated actions: Should never entertain context=None (Ref : Maintenance case 3924) bzr revid: jvo@tinyerp.com-20110201064245-c6on0hoj1tdqrfgd --- addons/account/invoice.py | 6 ++++++ addons/base_action_rule/base_action_rule.py | 2 ++ 2 files changed, 8 insertions(+) diff --git a/addons/account/invoice.py b/addons/account/invoice.py index 7d2ef5a674f..fcaeb42c01f 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -353,6 +353,8 @@ class account_invoice(osv.osv): raise orm.except_orm(_('Unknown Error'), str(e)) def confirm_paid(self, cr, uid, ids, context=None): + if context is None: + context = {} self.write(cr, uid, ids, {'state':'paid'}, context=context) for inv_id, name in self.name_get(cr, uid, ids, context=context): message = _("Invoice '%s' is paid.") % name @@ -360,6 +362,8 @@ class account_invoice(osv.osv): return True def unlink(self, cr, uid, ids, context=None): + if context is None: + context = {} invoices = self.read(cr, uid, ids, ['state'], context=context) unlink_ids = [] for t in invoices: @@ -598,6 +602,8 @@ class account_invoice(osv.osv): return res def copy(self, cr, uid, id, default={}, context=None): + if context is None: + context = {} default.update({ 'state':'draft', 'number':False, diff --git a/addons/base_action_rule/base_action_rule.py b/addons/base_action_rule/base_action_rule.py index d528aaae28e..2a4e2c0e4e1 100644 --- a/addons/base_action_rule/base_action_rule.py +++ b/addons/base_action_rule/base_action_rule.py @@ -179,6 +179,8 @@ the rule to mark CC(mail to any other person defined in actions)."), if context is None: context = {} def make_call_old(cr, uid, ids, vals, context=context): + if context is None: + context = {} if isinstance(ids, (str, int, long)): ids = [ids] if not context.get('action'):