FIX obvious error in my previous commit
This commit is contained in:
@@ -184,13 +184,17 @@ class AccountBankStatementLine(models.Model):
|
|||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
action = self.env['ir.actions.act_window'].for_xml_id(
|
action = self.env['ir.actions.act_window'].for_xml_id(
|
||||||
'account', 'action_move_journal_line')
|
'account', 'action_move_journal_line')
|
||||||
|
if self.journal_entry_id:
|
||||||
action.update({
|
action.update({
|
||||||
'views': False,
|
'views': False,
|
||||||
'view_id': False,
|
'view_id': False,
|
||||||
'view_mode': 'form,tree',
|
'view_mode': 'form,tree',
|
||||||
'res_id': self.id,
|
'res_id': self.journal_entry_id.id,
|
||||||
})
|
})
|
||||||
return action
|
return action
|
||||||
|
else:
|
||||||
|
raise UserError(_(
|
||||||
|
'No journal entry linked to this bank statement line.'))
|
||||||
|
|
||||||
class ResPartner(models.Model):
|
class ResPartner(models.Model):
|
||||||
_inherit = 'res.partner'
|
_inherit = 'res.partner'
|
||||||
|
|||||||
Reference in New Issue
Block a user