From fc1fbd3fcb73c80c94cf5350e0bc2be12abcb4f3 Mon Sep 17 00:00:00 2001 From: Laurent Smet Date: Mon, 5 Oct 2020 08:53:12 +0000 Subject: [PATCH] [FIX] account: Fix traceback when opening auto entries with multilines Introduced by: https://github.com/odoo/odoo/commit/f9ef2c8cd980ecb9eee22d4cc43d5291953471ef `self.id` is making an `ensure_one` raising a traceback when trying to open the wizard with more than one selected line. closes odoo/odoo#59088 X-original-commit: 587c1d0f9bddd7bcc3d8d165d6d3073387dfe73f Signed-off-by: oco-odoo --- addons/account/models/account_move.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index 73948d81b86..1f3ff0cb72b 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -4666,7 +4666,7 @@ class AccountMoveLine(models.Model): [action] = self.env.ref('account.account_automatic_entry_wizard_action').read() # Force the values of the move line in the context to avoid issues ctx = dict(self.env.context) - ctx['active_id'] = self.id + ctx.pop('active_id', None) ctx['active_ids'] = self.ids ctx['active_model'] = 'account.move.line' action['context'] = ctx