summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKirti Choudhary <kic@odoo.com>2018-07-26 11:08:45 +0200
committerqdp-odoo <qdp@odoo.com>2018-07-26 11:09:35 +0200
commitbbec66b6a01300912b3609cc11027131ccc19dee (patch)
treeffeeec81ce697a7c06e7b797f11b09a388d553e9
parentd519082137db819cd3779142c4996a4f194704ca (diff)
[FIX] account: fix crash on post() action of journal entry
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
-rw-r--r--addons/account/models/account_move.py4
-rw-r--r--addons/account/views/account_view.xml2
2 files changed, 5 insertions, 1 deletions
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
@@ -304,6 +304,10 @@ class AccountMove(models.Model):
return self.write({'state': 'posted'})
@api.multi
+ def action_post(self):
+ return self.post()
+
+ @api.multi
def button_cancel(self):
for move in self:
if not move.journal_id.update_posted:
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 @@
<field name="arch" type="xml">
<form string="Account Entry">
<header>
- <button name="post" states="draft" string="Post" type="object" class="oe_highlight" groups="account.group_account_invoice"/>
+ <button name="action_post" states="draft" string="Post" type="object" class="oe_highlight" groups="account.group_account_invoice"/>
<button name="%(action_view_account_move_reversal)d" states="posted" string="Reverse Entry" type="action" groups="account.group_account_invoice"/>
<field name="state" widget="statusbar"/>
</header>