summaryrefslogtreecommitdiff
path: root/addons/account_tax_python/__init__.py
diff options
context:
space:
mode:
authorAdrian Torres <adt@odoo.com>2020-02-20 13:43:00 +0000
committerRaphael Collet <rco@odoo.com>2020-03-30 13:42:04 +0000
commit1daf8eb12735db5c697e4a0868b43fe44f6b2f6a (patch)
treeb02820d3679615e7e92a6258a6cc1d428db4c526 /addons/account_tax_python/__init__.py
parentf0481392c6501cae2c38359f526da1eefa451337 (diff)
[FIX] *: set ondelete policy of required Selection fields
With this commit, Selection fields with `required=True` which are extended via `selection_add` are given proper ondelete policies to ensure the cleanup of records containing these extended options during uninstall of the extending module. This commit also cleans up leftover uninstall hooks that were being used to handle the same set of problems prior to the ondelete mechanism being implemented for Selection fields. closes odoo/odoo#46325 Related: odoo/enterprise#9117 Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Diffstat (limited to 'addons/account_tax_python/__init__.py')
-rw-r--r--addons/account_tax_python/__init__.py13
1 files changed, 0 insertions, 13 deletions
diff --git a/addons/account_tax_python/__init__.py b/addons/account_tax_python/__init__.py
index 3b46f4dba2b..dc5e6b693d1 100644
--- a/addons/account_tax_python/__init__.py
+++ b/addons/account_tax_python/__init__.py
@@ -2,16 +2,3 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import models
-
-from odoo import api, SUPERUSER_ID
-
-import logging
-_logger = logging.getLogger(__name__)
-
-def uninstall_hook(cr, registry):
- env = api.Environment(cr, SUPERUSER_ID, {})
-
- code_taxes = env['account.tax'].search([('amount_type', '=', 'code')])
- code_taxes.write({'amount_type': 'percent', 'active': False})
-
- _logger.warning("The following taxes have been archived following 'account_tax_python' module uninstallation: %s" % code_taxes.ids)