-
- Downloads
[REF] base: Remove deprecated exceptions and osv
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>
Showing
- addons/account_facturx/models/account_move.py 2 additions, 2 deletionsaddons/account_facturx/models/account_move.py
- addons/auth_signup/controllers/main.py 2 additions, 2 deletionsaddons/auth_signup/controllers/main.py
- addons/delivery/models/delivery_grid.py 1 addition, 1 deletionaddons/delivery/models/delivery_grid.py
- addons/http_routing/models/ir_http.py 2 additions, 3 deletionsaddons/http_routing/models/ir_http.py
- addons/mail/models/mail_mail.py 1 addition, 3 deletionsaddons/mail/models/mail_mail.py
- addons/mail/wizard/mail_template_preview.py 1 addition, 1 deletionaddons/mail/wizard/mail_template_preview.py
- addons/mrp/tests/test_stock.py 2 additions, 2 deletionsaddons/mrp/tests/test_stock.py
- addons/payment_authorize/controllers/main.py 1 addition, 1 deletionaddons/payment_authorize/controllers/main.py
- addons/point_of_sale/static/src/js/models.js 0 additions, 12 deletionsaddons/point_of_sale/static/src/js/models.js
- addons/test_mail/tests/test_mail_channel.py 3 additions, 7 deletionsaddons/test_mail/tests/test_mail_channel.py
- addons/test_mail/tests/test_mail_message.py 7 additions, 11 deletionsaddons/test_mail/tests/test_mail_message.py
- addons/web/controllers/main.py 2 additions, 2 deletionsaddons/web/controllers/main.py
- addons/web/static/src/js/services/crash_manager.js 25 additions, 53 deletionsaddons/web/static/src/js/services/crash_manager.js
- addons/web/static/tests/chrome/action_manager_tests.js 0 additions, 1 deletionaddons/web/static/tests/chrome/action_manager_tests.js
- addons/web_editor/static/src/js/editor/rte.js 1 addition, 1 deletionaddons/web_editor/static/src/js/editor/rte.js
- addons/website/models/ir_http.py 1 addition, 1 deletionaddons/website/models/ir_http.py
- addons/website_slides/controllers/main.py 6 additions, 6 deletionsaddons/website_slides/controllers/main.py
- odoo/addons/base/models/ir_actions.py 1 addition, 0 deletionsodoo/addons/base/models/ir_actions.py
- odoo/addons/base/models/ir_mail_server.py 3 additions, 4 deletionsodoo/addons/base/models/ir_mail_server.py
- odoo/addons/base/tests/test_ir_filters.py 2 additions, 2 deletionsodoo/addons/base/tests/test_ir_filters.py
Loading
Please register or sign in to comment