diff --git a/mail_sent/README.rst b/mail_sent/README.rst new file mode 100644 index 0000000..41662b5 --- /dev/null +++ b/mail_sent/README.rst @@ -0,0 +1,15 @@ +Mail Sent +========= + +Adds Sent menu, which shows sent messages + +Usage +----- +Click Discuss/Sent menu -- sent messages are displayed + +Further information +------------------- + +HTML Description: https://apps.odoo.com/apps/modules/9.0/mail_sent/ + +Tested on Odoo 9.0 b9f206953e3f877adf18643f154d1262842564ee \ No newline at end of file diff --git a/mail_sent/__init__.py b/mail_sent/__init__.py new file mode 100644 index 0000000..5305644 --- /dev/null +++ b/mail_sent/__init__.py @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- + +from . import models \ No newline at end of file diff --git a/mail_sent/__openerp__.py b/mail_sent/__openerp__.py new file mode 100644 index 0000000..4f1b75e --- /dev/null +++ b/mail_sent/__openerp__.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +{ + "name": "Mail Sent", + "summary": """Create sent channel""", + "category": "Discuss", + "images": [], + "version": "1.0.0", + + "author": "IT-Projects LLC, Pavel Romanchenko", + "website": "https://it-projects.info", + "license": "LGPL-3", + + "depends": [ + "base", + "mail", + "mail_base" + ], + + "data": [ + "views/templates.xml", + ], + "qweb": [ + "static/src/xml/menu.xml", + ], + 'installable': True, +} diff --git a/mail_sent/models/__init__.py b/mail_sent/models/__init__.py new file mode 100644 index 0000000..40a96af --- /dev/null +++ b/mail_sent/models/__init__.py @@ -0,0 +1 @@ +# -*- coding: utf-8 -*- 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/src/js/sent.js b/mail_sent/static/src/js/sent.js new file mode 100644 index 0000000..86813fb --- /dev/null +++ b/mail_sent/static/src/js/sent.js @@ -0,0 +1,56 @@ +odoo.define('mail_archives.archives', function (require) { +"use strict"; + +var base_obj = require('mail_base.base'); + +//------------------------------------------------------------------------------- +var bus = require('bus.bus').bus; +var config = require('web.config'); +var core = require('web.core'); +var data = require('web.data'); +var Model = require('web.Model'); +var session = require('web.session'); +var time = require('web.time'); +var web_client = require('web.web_client'); + +var _t = core._t; +//------------------------------------------------------------------------------- + +// Inherit class and override methods +base_obj.MailTools.include({ + get_properties: function(msg){ + var properties = this._super.apply(this, arguments); + properties.is_archive = this.property_descr("channel_archive", msg, this); + return properties; + }, + + set_channel_flags: function(data, msg){ + this._super.apply(this, arguments); + msg.is_archive = true; + return msg; + }, + + get_channel_array: function(msg){ + var arr = this._super.apply(this, arguments); + return arr.concat('channel_archive'); + }, + + get_domain: function(channel){ + return (channel.id === "channel_archive") ? [] : this._super.apply(this, arguments); + } +}); + +base_obj.chat_manager.is_ready.then(function(){ + // Add archive channel + base_obj.chat_manager.mail_tools.add_channel({ + id: "channel_archive", + name: _t("Archive"), + type: "static" + }); + + return $.when(); + }); + +return base_obj.chat_manager; + +}); diff --git a/mail_sent/static/src/xml/menu.xml b/mail_sent/static/src/xml/menu.xml new file mode 100644 index 0000000..799a379 --- /dev/null +++ b/mail_sent/static/src/xml/menu.xml @@ -0,0 +1,20 @@ + + diff --git a/mail_sent/views/templates.xml b/mail_sent/views/templates.xml new file mode 100644 index 0000000..3e685e0 --- /dev/null +++ b/mail_sent/views/templates.xml @@ -0,0 +1,12 @@ + + + + + + \ No newline at end of file