From fb88cff1bd1b77ffc3d8fa2bce7cda39c47c3710 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9rome=20Maes?= Date: Tue, 22 Mar 2016 14:00:15 +0100 Subject: [PATCH] [IMP] website_mail : remove 'website_message_ids' from mail.thread This inheritance wasn't working till the commit of rco, modifying models inheritance. Anyway, `website_message_ids` field is already defined on several models (product, slide, forum questions, blog post, ...), and each of them have a different domain attribute. So making the mail.thread mixin providing this field is not so interessting since it will be overrided for specific behavior. We remove this field as it can't be usefull and generic. --- addons/website_mail/models/__init__.py | 1 - addons/website_mail/models/mail_thread.py | 13 ------------- addons/website_sale/models/product.py | 1 - 3 files changed, 15 deletions(-) delete mode 100644 addons/website_mail/models/mail_thread.py diff --git a/addons/website_mail/models/__init__.py b/addons/website_mail/models/__init__.py index fcf3edd02fe..e4f2ed11911 100644 --- a/addons/website_mail/models/__init__.py +++ b/addons/website_mail/models/__init__.py @@ -2,5 +2,4 @@ # Part of Odoo. See LICENSE file for full copyright and licensing details. import mail_message -import mail_thread import update diff --git a/addons/website_mail/models/mail_thread.py b/addons/website_mail/models/mail_thread.py deleted file mode 100644 index 5c0ace6722d..00000000000 --- a/addons/website_mail/models/mail_thread.py +++ /dev/null @@ -1,13 +0,0 @@ -# -*- coding: utf-8 -*- -# Part of Odoo. See LICENSE file for full copyright and licensing details. - -from odoo import fields, models - - -# TODO for trunk, remove me -class MailThread(models.AbstractModel): - _inherit = 'mail.thread' - - website_message_ids = fields.One2many('mail.message', 'res_id', - domain=lambda self: ['&', ('model', '=', self._name), ('message_type', '=', 'comment')], - string='Website Messages', help="Website communication history") diff --git a/addons/website_sale/models/product.py b/addons/website_sale/models/product.py index 14fe0c49706..8941071eaac 100644 --- a/addons/website_sale/models/product.py +++ b/addons/website_sale/models/product.py @@ -75,7 +75,6 @@ class ProductTemplate(models.Model): _name = 'product.template' _mail_post_access = 'read' - # TODO FIXME tde: when website_mail/mail_thread.py inheritance work -> this field won't be necessary website_message_ids = fields.One2many( 'mail.message', 'res_id', domain=lambda self: ['&', ('model', '=', self._name), ('message_type', '=', 'comment')],