diff --git a/mail_recovery/README.rst b/mail_recovery/README.rst index 1cd5ee0..04dae5b 100644 --- a/mail_recovery/README.rst +++ b/mail_recovery/README.rst @@ -23,12 +23,12 @@ Sponsors Further information =================== -Demo: http://runbot.it-projects.info/demo/mail-addons/8.0 +Demo: http://runbot.it-projects.info/demo/mail-addons/9.0 -HTML Description: https://apps.odoo.com/apps/modules/8.0/mail_recovery/ +HTML Description: https://apps.odoo.com/apps/modules/9.0/mail_recovery/ Usage instructions: ``_ Changelog: ``_ -Tested on Odoo 8.0 17a130428516d9dd8105f90e8c9a65a0b4e8901b +Tested on Odoo 9.0 fd9eb2e4819031c6758c021f4c335b591367632d diff --git a/mail_recovery/__openerp__.py b/mail_recovery/__openerp__.py index 9acf812..383622e 100644 --- a/mail_recovery/__openerp__.py +++ b/mail_recovery/__openerp__.py @@ -13,5 +13,5 @@ 'data': [ 'data.xml', ], - "installable": False, + "installable": True, } diff --git a/mail_recovery/static/src/js/mail_recovery.js b/mail_recovery/static/src/js/mail_recovery.js index 3d52a4a..0ba7085 100644 --- a/mail_recovery/static/src/js/mail_recovery.js +++ b/mail_recovery/static/src/js/mail_recovery.js @@ -1,12 +1,11 @@ -openerp.mail_recovery = function (session) { - var mail = session.mail; +odoo.define('mail_recovery', function (require) { + var composer = require('mail.composer'); - mail.ThreadComposeMessage = mail.ThreadComposeMessage.extend({ - bind_events: function () { - var self = this; - this.$('textarea').on('focus', self.on_focus_textarea); - this.$('textarea').on('keyup', self.on_keyup_textarea); - this._super(); + composer.BasicComposer.include({ + init: function(){ + this._super.apply(this, arguments); + this.events['focus .o_composer_input textarea'] = 'on_focus_textarea'; + this.events['keyup .o_composer_input textarea'] = 'on_keyup_textarea'; }, on_focus_textarea: function(event) { var $input = $(event.target); @@ -17,9 +16,9 @@ openerp.mail_recovery = function (session) { on_keyup_textarea: function(event) { window.localStorage['message_storage'] = $(event.target).val(); }, - on_message_post: function (event) { + send_message: function (event) { window.localStorage['message_storage'] = ''; return this._super(event); }, }); -}; \ No newline at end of file +})