diff options
| author | Somesh(OpenERP) <> | 2011-02-01 12:12:45 +0530 |
|---|---|---|
| committer | Jay Vora (OpenERP) <jvo@tinyerp.com> | 2011-02-01 12:12:45 +0530 |
| commit | 8d225e0ef286845075daa2fbbddf4a9c746adb26 (patch) | |
| tree | 02bd4ed2e75b4e22a66faec88ecdc78dde17e263 | |
| parent | b3f4b680dce327fec771d0a031a0ebdd0bab94f6 (diff) | |
[FIX] Automated actions: Should never entertain context=None (Ref : Maintenance case 3924)
bzr revid: jvo@tinyerp.com-20110201064245-c6on0hoj1tdqrfgd
| -rw-r--r-- | addons/account/invoice.py | 6 | ||||
| -rw-r--r-- | addons/base_action_rule/base_action_rule.py | 2 |
2 files changed, 8 insertions, 0 deletions
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'): |
