[FIX] Automated actions: Should never entertain context=None (Ref : Maintenance case 3924)
bzr revid: jvo@tinyerp.com-20110201064245-c6on0hoj1tdqrfgd
This commit is contained in:
parent
b3f4b680dc
commit
8d225e0ef2
|
@ -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,
|
||||
|
|
|
@ -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'):
|
||||
|
|
Loading…
Reference in New Issue