From 0932863bb99ffcb6042c19833135b04709190e32 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 dac9ba4a48c..e9204babe63 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 7072abcad6f..30c8e63ae1d 100644 --- a/addons/account/views/account_view.xml +++ b/addons/account/views/account_view.xml @@ -1500,7 +1500,7 @@
-