From ac818fb2c9a83741fab52b5ac2fce54a843ec6f6 Mon Sep 17 00:00:00 2001 From: Eugene Molotov Date: Tue, 18 Feb 2020 19:21:29 +0500 Subject: [PATCH] :tada: mail_decode_address --- mail_decode_address/README.rst | 51 ++++++++++++++++++ mail_decode_address/__init__.py | 1 + mail_decode_address/__manifest__.py | 49 +++++++++++++++++ mail_decode_address/doc/changelog.rst | 4 ++ mail_decode_address/doc/index.rst | 35 ++++++++++++ mail_decode_address/models/__init__.py | 3 ++ mail_decode_address/models/mail_thread.py | 14 +++++ .../static/description/icon.png | Bin 0 -> 3035 bytes 8 files changed, 157 insertions(+) create mode 100644 mail_decode_address/README.rst create mode 100644 mail_decode_address/__init__.py create mode 100644 mail_decode_address/__manifest__.py create mode 100644 mail_decode_address/doc/changelog.rst create mode 100644 mail_decode_address/doc/index.rst create mode 100644 mail_decode_address/models/__init__.py create mode 100644 mail_decode_address/models/mail_thread.py create mode 100644 mail_decode_address/static/description/icon.png diff --git a/mail_decode_address/README.rst b/mail_decode_address/README.rst new file mode 100644 index 0000000..bb5667b --- /dev/null +++ b/mail_decode_address/README.rst @@ -0,0 +1,51 @@ +.. image:: https://img.shields.io/badge/license-LGPL--3-blue.png + :target: https://www.gnu.org/licenses/lgpl + :alt: License: LGPL-3 + +============ + Fix Emails +============ + +short + +detailed + +Credits +======= + +Contributors +------------ +* `Eugene Molotov `__: + + * :one::zero: init version of the module + +Sponsors +-------- +* `IT-Projects LLC `__ + +Maintainers +----------- +* `IT-Projects LLC `__ + + To get a guaranteed support + you are kindly requested to purchase the module + at `odoo apps store `__. + + Thank you for understanding! + + `IT-Projects Team `__ + +Further information +=================== + +Demo: http://runbot.it-projects.info/demo/misc-addons/13.0 + +HTML Description: https://apps.odoo.com/apps/modules/13.0/fix_from_address/ + +Usage instructions: ``_ + +Changelog: ``_ + +Notifications on updates: `via Atom `_, `by Email `_ + +Tested on Odoo 13.0 d23d872f885f34bbbd747471e35e6914ac79b6cf diff --git a/mail_decode_address/__init__.py b/mail_decode_address/__init__.py new file mode 100644 index 0000000..9a7e03e --- /dev/null +++ b/mail_decode_address/__init__.py @@ -0,0 +1 @@ +from . import models \ No newline at end of file diff --git a/mail_decode_address/__manifest__.py b/mail_decode_address/__manifest__.py new file mode 100644 index 0000000..49b701e --- /dev/null +++ b/mail_decode_address/__manifest__.py @@ -0,0 +1,49 @@ +# Copyright 2020 Eugene Molotov +# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). + +{ + "name": """Fix emails""", + "summary": """short""", + "category": "Extra Tools", + # "live_test_url": "http://apps.it-projects.info/shop/product/DEMO-URL?version=13.0", + "images": [], + "version": "13.0.1.0.0", + "application": False, + + "author": "IT-Projects LLC, Eugene Molotov", + "support": "apps@it-projects.info", + "website": "https://apps.odoo.com/apps/modules/13.0/fix_from_address/", + "license": "LGPL-3", + # "price": 9.00, + # "currency": "EUR", + + "depends": [ + 'mail', + ], + "external_dependencies": {"python": [], "bin": []}, + "data": [ + ], + "demo": [ + ], + "qweb": [ + ], + + "post_load": None, + "pre_init_hook": None, + "post_init_hook": None, + "uninstall_hook": None, + + "auto_install": False, + "installable": True, + + # "demo_title": "Fix emails", + # "demo_addons": [ + # ], + # "demo_addons_hidden": [ + # ], + # "demo_url": "DEMO-URL", + # "demo_summary": "short", + # "demo_images": [ + # "images/MAIN_IMAGE", + # ] +} diff --git a/mail_decode_address/doc/changelog.rst b/mail_decode_address/doc/changelog.rst new file mode 100644 index 0000000..5583eb3 --- /dev/null +++ b/mail_decode_address/doc/changelog.rst @@ -0,0 +1,4 @@ +`1.0.0` +------- + +- **Init version** diff --git a/mail_decode_address/doc/index.rst b/mail_decode_address/doc/index.rst new file mode 100644 index 0000000..ab90ea0 --- /dev/null +++ b/mail_decode_address/doc/index.rst @@ -0,0 +1,35 @@ +============ + Fix Emails +============ + +Installation +============ +{Instruction about things to do before actual installation} + +* {OPTIONAL }`Activate longpolling `__ +* {Additional notes if any} +* `Install `__ this module in a usual way + +Configuration +============= + +{Instruction how to configure the module before start to use it} + +* `Log in as SUPERUSER `__ +* `Activate Developer Mode `__ +* Open menu ``[[ {Menu} ]] >> {Submenu} >> {Subsubmenu}`` +* Click ``[{Button Name}]`` + +Usage +===== + +{Instruction for daily usage. It should describe how to check that module works. What shall user do and what would user get.} + +* Open menu ``[[ {Menu} ]]>> {Submenu} >> {Subsubmenu}`` +* Click ``[{Button Name}]`` +* RESULT: {what user gets, how the modules changes default behaviour} + +Uninstallation +============== + +{Optional section for uninstallation notes. Delete it if you don't have notes for uninstallation.} diff --git a/mail_decode_address/models/__init__.py b/mail_decode_address/models/__init__.py new file mode 100644 index 0000000..0f6a3ac --- /dev/null +++ b/mail_decode_address/models/__init__.py @@ -0,0 +1,3 @@ +# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html) + +from . import mail_thread diff --git a/mail_decode_address/models/mail_thread.py b/mail_decode_address/models/mail_thread.py new file mode 100644 index 0000000..94220d4 --- /dev/null +++ b/mail_decode_address/models/mail_thread.py @@ -0,0 +1,14 @@ +# Copyright 2020 Eugene Molotov +# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). + +from odoo import api, fields, models, tools + + +class MailThread(models.AbstractModel): + + _inherit = 'mail.thread' + + def _message_post_after_hook(self, message, msg_vals): + if message.email_from: + message.email_from = tools.decode_smtp_header(message.email_from) + super(MailThread, self)._message_post_after_hook(message, msg_vals) diff --git a/mail_decode_address/static/description/icon.png b/mail_decode_address/static/description/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..b43a0a135f903a4c0c401f03a8690fbbd021a2ab GIT binary patch literal 3035 zcmV<13ncW3P))ueQQHJ1Rg98mIup&<-zh`c?djM9xM-*2g`%y!SWDzusm2EEDx3k%Y)@1 z@L+kcJXjvA!P)%o{8@9>FT5*fw0hgsc`>kZ>zPoCrz~G;M%wh{vnQ0~t0Ouo+OX8y zhTV}O`(vk%|Nd`EGA56^<&*^l80F5*XUA9QYYVkB*EZPqpZ?rzUO^Vxb+~r(C!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