From 0eadbabf617db63341755dfe1ecc6905141836dd Mon Sep 17 00:00:00 2001 From: Stephan Keller Date: Sun, 10 May 2020 09:43:56 +0200 Subject: [PATCH] [MIG] partner_disable_gravatar: Migration to 13.0 --- partner_disable_gravatar/README.rst | 10 +++++----- partner_disable_gravatar/__manifest__.py | 6 +++--- .../static/description/index.html | 6 +++--- partner_disable_gravatar/tests/__init__.py | 1 + .../tests/test_partner_disable_gravatar.py | 17 +++++++++++++++++ 5 files changed, 29 insertions(+), 11 deletions(-) create mode 100644 partner_disable_gravatar/tests/__init__.py create mode 100644 partner_disable_gravatar/tests/test_partner_disable_gravatar.py diff --git a/partner_disable_gravatar/README.rst b/partner_disable_gravatar/README.rst index 3a4cbd8a0..7a467789e 100644 --- a/partner_disable_gravatar/README.rst +++ b/partner_disable_gravatar/README.rst @@ -14,13 +14,13 @@ Partner Disable Gravatar :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpartner--contact-lightgray.png?logo=github - :target: https://github.com/OCA/partner-contact/tree/12.0/partner_disable_gravatar + :target: https://github.com/OCA/partner-contact/tree/13.0/partner_disable_gravatar :alt: OCA/partner-contact .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/partner-contact-12-0/partner-contact-12-0-partner_disable_gravatar + :target: https://translation.odoo-community.org/projects/partner-contact-13-0/partner-contact-13-0-partner_disable_gravatar :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/134/12.0 + :target: https://runbot.odoo-community.org/runbot/134/13.0 :alt: Try me on Runbot |badge1| |badge2| |badge3| |badge4| |badge5| @@ -51,7 +51,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -81,6 +81,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. -This module is part of the `OCA/partner-contact `_ project on GitHub. +This module is part of the `OCA/partner-contact `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/partner_disable_gravatar/__manifest__.py b/partner_disable_gravatar/__manifest__.py index d65919c8d..d1b809457 100644 --- a/partner_disable_gravatar/__manifest__.py +++ b/partner_disable_gravatar/__manifest__.py @@ -1,14 +1,14 @@ # Copyright 2018-2019 Akretion France (https://akretion.com/) # @author: Alexis de Lattre -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). { "name": "Partner Disable Gravatar", - "version": "12.0.1.0.0", + "version": "13.0.1.0.0", "category": "Tools", "license": "AGPL-3", "summary": "Disable automatic connection to gravatar.com", - "author": "Akretion,Odoo Community Association (OCA)", + "author": "Akretion, Odoo Community Association (OCA)", "website": "https://github.com/OCA/partner-contact", "depends": ["base"], "installable": True, diff --git a/partner_disable_gravatar/static/description/index.html b/partner_disable_gravatar/static/description/index.html index 51ba3bef1..94c852eda 100644 --- a/partner_disable_gravatar/static/description/index.html +++ b/partner_disable_gravatar/static/description/index.html @@ -367,7 +367,7 @@ ul.auto-toc { !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

Beta License: AGPL-3 OCA/partner-contact Translate me on Weblate Try me on Runbot

+

Beta License: AGPL-3 OCA/partner-contact Translate me on Weblate Try me on Runbot

A new feature has been introduced in Odoo v10 in the base module: when you enter an email address in the form view of a partner, Odoo will send a query to gravatar.com to get a picture corresponding to the email address.

Gravatar, which stands for Globally Recognized Avatar, is a website where any user can open an account and register a correspondance between his email address and a picture. That way, his picture/avatar will be automatically set on all websites that are connected to gravatar.com: he won’t have to manually configure his picture/avatar on every website.

In Odoo, when you enter an email address in the form view of a partner (i.e. triggered via the onchange on the email field) and this partner doesn’t have any image yet in Odoo, Odoo will automatically send an HTTPS query to www.gravatar.com with an MD5 hash of the email of the partner. If it receives an answer from gravatar.com in the form of a picture within the 5 seconds timeout, it will set this picture on the image field of the partner in Odoo.

@@ -395,7 +395,7 @@ ul.auto-toc {

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed -feedback.

+feedback.

Do not contact contributors directly about support or help with technical issues.

@@ -419,7 +419,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome

OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

-

This module is part of the OCA/partner-contact project on GitHub.

+

This module is part of the OCA/partner-contact project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

diff --git a/partner_disable_gravatar/tests/__init__.py b/partner_disable_gravatar/tests/__init__.py new file mode 100644 index 000000000..2485d1170 --- /dev/null +++ b/partner_disable_gravatar/tests/__init__.py @@ -0,0 +1 @@ +from . import test_partner_disable_gravatar diff --git a/partner_disable_gravatar/tests/test_partner_disable_gravatar.py b/partner_disable_gravatar/tests/test_partner_disable_gravatar.py new file mode 100644 index 000000000..bf64b69d7 --- /dev/null +++ b/partner_disable_gravatar/tests/test_partner_disable_gravatar.py @@ -0,0 +1,17 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +from odoo.tests import Form, common + + +class TestPartnerDisableGravatar(common.TransactionCase): + + # https://github.com/odoo/odoo/blob/ + # 28034c48c024284ea3bd6248451e186132aca4d0/odoo/tests/common.py#L407 + def patch(self, obj, key, val): + pass + + def test_disable_gravatar(self): + with Form(self.env["res.partner"]) as f1: + f1.name = "Support Gravatar" + f1.email = "support@gravatar.com" + self.assertFalse(f1.image_1920)