From bbec66b6a01300912b3609cc11027131ccc19dee Mon Sep 17 00:00:00 2001 From: Kirti Choudhary Date: Thu, 26 Jul 2018 11:08:45 +0200 Subject: [PATCH] [FIX] account: fix crash on post() action of journal entry MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commits defines a new method 'action_post()' for 'account.move' object to call instead of 'post()' from the account.move form view. Indeed, additional parameter ‘invoice’ of post() is considered as ‘context’ by webclient when called from button action and it is crashing badly. TASK ID - 1860817 --- addons/account/models/account_move.py | 4 ++++ addons/account/views/account_view.xml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index 404a8b8d1c7..7188c17499b 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -303,6 +303,10 @@ class AccountMove(models.Model): move.name = new_name return self.write({'state': 'posted'}) + @api.multi + def action_post(self): + return self.post() + @api.multi def button_cancel(self): for move in self: diff --git a/addons/account/views/account_view.xml b/addons/account/views/account_view.xml index e70b9124966..3729b6f464b 100644 --- a/addons/account/views/account_view.xml +++ b/addons/account/views/account_view.xml @@ -1492,7 +1492,7 @@
-