[FIX] Import exceptions.Warning as UserError.

This according to OCA guidelines.
Also reformat README.rst to keep lines within limit.
This commit is contained in:
Ronald Portier (Therp BV)
2015-10-02 00:12:32 +02:00
parent f5f892ffa9
commit 7d12ce19f1
18 changed files with 82 additions and 67 deletions

View File

@@ -17,11 +17,12 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from openerp import _, SUPERUSER_ID, exceptions
from openerp import _, SUPERUSER_ID
from openerp.exceptions import Warning as UserError
def post_init_hook(cr, pool):
'''check if your constraint was actually inserted, raise otherwise'''
"""check if your constraint was actually inserted, raise otherwise"""
if not pool['ir.model.constraint'].search(cr, SUPERUSER_ID, [
('name', '=', 'res_partner_bank_unique_number'),
('model.model', '=', 'res.partner.bank'),
@@ -51,4 +52,4 @@ def post_init_hook(cr, pool):
max_account_numbers, '\n'.join(duplicates),
max_account_numbers,
)
raise exceptions.Warning(message)
raise UserError(message)