From 117fa448dd539ede006d9997bcb900f71d85837e Mon Sep 17 00:00:00 2001 From: Joel Grand-Guillaume Date: Mon, 21 Jan 2013 15:34:47 +0100 Subject: [PATCH] [FIX] Add the key 'from_parent_object' in context when creating move from invoice. --- account_constraints/account_constraints.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/account_constraints/account_constraints.py b/account_constraints/account_constraints.py index d1ecead4e..22c6f550e 100644 --- a/account_constraints/account_constraints.py +++ b/account_constraints/account_constraints.py @@ -143,6 +143,14 @@ class AccountInvoice(orm.Model): context['from_parent_object'] = True return super(AccountInvoice, self).action_cancel(cr, uid, ids, context=context) + def action_move_create(self, cr, uid, ids, context=None): + """Override the method to add the key 'from_parent_object' in + the context.""" + if context is None: + context = {} + context['from_parent_object'] = True + return super(AccountInvoice,self).action_move_create(cr, uid, ids, context=context) + class AccountBankStatement(orm.Model): _inherit = "account.bank.statement"