summaryrefslogtreecommitdiff
path: root/addons/fetchmail
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2019-08-05 09:07:26 +0000
committerChristophe Simonis <chs@odoo.com>2019-08-05 09:36:41 +0000
commit886eca0131716e137e60a1e398a9fc3996dfa425 (patch)
tree00ac8640600ae255631c768dff54cc3ff9efad49 /addons/fetchmail
parent0033659ff4c6efac8209d5fec9d0f4f02b2bbebd (diff)
[IMP] *: remove usage of `oldname` attribute
This attribute is misleading as it is insufficient to correctly upgrade the database. It only renames the column in the database, but other operations are needed, like updating the corresponding `ir.model.fields` record (and its xmlid). The default values and the translations are also lost during the upgrade. Moreover, this feature was misused. It was: - left on fields during multiple versions. - used on reports (SQL views). This would be ok if the feature was complete, but, as is, it was useless. - kept unchanged after a second renaming of the field (which can happen versions later the first rename). - used, even when the meaning of the field changed. i.e. the field `archived` has been renamed to the classic `active`, but the value in the database should be switched.
Diffstat (limited to 'addons/fetchmail')
-rw-r--r--addons/fetchmail/models/fetchmail.py2
-rw-r--r--addons/fetchmail/models/mail_mail.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/addons/fetchmail/models/fetchmail.py b/addons/fetchmail/models/fetchmail.py
index 3873b5deb65..ef2b7b92df3 100644
--- a/addons/fetchmail/models/fetchmail.py
+++ b/addons/fetchmail/models/fetchmail.py
@@ -37,7 +37,7 @@ class FetchmailServer(models.Model):
('pop', 'POP Server'),
('imap', 'IMAP Server'),
('local', 'Local Server'),
- ], string='Server Type', index=True, required=True, default='pop', oldname='type')
+ ], string='Server Type', index=True, required=True, default='pop')
is_ssl = fields.Boolean('SSL/TLS', help="Connections are encrypted with SSL/TLS through a dedicated port (default: IMAPS=993, POP3S=995)")
attach = fields.Boolean('Keep Attachments', help="Whether attachments should be downloaded. "
"If not enabled, incoming emails will be stripped of any attachments before being processed", default=True)
diff --git a/addons/fetchmail/models/mail_mail.py b/addons/fetchmail/models/mail_mail.py
index 79f47d8dd12..88a977c247d 100644
--- a/addons/fetchmail/models/mail_mail.py
+++ b/addons/fetchmail/models/mail_mail.py
@@ -7,4 +7,4 @@ from odoo import fields, models
class MailMail(models.Model):
_inherit = 'mail.mail'
- fetchmail_server_id = fields.Many2one('fetchmail.server', "Inbound Mail Server", readonly=True, index=True, oldname='server_id')
+ fetchmail_server_id = fields.Many2one('fetchmail.server', "Inbound Mail Server", readonly=True, index=True)