summaryrefslogtreecommitdiff
path: root/addons/payment_authorize
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/payment_authorize
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/payment_authorize')
-rw-r--r--addons/payment_authorize/models/payment.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/addons/payment_authorize/models/payment.py b/addons/payment_authorize/models/payment.py
index d6e08fda0e5..3c89c36b5da 100644
--- a/addons/payment_authorize/models/payment.py
+++ b/addons/payment_authorize/models/payment.py
@@ -19,7 +19,9 @@ _logger = logging.getLogger(__name__)
class PaymentAcquirerAuthorize(models.Model):
_inherit = 'payment.acquirer'
- provider = fields.Selection(selection_add=[('authorize', 'Authorize.Net')])
+ provider = fields.Selection(selection_add=[
+ ('authorize', 'Authorize.Net')
+ ], ondelete={'authorize': 'set default'})
authorize_login = fields.Char(string='API Login Id', required_if_provider='authorize', groups='base.group_user')
authorize_transaction_key = fields.Char(string='API Transaction Key', required_if_provider='authorize', groups='base.group_user')
authorize_signature_key = fields.Char(string='API Signature Key', required_if_provider='authorize', groups='base.group_user')