Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🎉 mail_decode_address #271

Open
wants to merge 3 commits into
base: 13.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions mail_decode_address/README.rst
Original file line number Diff line number Diff line change
@@ -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 <https://it-projects.info/team/em230418>`__:

* :one::zero: init version of the module

Sponsors
--------
* `IT-Projects LLC <https://it-projects.info>`__

Maintainers
-----------
* `IT-Projects LLC <https://it-projects.info>`__

To get a guaranteed support
you are kindly requested to purchase the module
at `odoo apps store <https://apps.odoo.com/apps/modules/13.0/fix_from_address/>`__.

Thank you for understanding!

`IT-Projects Team <https://www.it-projects.info/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: `<doc/index.rst>`_

Changelog: `<doc/changelog.rst>`_

Notifications on updates: `via Atom <https://github.com/it-projects-llc/misc-addons/commits/13.0/fix_from_address.atom>`_, `by Email <https://blogtrottr.com/?subscribe=https://github.com/it-projects-llc/misc-addons/commits/13.0/fix_from_address.atom>`_

Tested on Odoo 13.0 d23d872f885f34bbbd747471e35e6914ac79b6cf
1 change: 1 addition & 0 deletions mail_decode_address/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
49 changes: 49 additions & 0 deletions mail_decode_address/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Copyright 2020 Eugene Molotov <https://it-projects.info/team/em230418>
# 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",
# ]
}
4 changes: 4 additions & 0 deletions mail_decode_address/doc/changelog.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
`1.0.0`
-------

- **Init version**
35 changes: 35 additions & 0 deletions mail_decode_address/doc/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
============
Fix Emails
============

Installation
============
{Instruction about things to do before actual installation}

* {OPTIONAL }`Activate longpolling <https://odoo-development.readthedocs.io/en/latest/admin/longpolling.html>`__
* {Additional notes if any}
* `Install <https://odoo-development.readthedocs.io/en/latest/odoo/usage/install-module.html>`__ this module in a usual way

Configuration
=============

{Instruction how to configure the module before start to use it}

* `Log in as SUPERUSER <https://odoo-development.readthedocs.io/en/latest/odoo/usage/login-as-superuser.html>`__
* `Activate Developer Mode <https://odoo-development.readthedocs.io/en/latest/odoo/usage/debug-mode.html>`__
* 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.}
3 changes: 3 additions & 0 deletions mail_decode_address/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)

from . import mail_thread
22 changes: 22 additions & 0 deletions mail_decode_address/models/mail_thread.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright 2020 Eugene Molotov <https://it-projects.info/team/em230418>
# 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)
Binary file added mail_decode_address/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.