diff --git a/mail_sent/README.rst b/mail_sent/README.rst new file mode 100644 index 0000000..2b0336f --- /dev/null +++ b/mail_sent/README.rst @@ -0,0 +1,8 @@ +Sentbox +======= + +Description: https://apps.odoo.com/apps/modules/8.0/mail_sent/ + +Further information and discussion: https://yelizariev.github.io/odoo/module/2015/02/19/sentbox.html + +Tested on Odoo 8.0 231e02693640325c9a05fa31c680063b9e4b017b diff --git a/mail_sent/__init__.py b/mail_sent/__init__.py new file mode 100644 index 0000000..bff786c --- /dev/null +++ b/mail_sent/__init__.py @@ -0,0 +1 @@ +import models diff --git a/mail_sent/__openerp__.py b/mail_sent/__openerp__.py new file mode 100644 index 0000000..7027e83 --- /dev/null +++ b/mail_sent/__openerp__.py @@ -0,0 +1,15 @@ +{ + 'name' : 'Sentbox', + 'version' : '1.0.2', + 'author' : 'IT-Projects LLC, Ivan Yelizariev', + 'license': 'LGPL-3', + 'category' : 'Social Network', + 'website' : 'https://twitter.com/yelizariev', + 'price': 9.00, + 'currency': 'EUR', + 'depends' : ['mail'], + 'data':[ + 'views.xml', + ], + 'installable': False +} diff --git a/mail_sent/doc/changelog.rst b/mail_sent/doc/changelog.rst new file mode 100644 index 0000000..7615117 --- /dev/null +++ b/mail_sent/doc/changelog.rst @@ -0,0 +1,9 @@ +.. _changelog: + +Changelog +========= + +`1.0.2` +------- + +- FIX access issue "read access error on delete" diff --git a/mail_sent/i18n/mail_sent.pot b/mail_sent/i18n/mail_sent.pot new file mode 100644 index 0000000..743bc53 --- /dev/null +++ b/mail_sent/i18n/mail_sent.pot @@ -0,0 +1,50 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mail_sent +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-08-11 06:59+0000\n" +"PO-Revision-Date: 2015-08-11 06:59+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: mail_sent +#: model:ir.actions.client,help:mail_sent.action_mail_sent_feeds +msgid "

\n" +" No message found and no message sent yet.\n" +"

\n" +" Click on the top-right icon to compose a message. This\n" +" message will be sent by email if it's an internal contact.\n" +"

\n" +" " +msgstr "" + +#. module: mail_sent +#: model:ir.model,name:mail_sent.model_mail_message +msgid "Message" +msgstr "" + +#. module: mail_sent +#: model:ir.model,name:mail_sent.model_mail_notification +msgid "Notifications" +msgstr "" + +#. module: mail_sent +#: model:ir.actions.client,name:mail_sent.action_mail_sent_feeds +#: model:ir.ui.menu,name:mail_sent.mail_sentfeeds +#: field:mail.message,sent:0 +msgid "Sent" +msgstr "" + +#. module: mail_sent +#: help:mail.message,sent:0 +msgid "Was message sent to someone" +msgstr "" + diff --git a/mail_sent/i18n/sl.po b/mail_sent/i18n/sl.po new file mode 100644 index 0000000..b8ad954 --- /dev/null +++ b/mail_sent/i18n/sl.po @@ -0,0 +1,58 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mail_sent +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-08-11 06:59+0000\n" +"PO-Revision-Date: 2015-08-11 09:01+0200\n" +"Last-Translator: Matjaz Mozetic \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: \n" +"Language: sl\n" +"X-Generator: Poedit 1.8.2\n" + +#. module: mail_sent +#: model:ir.actions.client,help:mail_sent.action_mail_sent_feeds +msgid "" +"

\n" +" No message found and no message sent yet.\n" +"

\n" +" Click on the top-right icon to compose a message. This\n" +" message will be sent by email if it's an internal contact.\n" +"

\n" +" " +msgstr "" +"

\n" +" Nobeno sporočilo ni bilo najdeno in ni bilo še poslano.\n" +"

