[FIX] Automated actions: Should never entertain context=None (Ref : Maintenance case 3924)

bzr revid: jvo@tinyerp.com-20110201064245-c6on0hoj1tdqrfgd
This commit is contained in:
Somesh(OpenERP) 2011-02-01 12:12:45 +05:30 committed by Jay Vora (OpenERP)
parent b3f4b680dc
commit 8d225e0ef2
2 changed files with 8 additions and 0 deletions

View File

@ -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,

View File

@ -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'):