From f3a40b250bb168fec39e394f31955a5b1a50435d Mon Sep 17 00:00:00 2001 From: Guewen Baconnier Date: Mon, 28 Jan 2013 10:15:30 +0100 Subject: [PATCH] [FIX] initialize context to a dict if it is None as we want to get a key --- account_constraints/account_constraints.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/account_constraints/account_constraints.py b/account_constraints/account_constraints.py index 40e320920..14f2628a3 100644 --- a/account_constraints/account_constraints.py +++ b/account_constraints/account_constraints.py @@ -72,6 +72,8 @@ class AccountMoveLine(orm.Model): This is mandatory if you use the module setting all moves in draft (module: account_default_draft_move) """ + if context is None: + context = {} if not context.get('from_parent_object', False): self._check_invoice_related_move(cr, uid, ids, context=context) self._check_statement_related_move(cr, uid, ids, context=context) @@ -86,6 +88,8 @@ class AccountMoveLine(orm.Model): This is mandatory if you use the module setting all moves in draft (module: account_default_draft_move) """ + if context is None: + context = {} if not context.get('from_parent_object', False): self._check_invoice_related_move(cr, uid, ids, context=context) self._check_statement_related_move(cr, uid, ids, context=context)