forked from OCA/social
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MIG] base_search_mail_content: Migration to 10.0
- Loading branch information
1 parent
2e14dc1
commit 9e3726a
Showing
10 changed files
with
105 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ 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/she needs to search | ||
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 | ||
|
@@ -30,22 +30,21 @@ 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: | ||
https://github.com/OCA/server-tools/blob/9.0/base_search_fuzzy/README.rst | ||
searches on emails are based on indexes. Please read carefully the | ||
`install instructions <https://github.com/OCA/server-tools/blob/10.0/base_search_fuzzy/README.rst>`_. | ||
|
||
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. Partners, Leads, ...). Search | ||
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/9.0 | ||
:target: https://runbot.odoo-community.org/runbot/server-tools/10.0 | ||
|
||
Bug Tracker | ||
=========== | ||
|
@@ -71,7 +70,6 @@ Contributors | |
* Lois Rilo Antelo <[email protected]> | ||
* Aaron Henriquez <[email protected]> | ||
|
||
|
||
Maintainer | ||
---------- | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
# -*- coding: utf-8 -*- | ||
# © 2016 Eficent Business and IT Consulting Services S.L. | ||
# © 2016-17 Eficent Business and IT Consulting Services S.L. | ||
# (http://www.eficent.com) | ||
# © 2016 Serpent Consulting Services Pvt. Ltd. (<http://www.serpentcs.com>) | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). | ||
|
||
from . import mail_thread | ||
from . import res_partner |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# -*- coding: utf-8 -*- | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
from . import test_base_search_mail_content |
25 changes: 25 additions & 0 deletions
25
base_search_mail_content/tests/test_base_search_mail_content.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# -*- 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). | ||
from odoo.tests.common import TransactionCase | ||
|
||
|
||
class TestBaseSearchMailContent(TransactionCase): | ||
def setUp(self): | ||
super(TestBaseSearchMailContent, self).setUp() | ||
self.channel_obj = self.env["mail.channel"] | ||
|
||
def test_base_search_mail_content_1(self): | ||
res = self.channel_obj.search( | ||
[('message_content', 'ilike', 'xxxyyyzzz')]) | ||
self.assertFalse(res, "You have a channel with xxxyyyzzz :O") | ||
|
||
def test_base_search_mail_content_2(self): | ||
res = self.channel_obj.load_views( | ||
[[False, 'search']], {'load_fields': False, | ||
'load_filters': True, | ||
'toolbar': True}) | ||
self.assertIn( | ||
'message_content', res['fields_views']['search']['fields'], | ||
"message_content field was not detected") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,27 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<openerp> | ||
<data> | ||
<odoo> | ||
|
||
<record model="ir.ui.view" id="trgm_index_view_form"> | ||
<field name="name">trgm.index.view.form</field> | ||
<field name="model">trgm.index</field> | ||
<field name="inherit_id" ref="base_search_fuzzy.trgm_index_view_form"/> | ||
<field name="arch" type="xml"> | ||
<field name="field_id" position="attributes"> | ||
<attribute name="domain">[('ttype', 'in', ['char', 'text', 'html'])]</attribute> | ||
<attribute name="help">"You can either select a field of type 'text', 'char' or 'html'."</attribute> | ||
</field> | ||
<record model="ir.ui.view" id="trgm_index_view_form"> | ||
<field name="name">trgm.index.view.form</field> | ||
<field name="model">trgm.index</field> | ||
<field name="inherit_id" ref="base_search_fuzzy.trgm_index_view_form"/> | ||
<field name="arch" type="xml"> | ||
<field name="field_id" position="attributes"> | ||
<attribute name="domain">[('ttype', 'in', ['char', 'text', 'html'])]</attribute> | ||
<attribute name="help">"You can either select a field of type 'text', 'char' or 'html'."</attribute> | ||
</field> | ||
</record> | ||
</field> | ||
</record> | ||
|
||
<record model="ir.ui.view" id="trgm_index_view_tree"> | ||
<field name="name">trgm.index.view.tree</field> | ||
<field name="model">trgm.index</field> | ||
<field name="inherit_id" ref="base_search_fuzzy.trgm_index_view_tree"/> | ||
<field name="arch" type="xml"> | ||
<field name="field_id" position="attributes"> | ||
<attribute name="help">"You can either select a field of type 'text', 'char' or 'html'."</attribute> | ||
</field> | ||
<record model="ir.ui.view" id="trgm_index_view_tree"> | ||
<field name="name">trgm.index.view.tree</field> | ||
<field name="model">trgm.index</field> | ||
<field name="inherit_id" ref="base_search_fuzzy.trgm_index_view_tree"/> | ||
<field name="arch" type="xml"> | ||
<field name="field_id" position="attributes"> | ||
<attribute name="help">"You can either select a field of type 'text', 'char' or 'html'."</attribute> | ||
</field> | ||
</record> | ||
</field> | ||
</record> | ||
|
||
</data> | ||
</openerp> | ||
</odoo> |