Merge lp:~openerp-dev/openobject-addons/trunk-messaging-search-rga into lp:openobject-addons

Proposed by Kuldeep Joshi(OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-messaging-search-rga
Merge into: lp:openobject-addons
Diff against target: 111 lines (+34/-1)
5 files modified
mail/mail_message.py (+16/-1)
mail/mail_message_view.xml (+1/-0)
mail/static/src/css/mail.css (+7/-0)
mail/static/src/js/mail.js (+7/-0)
mail/static/src/xml/mail.xml (+3/-0)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-messaging-search-rga
Reviewer Review Type Date Requested Status
Atul Patel(OpenERP) (community) Needs Resubmitting
Harry (OpenERP) (community) technical Needs Fixing
Review via email: mp+200396@code.launchpad.net

Description of the change

-> Add a quick search based on application
-> Add a "Mark all read" in Inbox
-> Don't show full composer icon when clicking on log a note in any object

To post a comment you must log in.
9012. By Kuldeep Joshi(OpenERP)

[IMP] mail: change method name and code

9013. By Atul Patel(OpenERP)

[IMP]: Improve fnct_search method for mail message.

9014. By Atul Patel(OpenERP)

[MERGE]: Merged with addons

9015. By Chirag Dodiya(OpenERP)

[MRG]Merge with lp:openobject-addons

9016. By Atul Patel(OpenERP)

[MERGE]: Merged with addons

9017. By Atul Patel(OpenERP)

[MERGE]: Merged with addons

Revision history for this message
Harry (OpenERP) (hmo-tinyerp) wrote :

Hello,

need some correction in _search_application method:

* if args[0] is not contains more than 4 elements, It will be break
* if model_id is not exits in "ir.model" recordlist, It will be break.
* if not application_id, why return [('id','=','0')] ?

review: Needs Fixing (technical)
9018. By Atul Patel(OpenERP)

[IMP]: Improve fnct_search method to quick search based on application

Revision history for this message
Atul Patel(OpenERP) (atp-openerp) wrote :

Hello,

Improve _seach_application method

Thanks

Revision history for this message
Atul Patel(OpenERP) (atp-openerp) :
review: Needs Resubmitting
9019. By Atul Patel(OpenERP)

[IMP]: remove integer condition for value

9020. By Atul Patel(OpenERP)

[MERGE]: Merged with addons

9021. By Atul Patel(OpenERP)

[MERGE]: Merged with addons

Unmerged revisions

9021. By Atul Patel(OpenERP)

[MERGE]: Merged with addons

9020. By Atul Patel(OpenERP)

[MERGE]: Merged with addons

9019. By Atul Patel(OpenERP)

[IMP]: remove integer condition for value

9018. By Atul Patel(OpenERP)

[IMP]: Improve fnct_search method to quick search based on application

9017. By Atul Patel(OpenERP)

[MERGE]: Merged with addons

9016. By Atul Patel(OpenERP)

[MERGE]: Merged with addons

9015. By Chirag Dodiya(OpenERP)

[MRG]Merge with lp:openobject-addons

9014. By Atul Patel(OpenERP)

[MERGE]: Merged with addons

9013. By Atul Patel(OpenERP)

[IMP]: Improve fnct_search method for mail message.

9012. By Kuldeep Joshi(OpenERP)

[IMP] mail: change method name and code

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'mail/mail_message.py'
2--- mail/mail_message.py 2014-05-09 10:23:55 +0000
3+++ mail/mail_message.py 2014-05-12 12:14:06 +0000
4@@ -113,7 +113,20 @@
5 for notif in notif_obj.browse(cr, uid, notif_ids, context=context):
6 res[notif.message_id.id] = True
7 return res
8-
9+
10+ def _search_application(self, cr, uid, obj, name, args, context=None):
11+ if not args:
12+ return []
13+ res = []
14+ application_ids = []
15+ model_pool = self.pool.get('ir.model')
16+ for field,operator,value in args:
17+ if field == 'model_id':
18+ model = model_pool.browse(cr, uid, value, context=context).model
19+ application_ids = self.search(cr, uid, [('model','=', model)])
20+ res.append(('id', 'in', application_ids))
21+ return res
22+
23 def _search_starred(self, cr, uid, obj, name, domain, context=None):
24 """ Search for messages to read by the current user. Condition is
25 inversed because we search unread message on a read column. """
26@@ -145,6 +158,8 @@
27 ondelete='set null', help="Initial thread message."),
28 'child_ids': fields.one2many('mail.message', 'parent_id', 'Child Messages'),
29 'model': fields.char('Related Document Model', size=128, select=1),
30+ 'model_id': fields.function(lambda *x : {}, type='many2one', relation='ir.model',
31+ fnct_search=_search_application, string='Application'),
32 'res_id': fields.integer('Related Document ID', select=1),
33 'record_name': fields.char('Message Record Name', help="Name get of the related document."),
34 'notification_ids': fields.one2many('mail.notification', 'message_id',
35
36=== modified file 'mail/mail_message_view.xml'
37--- mail/mail_message_view.xml 2014-04-01 16:47:00 +0000
38+++ mail/mail_message_view.xml 2014-05-12 12:14:06 +0000
39@@ -59,6 +59,7 @@
40 <field name="body" string="Content" filter_domain="['|', ('subject', 'ilike', self), ('body', 'ilike', self)]" />
41 <field name="subject"/>
42 <field name="type"/>
43+ <field name="model_id"/>
44 <field name="author_id"/>
45 <field name="partner_ids"/>
46 <field name="model"/>
47
48=== modified file 'mail/static/src/css/mail.css'
49--- mail/static/src/css/mail.css 2014-04-10 15:50:22 +0000
50+++ mail/static/src/css/mail.css 2014-05-12 12:14:06 +0000
51@@ -271,6 +271,13 @@
52 background: white;
53 font-size: 14px;
54 font-style: italic;
55+ width: 95%;
56+ float: left;
57+}
58+.openerp .oe_mail .mark_all_read {
59+ display: inline-block;
60+ margin-left: 5px;
61+ margin-top: -5px;
62 }
63
64 /* d) I.E. tweaks for Message action icons */
65
66=== modified file 'mail/static/src/js/mail.js'
67--- mail/static/src/js/mail.js 2014-03-25 14:25:35 +0000
68+++ mail/static/src/js/mail.js 2014-05-12 12:14:06 +0000
69@@ -472,6 +472,7 @@
70 this.$('.oe_compact_inbox').on('click', self.on_toggle_quick_composer);
71 this.$('.oe_compose_post').on('click', self.on_toggle_quick_composer);
72 this.$('.oe_compose_log').on('click', self.on_toggle_quick_composer);
73+ this.$('.mark_all_read').on('click', _.bind(self.mark_all_read, this));
74 this.$('input.oe_form_binary_file').on('change', _.bind( this.on_attachment_change, this));
75 this.$('.oe_cancel').on('click', _.bind( this.on_cancel, this));
76 this.$('.oe_post').on('click', self.on_message_post);
77@@ -492,6 +493,12 @@
78
79 this.$(".oe_recipients").on('change', 'input', this.on_checked_recipient);
80 },
81+
82+ mark_all_read: function(){
83+ _.each(this.parent_thread.messages, function (thread) {
84+ thread.on_message_read_unread(true);
85+ });
86+ },
87
88 on_compose_fullmail: function (default_composition_mode) {
89 var self = this;
90
91=== modified file 'mail/static/src/xml/mail.xml'
92--- mail/static/src/xml/mail.xml 2014-05-07 16:51:26 +0000
93+++ mail/static/src/xml/mail.xml 2014-05-12 12:14:06 +0000
94@@ -26,7 +26,9 @@
95 </div>
96 <div class="oe_msg_center">
97 <div class="oe_msg_content">
98+ <t t-if="!widget.is_log">
99 <button class="oe_full" title="Open the full mail composer"><span class='oe_e'>&amp;ograve</span></button>
100+ </t>
101 <t t-call="mail.thread.list_recipients"/>
102 <textarea class="field_text"></textarea>
103 </div>
104@@ -46,6 +48,7 @@
105 <t t-if="widget.options.compose_placeholder" t-raw="widget.options.compose_placeholder"/>
106 <t t-if="!widget.options.compose_placeholder and widget.options.view_mailbox">Share with my followers...</t>
107 </div>
108+ <div class="mark_all_read"><a class="oe_e" title="Mark all read">W</a></div>
109 </t>
110 <t t-if="!widget.options.view_mailbox">
111 <div class="field_text oe_compact oe_compact_record">

Subscribers

People subscribed via source and target branches

to all changes: