From 83b2e473f9446ab1cb1e1a500b112e8d14a78eaa Mon Sep 17 00:00:00 2001 From: ufaks Date: Wed, 30 Sep 2015 11:57:53 +0500 Subject: [PATCH 1/4] [REF] Apply remarks --- README.rst | 2 ++ __init__.py | 0 __openerp__.py | 12 +++++++++ mail_todo_custom.xml | 25 ++++++++++++++++++ static/src/js/mail_todo_custom.js | 44 +++++++++++++++++++++++++++++++ 5 files changed, 83 insertions(+) create mode 100644 README.rst create mode 100644 __init__.py create mode 100644 __openerp__.py create mode 100644 mail_todo_custom.xml create mode 100644 static/src/js/mail_todo_custom.js diff --git a/README.rst b/README.rst new file mode 100644 index 0000000..56b440e --- /dev/null +++ b/README.rst @@ -0,0 +1,2 @@ +Mark unstarred email as read, remove filter in 'To-do' folder +============================================================= diff --git a/__init__.py b/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/__openerp__.py b/__openerp__.py new file mode 100644 index 0000000..34e8357 --- /dev/null +++ b/__openerp__.py @@ -0,0 +1,12 @@ +# -*- coding: utf-8 -*- +{ + 'name': "Mark unstarred email as read, remove filter in 'To-do' folder", + 'version': '1.0', + 'author': "Ivan Yelizariev", + 'website': "https://yelizariev.github.io", + 'category': 'Tools', + 'depends': ['mail'], + 'data': ['mail_todo_custom.xml'], + 'demo': [], + 'installable': True, +} diff --git a/mail_todo_custom.xml b/mail_todo_custom.xml new file mode 100644 index 0000000..8274d61 --- /dev/null +++ b/mail_todo_custom.xml @@ -0,0 +1,25 @@ + + + + + + + + + { + 'default_model': 'res.users', + 'default_res_id': uid, + 'thread_model': 'res.partner', + 'search_default_message_unread': False, + 'view_todo': True + } + + + + + + diff --git a/static/src/js/mail_todo_custom.js b/static/src/js/mail_todo_custom.js new file mode 100644 index 0000000..4d45c0b --- /dev/null +++ b/static/src/js/mail_todo_custom.js @@ -0,0 +1,44 @@ +openerp.mail_todo_custom = function(session) { + + var mail = session.mail; + + mail.ThreadMessage.include({ + + on_star: function (event) { + event.stopPropagation(); + var self=this; + var button = self.$('.oe_star:first'); + + this.ds_message.call('set_message_starred', [[self.id], !self.is_favorite, true]) + .then(function (star) { + self.is_favorite=star; + if (self.is_favorite) { + button.addClass('oe_starred'); + } else { + button.removeClass('oe_starred'); + } + + if (self.options.view_inbox && self.is_favorite) { + self.on_message_read_unread(true); + } + else { + self.check_for_rerender(); + } + if (self.options.view_todo && !self.is_favorite) { + self.on_message_read_unread(true); + } + }); + return false; + }, + + }); + + mail.Widget.include({ + + init: function (parent, action) { + this._super(parent, action); + this.action.params.view_todo = this.action.context.view_todo || false; + }, + + }); +} \ No newline at end of file From 543fce722d2d0fe775c8fde50916fd63cd8a02c5 Mon Sep 17 00:00:00 2001 From: Ivan Yelizariev Date: Tue, 3 Nov 2015 10:22:20 +0500 Subject: [PATCH 2/4] [DOC] add license tag --- __openerp__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/__openerp__.py b/__openerp__.py index 34e8357..4f610ff 100644 --- a/__openerp__.py +++ b/__openerp__.py @@ -2,7 +2,8 @@ { 'name': "Mark unstarred email as read, remove filter in 'To-do' folder", 'version': '1.0', - 'author': "Ivan Yelizariev", + 'author': 'IT-Projects LLC', + 'license': 'LGPL-3', 'website': "https://yelizariev.github.io", 'category': 'Tools', 'depends': ['mail'], From 64ecefe87daebbe8615254f8f3a8faef598431af Mon Sep 17 00:00:00 2001 From: Ivan Yelizariev Date: Mon, 9 Nov 2015 11:26:31 +0500 Subject: [PATCH 3/4] update license to GPL-3 --- __openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/__openerp__.py b/__openerp__.py index 4f610ff..0d295e0 100644 --- a/__openerp__.py +++ b/__openerp__.py @@ -3,7 +3,7 @@ 'name': "Mark unstarred email as read, remove filter in 'To-do' folder", 'version': '1.0', 'author': 'IT-Projects LLC', - 'license': 'LGPL-3', + 'license': 'GPL-3', 'website': "https://yelizariev.github.io", 'category': 'Tools', 'depends': ['mail'], From 16245d9e50d50b0e8c240a57dc5ba378eb07136f Mon Sep 17 00:00:00 2001 From: Ildar Nasyrov Date: Sun, 27 Mar 2016 16:22:44 +0500 Subject: [PATCH 4/4] [MOV] module -- mail_todo_custom --- README.rst => mail_todo_custom/README.rst | 0 __init__.py => mail_todo_custom/__init__.py | 0 __openerp__.py => mail_todo_custom/__openerp__.py | 0 mail_todo_custom.xml => mail_todo_custom/mail_todo_custom.xml | 0 {static => mail_todo_custom/static}/src/js/mail_todo_custom.js | 0 5 files changed, 0 insertions(+), 0 deletions(-) rename README.rst => mail_todo_custom/README.rst (100%) rename __init__.py => mail_todo_custom/__init__.py (100%) rename __openerp__.py => mail_todo_custom/__openerp__.py (100%) rename mail_todo_custom.xml => mail_todo_custom/mail_todo_custom.xml (100%) rename {static => mail_todo_custom/static}/src/js/mail_todo_custom.js (100%) diff --git a/README.rst b/mail_todo_custom/README.rst similarity index 100% rename from README.rst rename to mail_todo_custom/README.rst diff --git a/__init__.py b/mail_todo_custom/__init__.py similarity index 100% rename from __init__.py rename to mail_todo_custom/__init__.py diff --git a/__openerp__.py b/mail_todo_custom/__openerp__.py similarity index 100% rename from __openerp__.py rename to mail_todo_custom/__openerp__.py diff --git a/mail_todo_custom.xml b/mail_todo_custom/mail_todo_custom.xml similarity index 100% rename from mail_todo_custom.xml rename to mail_todo_custom/mail_todo_custom.xml diff --git a/static/src/js/mail_todo_custom.js b/mail_todo_custom/static/src/js/mail_todo_custom.js similarity index 100% rename from static/src/js/mail_todo_custom.js rename to mail_todo_custom/static/src/js/mail_todo_custom.js