account_usability: reset to draft the bank statement do not unreconcile
This commit is contained in:
committed by
Kev-Roche
parent
fde3dfae10
commit
85f8fe5b30
@@ -42,6 +42,13 @@ class AccountBankStatement(models.Model):
|
|||||||
res.append((statement.id, name))
|
res.append((statement.id, name))
|
||||||
return res
|
return res
|
||||||
|
|
||||||
|
def button_reopen(self):
|
||||||
|
self = self.with_context(skip_undo_reconciliation=True)
|
||||||
|
return super().button_reopen()
|
||||||
|
|
||||||
|
def button_undo_reconciliation(self):
|
||||||
|
self.line_ids.button_undo_reconciliation()
|
||||||
|
|
||||||
|
|
||||||
class AccountBankStatementLine(models.Model):
|
class AccountBankStatementLine(models.Model):
|
||||||
_inherit = 'account.bank.statement.line'
|
_inherit = 'account.bank.statement.line'
|
||||||
@@ -88,3 +95,9 @@ class AccountBankStatementLine(models.Model):
|
|||||||
'res_id': self.move_id.id,
|
'res_id': self.move_id.id,
|
||||||
})
|
})
|
||||||
return action
|
return action
|
||||||
|
|
||||||
|
def button_undo_reconciliation(self):
|
||||||
|
if self._context.get("skip_undo_reconciliation"):
|
||||||
|
return
|
||||||
|
else:
|
||||||
|
return super().button_undo_reconciliation()
|
||||||
|
|||||||
@@ -13,6 +13,14 @@
|
|||||||
<field name="model">account.bank.statement</field>
|
<field name="model">account.bank.statement</field>
|
||||||
<field name="inherit_id" ref="account.view_bank_statement_form"/>
|
<field name="inherit_id" ref="account.view_bank_statement_form"/>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
|
<button name="button_reopen" position="after">
|
||||||
|
<button
|
||||||
|
name="button_undo_reconciliation"
|
||||||
|
type="object"
|
||||||
|
confirm="Are you sure to unreconcile all the entrie of the bank statement?"
|
||||||
|
states="open"
|
||||||
|
string="Unreconcile All"/>
|
||||||
|
</button>
|
||||||
<xpath expr="//field[@name='line_ids']/tree/button[@name='button_undo_reconciliation']" position="after">
|
<xpath expr="//field[@name='line_ids']/tree/button[@name='button_undo_reconciliation']" position="after">
|
||||||
<field name="move_id" invisible="1"/>
|
<field name="move_id" invisible="1"/>
|
||||||
<button name="show_account_move" type="object"
|
<button name="show_account_move" type="object"
|
||||||
|
|||||||
Reference in New Issue
Block a user