FIX obvious error in my previous commit

This commit is contained in:
Alexis de Lattre
2016-04-14 13:42:44 +02:00
parent b7ab16477a
commit 932de847b6

View File

@@ -184,13 +184,17 @@ class AccountBankStatementLine(models.Model):
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
if self.journal_entry_id:
action.update({
'views': False,
'view_id': False,
'view_mode': 'form,tree',
'res_id': self.journal_entry_id.id,
})
return action
else:
raise UserError(_(
'No journal entry linked to this bank statement line.'))
class ResPartner(models.Model):
_inherit = 'res.partner'