from openerp.exceptions import UserError def process_data(data): if not data: raise UserError("No data found.") # process data here
from openerp.exceptions import UserError def validate_data(data): if len(data) < 10: raise UserError("At least %s items are required. Current items: %s" % (10, len(data))) # process validated data herePackage Library: The openerp.exceptions UserError is a feature of the Odoo/OpenERP framework, and therefore, it is not available as a package library. The exception class is defined in the openerp.exceptions module, which is part of the core Odoo/OpenERP framework.