summaryrefslogtreecommitdiff
path: root/addons/mass_mailing/models
diff options
context:
space:
mode:
authorAdrian Torres <adt@odoo.com>2018-06-11 09:47:34 +0200
committerGitHub <noreply@github.com>2018-06-11 09:47:34 +0200
commit503b8ed6925eddc36afd05683eaaad1a93312c8d (patch)
tree06f26ae173a08b792ef5bd32779de0f9561b5fdb /addons/mass_mailing/models
parentc0aacce182790ed909cc3b556826e3276a21a565 (diff)
[FIX] *: cleanup (un|re)installation hacks
Replace hacks introduced in V11 by the proper solution.
Diffstat (limited to 'addons/mass_mailing/models')
-rw-r--r--addons/mass_mailing/models/__init__.py1
-rw-r--r--addons/mass_mailing/models/ir_model_fields.py30
2 files changed, 0 insertions, 31 deletions
diff --git a/addons/mass_mailing/models/__init__.py b/addons/mass_mailing/models/__init__.py
index ee8bfe34058..baa418a63a9 100644
--- a/addons/mass_mailing/models/__init__.py
+++ b/addons/mass_mailing/models/__init__.py
@@ -8,5 +8,4 @@ from . import mail_thread
from . import res_config_settings
from . import mass_mailing_report
from . import link_tracker
-from . import ir_model_fields
from . import res_users
diff --git a/addons/mass_mailing/models/ir_model_fields.py b/addons/mass_mailing/models/ir_model_fields.py
deleted file mode 100644
index 1e963bf650e..00000000000
--- a/addons/mass_mailing/models/ir_model_fields.py
+++ /dev/null
@@ -1,30 +0,0 @@
-# -*- coding: utf-8 -*-
-# Part of Odoo. See LICENSE file for full copyright and licensing details
-
-from odoo import api, models
-
-
-# This is a nasty hack, targeted for V11 only
-class IrModelFields(models.Model):
- _inherit = 'ir.model.fields'
-
- @api.multi
- def unlink(self):
- # Prevent the deletion of social_* fields defined in res.company if
- # the other module is installed
- social = (
- 'social_facebook',
- 'social_github',
- 'social_googleplus',
- 'social_linkedin',
- 'social_twitter',
- 'social_youtube',
- )
-
- self = self.filtered(
- lambda rec: not (
- rec.model == 'res.company' and
- rec.name in social
- )
- )
- return super(IrModelFields, self).unlink()