TL;DR: remember `osv` and `except_orm` ? You can forget about them. * Deprecated `except_orm` dropped. * `UserError` elevated as super type of all user-related errors. * Unused `DeferredException` dropped. * Unused `QWebException` dropped (real one is in `qweb.py`). * `MailDeliveryException` made a python exception. * `name` legacy exception attribute made an alias of the python standard `args[0]` attribute and deprecated. * `value` legacy exception attribute dropped. * `exception_type` RPC error response key dropped. * Deprecated `osv` module dropped. * `--osv-memory-age-limit` cli option made an alias of `--transient-age-limit` and deprecated. The `odoo.exceptions.Warning` have long been a deprecated alias to `UserError`. It is going to be removed in a future version but first we explicitly deprecate it with a warning. The `odoo.exceptions.DeferredException` was a very old internal exception, it has been removed without deprecation notice as it is never raised. The `odoo.exceptions.except_orm` has been a deprecated exception type with deprecation warning for 5 years, it has been removed in favor of UserError which becomes the super class of all user-related errors. The `odoo.base.models.ir_mail_server.MailDeliveryException` was inheriting `except_orm`. As it is not related to a user error but is more of a problem an admin much take care of, the exception has been made a Python error. The `exception_type` JSON key in RPC error responses was holding an hardcoded value derived from the exception type. Its usage has been dropped in favor of the `name` JSON key that holds the precise exception name. Again as it was hardly used in the source code (beside the crash manager) it has been dropped without deprecation warning. Since we are here trying to clean odoo custom exceptions, we are also deprecating the `name` exception attribute in favor of the more standard `args[0]` attribute. The `name` (along with `value`) were two attributes used to raise `except_orm` exceptions before the introduction of `UserError`, `AccessError` and related exceptions. The `name` attribute, at the time, was holding the exception type/title. Nowadays it contains the error message. The `value` attribute, at the time, was holding the error message. Nowadays it is no more used. The `osv` module contains very old deprecated aliases. There is no simple way to log a deprecation warning for osv, osv_memory and osv_abstract but as they have not been in use for ages, they have been removed too. To be consistent, the `--osv-memory-age-limit` cli option has been made a deprecated alias to the `--transient-age-limit`. closes odoo/odoo#45723 Task: 2187728 Related: odoo/enterprise#9162 Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
99 lines
6.2 KiB
XML
99 lines
6.2 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<odoo>
|
|
<data>
|
|
|
|
<record id="view_test_exceptions_model" model="ir.ui.view">
|
|
<field name="name">Test exceptions</field>
|
|
<field name="model">test.exceptions.model</field>
|
|
<field name="arch" type="xml">
|
|
<form string="Test exceptions">
|
|
<p>Each button generates a specific exception on the server. The text on the right is the expected representation of the exception when displayed on the client. Button marked with a '*' use safe_eval().</p>
|
|
<separator/>
|
|
<group>
|
|
<div>
|
|
<button name="generate_redirect_warning" string="RedirectWarning" type="object" icon="fa-refresh text-primary"/>
|
|
<label for="generate_redirect_warning" string="Warning-description-redirection button"/>
|
|
</div>
|
|
<div>
|
|
<button name="generate_access_denied" string="AccessDenied" type="object" icon="fa-refresh text-primary"/>
|
|
<label for="generate_access_denied" string="Access denied-traceback"/>
|
|
</div>
|
|
<div>
|
|
<button name="generate_access_error" string="AccessError" type="object" icon="fa-refresh text-primary"/>
|
|
<label for="generate_access_error" string="Access rights error-description" class="oe_inline"/>
|
|
</div>
|
|
<div>
|
|
<button name="generate_exc_access_denied" string="Exc AccessDenied" type="object" icon="fa-refresh text-primary"/>
|
|
<label for="generate_exc_access_denied" string="Access denied-traceback"/>
|
|
</div>
|
|
<div>
|
|
<button name="generate_undefined" string="Undefined" type="object" icon="fa-refresh text-primary"/>
|
|
<label for="generate_undefined" string="Server error-traceback"/>
|
|
</div>
|
|
<div>
|
|
<button name="generate_user_error" string="UserError" type="object" icon="fa-refresh text-primary"/>
|
|
<label for="generate_user_error" string="Warning-description"/>
|
|
</div>
|
|
<div>
|
|
<button name="generate_missing_error" string="MissingError" type="object" icon="fa-refresh text-primary"/>
|
|
<label for="generate_missing_error" string="Missing Error-description"/>
|
|
</div>
|
|
<div>
|
|
<button name="generate_validation_error" string="ValidationError" type="object" icon="fa-refresh text-primary"/>
|
|
<label for="generate_validation_error" string="Validation Error-description"/>
|
|
</div>
|
|
|
|
<div>
|
|
<button name="generate_redirect_warning_safe_eval" string="RedirectWarning*" type="object" icon="fa-refresh text-primary"/>
|
|
<label for="generate_redirect_warning_safe_eval" string="Warning-description-redirection button" class="oe_inline"/>
|
|
</div>
|
|
<div>
|
|
<button name="generate_access_denied_safe_eval" string="AccessDenied*" type="object" icon="fa-refresh text-primary"/>
|
|
<label for="generate_access_denied_safe_eval" string="Access denied-traceback"/>
|
|
</div>
|
|
<div>
|
|
<button name="generate_access_error_safe_eval" string="AccessError*" type="object" icon="fa-refresh text-primary"/>
|
|
<label for="generate_access_error_safe_eval" string="Access rights error-description"/>
|
|
</div>
|
|
<div>
|
|
<button name="generate_exc_access_denied_safe_eval" string="Exc AccessDenied*" type="object" icon="fa-refresh text-primary"/>
|
|
<label for="generate_exc_access_denied_safe_eval" string="Access denied-traceback"/>
|
|
</div>
|
|
<div>
|
|
<button name="generate_undefined_safe_eval" string="Undefined*" type="object" icon="fa-refresh text-primary"/>
|
|
<label for="generate_undefined_safe_eval" string="Server error-traceback"/>
|
|
</div>
|
|
<div>
|
|
<button name="generate_user_error_safe_eval" string="UserError*" type="object" icon="fa-refresh text-primary"/>
|
|
<label for="generate_user_error_safe_eval" string="Warning-description"/>
|
|
</div>
|
|
<div>
|
|
<button name="generate_missing_error_safe_eval" string="MissingError*" type="object" icon="fa-refresh text-primary"/>
|
|
<label for="generate_missing_error_safe_eval" string="Missing Error-description"/>
|
|
</div>
|
|
<div>
|
|
<button name="generate_validation_error_safe_eval" string="ValidationError*" type="object" icon="fa-refresh text-primary"/>
|
|
<label for="generate_validation_error_safe_eval" string="Validation Error-description"/>
|
|
</div>
|
|
</group>
|
|
</form>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="action_test_exceptions" model="ir.actions.act_window">
|
|
<field name="name">Test exceptions</field>
|
|
<field name="type">ir.actions.act_window</field>
|
|
<field name="res_model">test.exceptions.model</field>
|
|
<field name="view_mode">form</field>
|
|
<field name="target">new</field>
|
|
</record>
|
|
|
|
<menuitem id="menu_test_exceptions" parent="base.menu_tests" name="Test exceptions"/>
|
|
|
|
<menuitem id="menu_test_exceptions_leaf"
|
|
name="Test exceptions"
|
|
action="action_test_exceptions"
|
|
parent="menu_test_exceptions"/>
|
|
</data>
|
|
</odoo>
|