\n" +" Pritisnite na ikono zgoraj desno za sestavljanje sporočila. To\n" +" sporočilo bo, če gre za interni stik, poslano preko e-pošte.\n" +"

\n" +" " + +#. module: mail_sent +#: model:ir.model,name:mail_sent.model_mail_message +msgid "Message" +msgstr "Sporočilo" + +#. module: mail_sent +#: model:ir.model,name:mail_sent.model_mail_notification +msgid "Notifications" +msgstr "Obvestila" + +#. module: mail_sent +#: model:ir.actions.client,name:mail_sent.action_mail_sent_feeds +#: model:ir.ui.menu,name:mail_sent.mail_sentfeeds field:mail.message,sent:0 +msgid "Sent" +msgstr "Poslano" + +#. module: mail_sent +#: help:mail.message,sent:0 +msgid "Was message sent to someone" +msgstr "Je bilo sporočilo komu poslano" diff --git a/mail_sent/models.py b/mail_sent/models.py new file mode 100644 index 0000000..38c82e9 --- /dev/null +++ b/mail_sent/models.py @@ -0,0 +1,28 @@ +from openerp import api, models, fields + + +class mail_message(models.Model): + _inherit = 'mail.message' + + @api.one + @api.depends('author_id', 'notified_partner_ids') + def _get_sent(self): + self_sudo = self.sudo() + self_sudo.sent = len(self_sudo.notified_partner_ids) > 1 or len(self_sudo.notified_partner_ids) == 1 and self_sudo.author_id and self_sudo.notified_partner_ids[0].id != self_sudo.author_id.id + + sent = fields.Boolean('Sent', compute=_get_sent, help='Was message sent to someone', store=True) + + +class mail_notification(models.Model): + _inherit = 'mail.notification' + + def _notify(self, cr, uid, message_id, **kwargs): + super(mail_notification, self)._notify(cr, uid, message_id, **kwargs) + self.pool['mail.message'].browse(cr, uid, message_id)._get_sent() + + +class mail_compose_message(models.TransientModel): + + _inherit = 'mail.compose.message' + sent = fields.Boolean('Sent', help='dummy field to fix inherit error') + diff --git a/mail_sent/static/description/icon.png b/mail_sent/static/description/icon.png new file mode 100644 index 0000000..79f7d8f Binary files /dev/null and b/mail_sent/static/description/icon.png differ diff --git a/mail_sent/static/description/index.html b/mail_sent/static/description/index.html new file mode 100644 index 0000000..29b01a1 --- /dev/null +++ b/mail_sent/static/description/index.html @@ -0,0 +1,47 @@ +
+
+
+

Sentbox

+

Quick way to check sent messages

+
+
+
+ +
+
+
+

+ The module adds usual menu. +

+
+
+
+ +
+
+
+

+This menu shows messages in threads (like in other menus), but shows only sent messages. +

+
+
+
+ +
+
+
+
+ +
+
+ +
+
diff --git a/mail_sent/static/description/menu.png b/mail_sent/static/description/menu.png new file mode 100644 index 0000000..9c7664c Binary files /dev/null and b/mail_sent/static/description/menu.png differ diff --git a/mail_sent/static/description/messages.png b/mail_sent/static/description/messages.png new file mode 100644 index 0000000..97d1d9d Binary files /dev/null and b/mail_sent/static/description/messages.png differ diff --git a/mail_sent/views.xml b/mail_sent/views.xml new file mode 100644 index 0000000..804d323 --- /dev/null +++ b/mail_sent/views.xml @@ -0,0 +1,38 @@ + + + + + Sent + mail.wall + { + 'default_model': 'res.users', + 'default_res_id': uid, + 'thread_model': 'res.partner', + 'needaction_menu_ref': ['mail.mail_tomefeeds', 'mail.mail_starfeeds', 'mail.mail_inboxfeeds'] + } + + +

+ No message found and no message sent yet. +

+ Click on the top-right icon to compose a message. This + message will be sent by email if it's an internal contact. +

+
+
+ + + Sent + + + + +
+