[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
This commit is contained in:
committed by
qdp-odoo
parent
d519082137
commit
bbec66b6a0
@@ -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:
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user