diff --git a/mail_decode_address/README.rst b/mail_decode_address/README.rst new file mode 100644 index 00000000..bb5667bd --- /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 00000000..9a7e03ed --- /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 00000000..49b701e0 --- /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 00000000..5583eb32 --- /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 00000000..ab90ea0b --- /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 00000000..0f6a3acf --- /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 00000000..2c347d09 --- /dev/null +++ b/mail_decode_address/models/mail_thread.py @@ -0,0 +1,22 @@ +# 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' + + @api.model + def create(self, vals): + for f in ("email_from", "contact_name",): + if vals.get(f): + vals[f] = tools.decode_smtp_header(vals[f]) + + return super(MailThread, self).create(vals) + + 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 00000000..b43a0a13 Binary files /dev/null and b/mail_decode_address/static/description/icon.png differ