mreficent
7 years ago
committed by
cubells
10 changed files with 105 additions and 110 deletions
-
12base_search_mail_content/README.rst
-
7base_search_mail_content/__manifest__.py
-
6base_search_mail_content/data/trgm_index_data.xml
-
3base_search_mail_content/models/__init__.py
-
102base_search_mail_content/models/mail_thread.py
-
13base_search_mail_content/models/res_partner.py
-
BINbase_search_mail_content/static/description/icon.png
-
3base_search_mail_content/tests/__init__.py
-
25base_search_mail_content/tests/test_base_search_mail_content.py
-
44base_search_mail_content/views/trgm_index_view.xml
@ -1,8 +1,7 @@ |
|||||
# -*- coding: utf-8 -*- |
# -*- 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) |
# (http://www.eficent.com) |
||||
# © 2016 Serpent Consulting Services Pvt. Ltd. (<http://www.serpentcs.com>) |
# © 2016 Serpent Consulting Services Pvt. Ltd. (<http://www.serpentcs.com>) |
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). |
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). |
||||
|
|
||||
from . import mail_thread |
from . import mail_thread |
||||
from . import res_partner |
|
@ -1,13 +0,0 @@ |
|||||
# -*- coding: utf-8 -*- |
|
||||
# © 2016 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 openerp import models |
|
||||
|
|
||||
|
|
||||
class Partner(models.Model): |
|
||||
|
|
||||
_name = 'res.partner' |
|
||||
_inherit = ['res.partner', 'mail.thread'] |
|
After Width: 128 | Height: 128 | Size: 9.2 KiB |
@ -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 |
@ -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") |
@ -1,29 +1,27 @@ |
|||||
<?xml version="1.0" encoding="utf-8"?> |
<?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> |
</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> |
</field> |
||||
</record> |
|
||||
|
</field> |
||||
|
</record> |
||||
|
|
||||
</data> |
|
||||
</openerp> |
|
||||
|
</odoo> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue