diff --git a/mail_check_immediately/README.rst b/mail_check_immediately/README.rst deleted file mode 100644 index 52b572d..0000000 --- a/mail_check_immediately/README.rst +++ /dev/null @@ -1,8 +0,0 @@ -.. image:: https://itpp.dev/images/infinity-readme.png - :alt: Tested and maintained by IT Projects Labs - :target: https://itpp.dev - -Check mail immediately -====================== - -Description: https://apps.odoo.com/apps/modules/8.0/mail_check_immediately/ diff --git a/mail_check_immediately/__init__.py b/mail_check_immediately/__init__.py deleted file mode 100644 index 0650744..0000000 --- a/mail_check_immediately/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from . import models diff --git a/mail_check_immediately/__manifest__.py b/mail_check_immediately/__manifest__.py deleted file mode 100644 index aaf9222..0000000 --- a/mail_check_immediately/__manifest__.py +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "Check mail immediately", - "version": "11.0.1.0.1", - "author": "IT-Projects LLC, Ivan Yelizariev", - "license": "Other OSI approved licence", # MIT - "category": "Discuss", - "support": "apps@itpp.dev", - "website": "https://twitter.com/yelizariev", - "price": 9.00, - "currency": "EUR", - "depends": ["base", "web", "fetchmail", "mail"], - "data": ["views.xml"], - "qweb": ["static/src/xml/main.xml"], - "installable": False, -} diff --git a/mail_check_immediately/doc/changelog.rst b/mail_check_immediately/doc/changelog.rst deleted file mode 100644 index 3dfce87..0000000 --- a/mail_check_immediately/doc/changelog.rst +++ /dev/null @@ -1,4 +0,0 @@ -`1.0.1` -------- - -- FIX: incorrectly displayed last updated time when multiple threads (--workers) diff --git a/mail_check_immediately/models.py b/mail_check_immediately/models.py deleted file mode 100644 index b0ad4d0..0000000 --- a/mail_check_immediately/models.py +++ /dev/null @@ -1,80 +0,0 @@ -import datetime - -from odoo import api, exceptions, fields, models, tools -from odoo.tools.translate import _ - - -class FetchMailServer(models.Model): - _inherit = "fetchmail.server" - _name = "fetchmail.server" - - _last_updated = None - - run_time = fields.Datetime(string="Launch time") - - def _run_time(self): - if not self._last_updated: - self._last_updated = tools.datetime.now() - - src_tstamp_str = self._last_updated.strftime( - tools.misc.DEFAULT_SERVER_DATETIME_FORMAT - ) - src_format = tools.misc.DEFAULT_SERVER_DATETIME_FORMAT - dst_format = tools.misc.DEFAULT_SERVER_DATETIME_FORMAT - dst_tz_name = self._context.get("tz") or self.env.user.tz - _now = tools.misc.server_to_local_timestamp( - src_tstamp_str, src_format, dst_format, dst_tz_name - ) - - return _now - - @api.model - def _fetch_mails(self): - - if self._context.get("run_fetchmail_manually"): - # if interval less than 5 seconds - if self._last_updated and ( - datetime.datetime.now() - self._last_updated - ) < datetime.timedelta(0, 5): - raise exceptions.Warning( - _("Error"), _("Task can be started no earlier than 5 seconds.") - ) - - super(FetchMailServer, self)._fetch_mails() - - res = ( - self.env["fetchmail.server"] - .sudo() - .with_context(tz=self.env.user.tz) - .search([("state", "=", "done")]) - ) - if res: - res[0].run_time = self._run_time() - - -class FetchMailImmediately(models.AbstractModel): - - _name = "fetch_mail.imm" - - @api.model - def get_last_update_time(self): - res = ( - self.env["fetchmail.server"] - .sudo() - .with_context(tz=self.env.user.tz) - .search([("state", "=", "done")]) - ) - array = [r.run_time for r in res] - if array: - return array[0] - else: - return None - - @api.model - def run_fetchmail_manually(self): - - fetchmail_task = self.env.ref("fetchmail.ir_cron_mail_gateway_action") - fetchmail_model = self.env["fetchmail.server"].sudo() - - fetchmail_task._try_lock() - fetchmail_model.with_context(run_fetchmail_manually=True)._fetch_mails() diff --git a/mail_check_immediately/static/description/icon.png b/mail_check_immediately/static/description/icon.png deleted file mode 100644 index 79f7d8f..0000000 Binary files a/mail_check_immediately/static/description/icon.png and /dev/null differ diff --git a/mail_check_immediately/static/description/index.html b/mail_check_immediately/static/description/index.html deleted file mode 100644 index 889a48b..0000000 --- a/mail_check_immediately/static/description/index.html +++ /dev/null @@ -1,49 +0,0 @@ -
-
-
-

Check mail immediately

-

Keep your inbox up to date

-
- -
-
- -
-
-
-
- -
-
-
-

Protect your business

-
-
-

- Sometimes odoo mail fetching system doesn't work for really long time. It could be a real problem, if you will not notice it on time. Until this issue is fixed, you can restart odoo every time when you see that last fetching time is more than 5 minutes. -

-
- -
-
- -
-
-
-
- -
-
-
-

Need our service?

-

Contact us by email or fill out request form

- -
-
-
diff --git a/mail_check_immediately/static/description/issue.png b/mail_check_immediately/static/description/issue.png deleted file mode 100644 index 79ef713..0000000 Binary files a/mail_check_immediately/static/description/issue.png and /dev/null differ diff --git a/mail_check_immediately/static/description/screenshot.png b/mail_check_immediately/static/description/screenshot.png deleted file mode 100644 index a408525..0000000 Binary files a/mail_check_immediately/static/description/screenshot.png and /dev/null differ diff --git a/mail_check_immediately/static/src/js/main.js b/mail_check_immediately/static/src/js/main.js deleted file mode 100644 index 8f1aa1d..0000000 --- a/mail_check_immediately/static/src/js/main.js +++ /dev/null @@ -1,60 +0,0 @@ -openerp.mail_check_immediately = function(instance, local) { - "use strict"; - instance.mail.Wall.include({ - init: function() { - this._super.apply(this, arguments); - - var _this = this; - - this.imm_model = new instance.web.Model("fetch_mail.imm"); - this.events["click a.oe_fetch_new_mails"] = function() { - _this.run_fetchmail_manually(); - }; - }, - - start: function() { - var _this = this; - - this._super(); - - this.get_last_fetched_time(); - - this.get_time_loop = setInterval(function() { - _this.get_last_fetched_time(); - }, 30000); - }, - - run_fetchmail_manually: function() { - var _this = this; - - this.imm_model - .call("run_fetchmail_manually", { - context: new instance.web.CompoundContext(), - }) - .then(function() { - _this.get_last_fetched_time(); - }); - }, - - get_last_fetched_time: function() { - var _this = this; - this.imm_model - .call("get_last_update_time", { - context: new instance.web.CompoundContext(), - }) - .then(function(res) { - var value = null; - if (res) value = $.timeago(res); - value = value || "undefined"; - _this.$el - .find("span.oe_view_manager_fetch_mail_imm_field") - .html(value); - }); - }, - - destroy: function() { - clearInterval(this.get_time_loop); - this._super.apply(this, arguments); - }, - }); -}; diff --git a/mail_check_immediately/static/src/xml/main.xml b/mail_check_immediately/static/src/xml/main.xml deleted file mode 100644 index 7bf9c8e..0000000 --- a/mail_check_immediately/static/src/xml/main.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - -
- - Mails fetched: - - - - -
- - - -
- - - - - - - -
diff --git a/mail_check_immediately/views.xml b/mail_check_immediately/views.xml deleted file mode 100644 index 1e1a1ba..0000000 --- a/mail_check_immediately/views.xml +++ /dev/null @@ -1,16 +0,0 @@ - - -