[IMP] account_cancel: clean imports, openerp tags and correct exceptions
This commit is contained in:
committed by
Thibault Delavallée
parent
ecc9b14470
commit
153c7dcfa4
@@ -1,8 +1,8 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from openerp import models, api, _
|
||||
from openerp.exceptions import Warning
|
||||
from odoo import models, api, _
|
||||
from odoo.exceptions import UserError
|
||||
|
||||
|
||||
class BankStatement(models.Model):
|
||||
@@ -25,5 +25,5 @@ class BankStatementLine(models.Model):
|
||||
if not self.env.context.get('bank_statement_cancel'):
|
||||
for line in self:
|
||||
if line.statement_id.state == 'confirm':
|
||||
raise Warning(_("Please set the bank statement to New before canceling."))
|
||||
raise UserError(_("Please set the bank statement to New before canceling."))
|
||||
return super(BankStatementLine, self).cancel()
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<?xml version="1.0"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<record id="view_account_journal_form_inherit" model="ir.ui.view">
|
||||
<field name="name">account.journal.form</field>
|
||||
<field name="model">account.journal</field>
|
||||
@@ -69,6 +68,4 @@
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
</odoo>
|
||||
|
||||
Reference in New Issue
Block a user