Add button to show account move from bank statement line

This commit is contained in:
Alexis de Lattre
2016-04-14 11:52:53 +02:00
parent d7085dad70
commit 53a1f50f10
2 changed files with 25 additions and 0 deletions

View File

@@ -179,6 +179,18 @@ class AccountBankStatementLine(models.Model):
search_reconciliation_proposition=search_rec_prop,
context=context)
@api.multi
def show_account_move(self):
self.ensure_one()
action = self.env['ir.actions.act_window'].for_xml_id(
'account', 'action_move_journal_line')
action.update({
'views': False,
'view_id': False,
'view_mode': 'form,tree',
'res_id': self.id,
})
return action
class ResPartner(models.Model):
_inherit = 'res.partner'

View File

@@ -182,5 +182,18 @@
</field>
</record>
<record id="view_bank_statement_form" model="ir.ui.view">
<field name="name">usability.account.bank.statement.form</field>
<field name="model">account.bank.statement</field>
<field name="inherit_id" ref="account.view_bank_statement_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='line_ids']/tree/field[@name='bank_account_id']" position="after">
<!-- The cancel button is provided by the account_cancel module, but we don't want to depend on it -->
<button name="show_account_move" type="object"
string="View Account Move" icon="gtk-redo"/>
</xpath>
</field>
</record>
</data>
</openerp>