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
=== modified file 'mail/mail_message.py'
--- mail/mail_message.py 2014-05-09 10:23:55 +0000
+++ mail/mail_message.py 2014-05-12 12:14:06 +0000
@@ -113,7 +113,20 @@
113 for notif in notif_obj.browse(cr, uid, notif_ids, context=context):113 for notif in notif_obj.browse(cr, uid, notif_ids, context=context):
114 res[notif.message_id.id] = True114 res[notif.message_id.id] = True
115 return res115 return res
116116
117 def _search_application(self, cr, uid, obj, name, args, context=None):
118 if not args:
119 return []
120 res = []
121 application_ids = []
122 model_pool = self.pool.get('ir.model')
123 for field,operator,value in args:
124 if field == 'model_id':
125 model = model_pool.browse(cr, uid, value, context=context).model
126 application_ids = self.search(cr, uid, [('model','=', model)])
127 res.append(('id', 'in', application_ids))
128 return res
129
117 def _search_starred(self, cr, uid, obj, name, domain, context=None):130 def _search_starred(self, cr, uid, obj, name, domain, context=None):
118 """ Search for messages to read by the current user. Condition is131 """ Search for messages to read by the current user. Condition is
119 inversed because we search unread message on a read column. """132 inversed because we search unread message on a read column. """
@@ -145,6 +158,8 @@
145 ondelete='set null', help="Initial thread message."),158 ondelete='set null', help="Initial thread message."),
146 'child_ids': fields.one2many('mail.message', 'parent_id', 'Child Messages'),159 'child_ids': fields.one2many('mail.message', 'parent_id', 'Child Messages'),
147 'model': fields.char('Related Document Model', size=128, select=1),160 'model': fields.char('Related Document Model', size=128, select=1),
161 'model_id': fields.function(lambda *x : {}, type='many2one', relation='ir.model',
162 fnct_search=_search_application, string='Application'),
148 'res_id': fields.integer('Related Document ID', select=1),163 'res_id': fields.integer('Related Document ID', select=1),
149 'record_name': fields.char('Message Record Name', help="Name get of the related document."),164 'record_name': fields.char('Message Record Name', help="Name get of the related document."),
150 'notification_ids': fields.one2many('mail.notification', 'message_id',165 'notification_ids': fields.one2many('mail.notification', 'message_id',
151166
=== modified file 'mail/mail_message_view.xml'
--- mail/mail_message_view.xml 2014-04-01 16:47:00 +0000
+++ mail/mail_message_view.xml 2014-05-12 12:14:06 +0000
@@ -59,6 +59,7 @@
59 <field name="body" string="Content" filter_domain="['|', ('subject', 'ilike', self), ('body', 'ilike', self)]" />59 <field name="body" string="Content" filter_domain="['|', ('subject', 'ilike', self), ('body', 'ilike', self)]" />
60 <field name="subject"/>60 <field name="subject"/>
61 <field name="type"/>61 <field name="type"/>
62 <field name="model_id"/>
62 <field name="author_id"/>63 <field name="author_id"/>
63 <field name="partner_ids"/>64 <field name="partner_ids"/>
64 <field name="model"/>65 <field name="model"/>
6566
=== modified file 'mail/static/src/css/mail.css'
--- mail/static/src/css/mail.css 2014-04-10 15:50:22 +0000
+++ mail/static/src/css/mail.css 2014-05-12 12:14:06 +0000
@@ -271,6 +271,13 @@
271 background: white;271 background: white;
272 font-size: 14px;272 font-size: 14px;
273 font-style: italic;273 font-style: italic;
274 width: 95%;
275 float: left;
276}
277.openerp .oe_mail .mark_all_read {
278 display: inline-block;
279 margin-left: 5px;
280 margin-top: -5px;
274}281}
275282
276/* d) I.E. tweaks for Message action icons */283/* d) I.E. tweaks for Message action icons */
277284
=== modified file 'mail/static/src/js/mail.js'
--- mail/static/src/js/mail.js 2014-03-25 14:25:35 +0000
+++ mail/static/src/js/mail.js 2014-05-12 12:14:06 +0000
@@ -472,6 +472,7 @@
472 this.$('.oe_compact_inbox').on('click', self.on_toggle_quick_composer);472 this.$('.oe_compact_inbox').on('click', self.on_toggle_quick_composer);
473 this.$('.oe_compose_post').on('click', self.on_toggle_quick_composer);473 this.$('.oe_compose_post').on('click', self.on_toggle_quick_composer);
474 this.$('.oe_compose_log').on('click', self.on_toggle_quick_composer);474 this.$('.oe_compose_log').on('click', self.on_toggle_quick_composer);
475 this.$('.mark_all_read').on('click', _.bind(self.mark_all_read, this));
475 this.$('input.oe_form_binary_file').on('change', _.bind( this.on_attachment_change, this));476 this.$('input.oe_form_binary_file').on('change', _.bind( this.on_attachment_change, this));
476 this.$('.oe_cancel').on('click', _.bind( this.on_cancel, this));477 this.$('.oe_cancel').on('click', _.bind( this.on_cancel, this));
477 this.$('.oe_post').on('click', self.on_message_post);478 this.$('.oe_post').on('click', self.on_message_post);
@@ -492,6 +493,12 @@
492493
493 this.$(".oe_recipients").on('change', 'input', this.on_checked_recipient);494 this.$(".oe_recipients").on('change', 'input', this.on_checked_recipient);
494 },495 },
496
497 mark_all_read: function(){
498 _.each(this.parent_thread.messages, function (thread) {
499 thread.on_message_read_unread(true);
500 });
501 },
495502
496 on_compose_fullmail: function (default_composition_mode) {503 on_compose_fullmail: function (default_composition_mode) {
497 var self = this;504 var self = this;
498505
=== modified file 'mail/static/src/xml/mail.xml'
--- mail/static/src/xml/mail.xml 2014-05-07 16:51:26 +0000
+++ mail/static/src/xml/mail.xml 2014-05-12 12:14:06 +0000
@@ -26,7 +26,9 @@
26 </div>26 </div>
27 <div class="oe_msg_center">27 <div class="oe_msg_center">
28 <div class="oe_msg_content">28 <div class="oe_msg_content">
29 <t t-if="!widget.is_log">
29 <button class="oe_full" title="Open the full mail composer"><span class='oe_e'>&amp;ograve</span></button>30 <button class="oe_full" title="Open the full mail composer"><span class='oe_e'>&amp;ograve</span></button>
31 </t>
30 <t t-call="mail.thread.list_recipients"/>32 <t t-call="mail.thread.list_recipients"/>
31 <textarea class="field_text"></textarea>33 <textarea class="field_text"></textarea>
32 </div>34 </div>
@@ -46,6 +48,7 @@
46 <t t-if="widget.options.compose_placeholder" t-raw="widget.options.compose_placeholder"/>48 <t t-if="widget.options.compose_placeholder" t-raw="widget.options.compose_placeholder"/>
47 <t t-if="!widget.options.compose_placeholder and widget.options.view_mailbox">Share with my followers...</t>49 <t t-if="!widget.options.compose_placeholder and widget.options.view_mailbox">Share with my followers...</t>
48 </div>50 </div>
51 <div class="mark_all_read"><a class="oe_e" title="Mark all read">W</a></div>
49 </t>52 </t>
50 <t t-if="!widget.options.view_mailbox">53 <t t-if="!widget.options.view_mailbox">
51 <div class="field_text oe_compact oe_compact_record">54 <div class="field_text oe_compact oe_compact_record">

Subscribers

People subscribed via source and target branches

to all changes: