From 6f618c7bfb8905c33fb5b93d26f3ef0a56003e4b Mon Sep 17 00:00:00 2001 From: cubells Date: Mon, 11 Jun 2018 18:12:03 +0200 Subject: [PATCH] [MIG] base_search_mail_content: Migration to 11.0 --- base_search_mail_content/README.rst | 87 +------------------ base_search_mail_content/__init__.py | 6 +- base_search_mail_content/__manifest__.py | 14 +-- base_search_mail_content/i18n/es.po | 38 +++----- base_search_mail_content/models/__init__.py | 7 +- .../models/mail_thread.py | 10 +-- base_search_mail_content/models/trgm_index.py | 17 ++++ .../readme/CONTRIBUTORS.rst | 5 ++ .../readme/DESCRIPTION.rst | 19 ++++ base_search_mail_content/readme/INSTALL.rst | 6 ++ base_search_mail_content/readme/USAGE.rst | 2 + base_search_mail_content/tests/__init__.py | 1 - .../tests/test_base_search_mail_content.py | 1 - .../views/trgm_index_view.xml | 27 ------ 14 files changed, 83 insertions(+), 157 deletions(-) create mode 100644 base_search_mail_content/models/trgm_index.py create mode 100644 base_search_mail_content/readme/CONTRIBUTORS.rst create mode 100644 base_search_mail_content/readme/DESCRIPTION.rst create mode 100644 base_search_mail_content/readme/INSTALL.rst create mode 100644 base_search_mail_content/readme/USAGE.rst delete mode 100644 base_search_mail_content/views/trgm_index_view.xml diff --git a/base_search_mail_content/README.rst b/base_search_mail_content/README.rst index 276c6ff0..d7f8f00a 100644 --- a/base_search_mail_content/README.rst +++ b/base_search_mail_content/README.rst @@ -1,86 +1 @@ -.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg - :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html - :alt: License: AGPL-3 - -======================== -Base Search Mail Content -======================== - -This module adds the capability to find on any object (e.g. project issues or -helpdesk ticket) based on the conversation threads associated to them. - -This will be useful in models that make intense use of messages, -like project issues or helpdesk tickets. - -A project issue or helpdesk ticket can contain tens of mails or notes -associated, based on the feedback that the person responsible for the ticket -maintains, including conversations with the person that raised the issue. - -A user may often want to find issues or tickets, based on the past -conversations that were recorded, as much as he or she needs to search -in their mail for past conversations. - -This module will add dynamically a field 'message_content' to the search view of -any model that inherits from the mail.thread. - -The current search capabilities include searching into the subject, body, -email from, reply to and record name. - -Installation -============ - -This module depends on the module 'base_search_fuzzy' to ensure that -searches on emails are based on indexes. Please read carefully the -`install instructions `_. - -This module installs by default the indexes that are required to -perform the searches on mail messages. - -Usage -===== - -Go to any model that contains a chatter (e.g. Contacts, ...). Search -for content in field 'Message Content'. - -.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas - :alt: Try me on Runbot - :target: https://runbot.odoo-community.org/runbot/server-tools/10.0 - -Bug Tracker -=========== - -Bugs are tracked on `GitHub Issues -`_. In case of trouble, please -check there if your issue has already been reported. If you spotted it first, -help us smashing it by providing a detailed and welcomed feedback. - -Credits -======= - -Images ------- - -* Odoo Community Association: `Icon `_. - -Contributors ------------- - -* Jordi Ballester Alomar -* Serpent Consulting Services Pvt. Ltd. -* Lois Rilo Antelo -* Aaron Henriquez - -Maintainer ----------- - -.. image:: https://odoo-community.org/logo.png - :alt: Odoo Community Association - :target: https://odoo-community.org - -This module is maintained by the OCA. - -OCA, or the Odoo Community Association, is a nonprofit organization whose -mission is to support the collaborative development of Odoo features and -promote its widespread use. - -To contribute to this module, please visit https://odoo-community.org. +This file is going to be generated by oca-gen-addon-readme. diff --git a/base_search_mail_content/__init__.py b/base_search_mail_content/__init__.py index ae34718d..b89a6bd8 100644 --- a/base_search_mail_content/__init__.py +++ b/base_search_mail_content/__init__.py @@ -1,7 +1,7 @@ -# -*- coding: utf-8 -*- -# © 2016 Eficent Business and IT Consulting Services S.L. +# Copyright 2016 Eficent Business and IT Consulting Services S.L. # (http://www.eficent.com) -# © 2016 Serpent Consulting Services Pvt. Ltd. () +# Copyright 2016 Serpent Consulting Services Pvt. Ltd. +# () # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from . import models diff --git a/base_search_mail_content/__manifest__.py b/base_search_mail_content/__manifest__.py index 45a7ed0a..fb2d3522 100644 --- a/base_search_mail_content/__manifest__.py +++ b/base_search_mail_content/__manifest__.py @@ -1,19 +1,21 @@ -# -*- coding: utf-8 -*- -# © 2016 Eficent Business and IT Consulting Services S.L. +# Copyright 2016 Eficent Business and IT Consulting Services S.L. # (http://www.eficent.com) -# © 2016 Serpent Consulting Services Pvt. Ltd. () +# Copyright 2016 Serpent Consulting Services Pvt. Ltd. +# () # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). { "name": "Base Search Mail Content", - "version": "10.0.1.0.0", + "version": "11.0.1.0.0", "author": "Eficent," "SerpentCS," + "Tecnativa," "Odoo Community Association (OCA)", "website": "https://github.com/OCA/social", "category": "Social", - "data": ["data/trgm_index_data.xml", - "views/trgm_index_view.xml"], + "data": [ + "data/trgm_index_data.xml", + ], "depends": ["mail", "base_search_fuzzy"], "license": "AGPL-3", 'installable': True, diff --git a/base_search_mail_content/i18n/es.po b/base_search_mail_content/i18n/es.po index f833da5a..d282cf77 100644 --- a/base_search_mail_content/i18n/es.po +++ b/base_search_mail_content/i18n/es.po @@ -1,28 +1,19 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * base_search_mail_content -# -# Translators: -# enjolras , 2018 +# * base_search_mail_content +# msgid "" msgstr "" -"Project-Id-Version: Odoo Server 10.0\n" +"Project-Id-Version: Odoo Server 11.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-02-26 01:46+0000\n" -"PO-Revision-Date: 2018-02-26 01:46+0000\n" -"Last-Translator: enjolras , 2018\n" -"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n" +"POT-Creation-Date: 2018-06-13 11:05+0000\n" +"PO-Revision-Date: 2018-06-13 11:05+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: es\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#. module: base_search_mail_content -#: model:ir.ui.view,arch_db:base_search_mail_content.trgm_index_view_form -#: model:ir.ui.view,arch_db:base_search_mail_content.trgm_index_view_tree -msgid "\"You can either select a field of type 'text', 'char' or 'html'.\"" -msgstr "\"Puede elegir un campo de tipo 'text', 'char' o 'html'.\"" +"Plural-Forms: \n" #. module: base_search_mail_content #: model:ir.model,name:base_search_mail_content.model_mail_thread @@ -30,27 +21,24 @@ msgid "Email Thread" msgstr "Hilo de email" #. module: base_search_mail_content -#: model:ir.model.fields,field_description:base_search_mail_content.field_event_event_message_content -#: model:ir.model.fields,field_description:base_search_mail_content.field_event_registration_message_content +#: code:addons/base_search_mail_content/models/mail_thread.py:53 #: model:ir.model.fields,field_description:base_search_mail_content.field_mail_channel_message_content -#: model:ir.model.fields,field_description:base_search_mail_content.field_mail_mass_mailing_contact_message_content #: model:ir.model.fields,field_description:base_search_mail_content.field_mail_test_message_content +#: model:ir.model.fields,field_description:base_search_mail_content.field_mail_test_simple_message_content #: model:ir.model.fields,field_description:base_search_mail_content.field_mail_thread_message_content -#: model:ir.model.fields,field_description:base_search_mail_content.field_mail_unsubscription_message_content #: model:ir.model.fields,field_description:base_search_mail_content.field_res_partner_message_content #: model:ir.model.fields,field_description:base_search_mail_content.field_res_users_message_content +#, python-format msgid "Message Content" msgstr "Contenido del mensaje" #. module: base_search_mail_content -#: model:ir.model.fields,help:base_search_mail_content.field_event_event_message_content -#: model:ir.model.fields,help:base_search_mail_content.field_event_registration_message_content #: model:ir.model.fields,help:base_search_mail_content.field_mail_channel_message_content -#: model:ir.model.fields,help:base_search_mail_content.field_mail_mass_mailing_contact_message_content #: model:ir.model.fields,help:base_search_mail_content.field_mail_test_message_content +#: model:ir.model.fields,help:base_search_mail_content.field_mail_test_simple_message_content #: model:ir.model.fields,help:base_search_mail_content.field_mail_thread_message_content -#: model:ir.model.fields,help:base_search_mail_content.field_mail_unsubscription_message_content #: model:ir.model.fields,help:base_search_mail_content.field_res_partner_message_content #: model:ir.model.fields,help:base_search_mail_content.field_res_users_message_content msgid "Message content, to be used only in searches" msgstr "Contenido del mensaje, para usarse en búsquedas" + diff --git a/base_search_mail_content/models/__init__.py b/base_search_mail_content/models/__init__.py index b0b43827..c965376a 100644 --- a/base_search_mail_content/models/__init__.py +++ b/base_search_mail_content/models/__init__.py @@ -1,7 +1,8 @@ -# -*- coding: utf-8 -*- -# © 2016-17 Eficent Business and IT Consulting Services S.L. +# Copyright 2016-17 Eficent Business and IT Consulting Services S.L. # (http://www.eficent.com) -# © 2016 Serpent Consulting Services Pvt. Ltd. () +# Copyright 2016 Serpent Consulting Services Pvt. Ltd. +# () # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from . import mail_thread +from . import trgm_index diff --git a/base_search_mail_content/models/mail_thread.py b/base_search_mail_content/models/mail_thread.py index 822f3d44..17ba7bf1 100644 --- a/base_search_mail_content/models/mail_thread.py +++ b/base_search_mail_content/models/mail_thread.py @@ -1,10 +1,10 @@ -# -*- coding: utf-8 -*- -# © 2016-17 Eficent Business and IT Consulting Services S.L. +# Copyright 2016-17 Eficent Business and IT Consulting Services S.L. # (http://www.eficent.com) -# © 2016 Serpent Consulting Services Pvt. Ltd. () +# Copyright 2016 Serpent Consulting Services Pvt. Ltd. +# () # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). -from odoo import api, fields, models +from odoo import _, api, fields, models from lxml import etree from odoo.osv import expression from odoo.osv.orm import setup_modifiers @@ -50,7 +50,7 @@ class MailThread(models.AbstractModel): res['fields'].update({ 'message_content': { 'type': 'char', - 'string': 'Message Content', + 'string': _('Message Content'), } }) diff --git a/base_search_mail_content/models/trgm_index.py b/base_search_mail_content/models/trgm_index.py new file mode 100644 index 00000000..34c59a02 --- /dev/null +++ b/base_search_mail_content/models/trgm_index.py @@ -0,0 +1,17 @@ +# Copyright 2016 Eficent Business and IT Consulting Services S.L. +# Copyright 2016 Serpent Consulting Services Pvt. Ltd. +# Copyright 2017 LasLabs Inc. +# Copyright 2018 Tecnativa - Vicent Cubells +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class TrgmIndex(models.Model): + _inherit = 'trgm.index' + + # We take advantage of field inheritance to redefine help instead of do + # inheritance in views that throws an error + field_id = fields.Many2one( + help="You can either select a field of type 'text', 'char' or 'html'." + ) diff --git a/base_search_mail_content/readme/CONTRIBUTORS.rst b/base_search_mail_content/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000..7f3312e9 --- /dev/null +++ b/base_search_mail_content/readme/CONTRIBUTORS.rst @@ -0,0 +1,5 @@ +* Jordi Ballester Alomar +* Serpent Consulting Services Pvt. Ltd. +* Lois Rilo Antelo +* Aaron Henriquez +* Vicent Cubells diff --git a/base_search_mail_content/readme/DESCRIPTION.rst b/base_search_mail_content/readme/DESCRIPTION.rst new file mode 100644 index 00000000..aa0e5548 --- /dev/null +++ b/base_search_mail_content/readme/DESCRIPTION.rst @@ -0,0 +1,19 @@ +This module adds the capability to find on any object (e.g. project issues or +helpdesk ticket) based on the conversation threads associated to them. + +This will be useful in models that make intense use of messages, +like project issues or helpdesk tickets. + +A project issue or helpdesk ticket can contain tens of mails or notes +associated, based on the feedback that the person responsible for the ticket +maintains, including conversations with the person that raised the issue. + +A user may often want to find issues or tickets, based on the past +conversations that were recorded, as much as he or she needs to search +in their mail for past conversations. + +This module will add dynamically a field 'message_content' to the search view +of any model that inherits from the mail.thread. + +The current search capabilities include searching into the subject, body, +email from, reply to and record name. diff --git a/base_search_mail_content/readme/INSTALL.rst b/base_search_mail_content/readme/INSTALL.rst new file mode 100644 index 00000000..bf2ba925 --- /dev/null +++ b/base_search_mail_content/readme/INSTALL.rst @@ -0,0 +1,6 @@ +This module depends on the module 'base_search_fuzzy' to ensure that +searches on emails are based on indexes. Please read carefully the +`install instructions `_. + +This module installs by default the indexes that are required to +perform the searches on mail messages. diff --git a/base_search_mail_content/readme/USAGE.rst b/base_search_mail_content/readme/USAGE.rst new file mode 100644 index 00000000..f9b4229c --- /dev/null +++ b/base_search_mail_content/readme/USAGE.rst @@ -0,0 +1,2 @@ +Go to any model that contains a chatter (e.g. Contacts, ...). Search +for content in field 'Message Content'. diff --git a/base_search_mail_content/tests/__init__.py b/base_search_mail_content/tests/__init__.py index 915ca325..a751b03d 100644 --- a/base_search_mail_content/tests/__init__.py +++ b/base_search_mail_content/tests/__init__.py @@ -1,3 +1,2 @@ -# -*- coding: utf-8 -*- # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from . import test_base_search_mail_content diff --git a/base_search_mail_content/tests/test_base_search_mail_content.py b/base_search_mail_content/tests/test_base_search_mail_content.py index 38b2c3eb..dae84f20 100644 --- a/base_search_mail_content/tests/test_base_search_mail_content.py +++ b/base_search_mail_content/tests/test_base_search_mail_content.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2017 Eficent Business and IT Consulting Services S.L. # (http://www.eficent.com) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). diff --git a/base_search_mail_content/views/trgm_index_view.xml b/base_search_mail_content/views/trgm_index_view.xml deleted file mode 100644 index ed3a55a8..00000000 --- a/base_search_mail_content/views/trgm_index_view.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - trgm.index.view.form - trgm.index - - - - [('ttype', 'in', ['char', 'text', 'html'])] - "You can either select a field of type 'text', 'char' or 'html'." - - - - - - trgm.index.view.tree - trgm.index - - - - "You can either select a field of type 'text', 'char' or 'html'." - - - - -