From 2ea0e7eaf7d230a4cc9cb3347339d44863593a7d Mon Sep 17 00:00:00 2001 From: kevinkhao Date: Sun, 12 Apr 2020 03:54:38 +0200 Subject: [PATCH] [12.0][MIG] partner_address_version: Migration to 12.0 --- partner_address_version/README.rst | 21 +++++++++++-------- partner_address_version/__init__.py | 1 - partner_address_version/__manifest__.py | 3 +-- partner_address_version/models/res_partner.py | 3 +-- .../readme/CONTRIBUTORS.rst | 1 + .../readme/DESCRIPTION.rst | 10 +++++---- .../static/description/index.html | 17 ++++++++------- .../tests/test_address_version.py | 5 +++-- 8 files changed, 34 insertions(+), 27 deletions(-) diff --git a/partner_address_version/README.rst b/partner_address_version/README.rst index e56f21c0e..496af0b0f 100644 --- a/partner_address_version/README.rst +++ b/partner_address_version/README.rst @@ -14,23 +14,25 @@ Partner Address Version :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/10.0/partner_address_version + :target: https://github.com/OCA/partner-contact/tree/12.0/partner_address_version :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-10-0/partner-contact-10-0-partner_address_version + :target: https://translation.odoo-community.org/projects/partner-contact-12-0/partner-contact-12-0-partner_address_version :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/10.0 + :target: https://runbot.odoo-community.org/runbot/134/12.0 :alt: Try me on Runbot |badge1| |badge2| |badge3| |badge4| |badge5| -This module allows to manage versions for partner addresses. +This module allows you to manage versions for partner addresses. -You can define a list of versionned fields, for instance address, country, ... -Those fields cannot be changed once an address is versionned. +A list of fields are defined for versioning. These are immutable once set, and force the user to create a new partner +if they want to change one of these fields. -This can be useful to know where a sale order has been delivered even after several changes on the partner addresses. +This forces historical consistency. For example, the moment you confirm a +sale order, you might want to lock the address of that sale order instead of having it +change everytime that partner is modified (see e.g sale_partner_version). **Table of contents** @@ -43,7 +45,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. @@ -59,6 +61,7 @@ Contributors ~~~~~~~~~~~~ * Benoît Guillot +* Kevin Khao Maintainers ~~~~~~~~~~~ @@ -73,6 +76,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_address_version/__init__.py b/partner_address_version/__init__.py index 186ec6921..2800aae86 100644 --- a/partner_address_version/__init__.py +++ b/partner_address_version/__init__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2018 Akretion - Benoît Guillot # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). diff --git a/partner_address_version/__manifest__.py b/partner_address_version/__manifest__.py index 0d7e727a3..6af2021d5 100644 --- a/partner_address_version/__manifest__.py +++ b/partner_address_version/__manifest__.py @@ -1,9 +1,8 @@ -# -*- coding: utf-8 -*- # Copyright 2018 Akretion - Benoît Guillot # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { "name": "Partner Address Version", - "version": "10.0.1.0.0", + "version": "12.0.1.0.0", "author": "Akretion, " "Odoo Community Association (OCA)", "website": "https://github.com/OCA/partner-contact", "category": "CRM", diff --git a/partner_address_version/models/res_partner.py b/partner_address_version/models/res_partner.py index dbada916b..12a333ef0 100644 --- a/partner_address_version/models/res_partner.py +++ b/partner_address_version/models/res_partner.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2018 Akretion - Benoît Guillot # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). @@ -55,7 +54,7 @@ class ResPartner(models.Model): version[field] = parent_id elif self[field]: version[field] = self[field] - version_hash = hashlib.md5(str(version)).hexdigest() + version_hash = hashlib.md5(str(version).encode("utf-8")).hexdigest() return version_hash @api.multi diff --git a/partner_address_version/readme/CONTRIBUTORS.rst b/partner_address_version/readme/CONTRIBUTORS.rst index 54ea6561e..da15bbc3f 100644 --- a/partner_address_version/readme/CONTRIBUTORS.rst +++ b/partner_address_version/readme/CONTRIBUTORS.rst @@ -1 +1,2 @@ * Benoît Guillot +* Kevin Khao diff --git a/partner_address_version/readme/DESCRIPTION.rst b/partner_address_version/readme/DESCRIPTION.rst index cf50fe441..e05a9400b 100644 --- a/partner_address_version/readme/DESCRIPTION.rst +++ b/partner_address_version/readme/DESCRIPTION.rst @@ -1,6 +1,8 @@ -This module allows to manage versions for partner addresses. +This module allows you to manage versions for partner addresses. -You can define a list of versionned fields, for instance address, country, ... -Those fields cannot be changed once an address is versionned. +A list of fields are defined for versioning. These are immutable once set, and force the user to create a new partner +if they want to change one of these fields. -This can be useful to know where a sale order has been delivered even after several changes on the partner addresses. +This forces historical consistency. For example, the moment you confirm a +sale order, you might want to lock the address of that sale order instead of having it +change everytime that partner is modified (see e.g sale_partner_version). diff --git a/partner_address_version/static/description/index.html b/partner_address_version/static/description/index.html index 3bac3040d..3826b412e 100644 --- a/partner_address_version/static/description/index.html +++ b/partner_address_version/static/description/index.html @@ -367,11 +367,13 @@ 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

-

This module allows to manage versions for partner addresses.

-

You can define a list of versionned fields, for instance address, country, … -Those fields cannot be changed once an address is versionned.

-

This can be useful to know where a sale order has been delivered even after several changes on the partner addresses.

+

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

+

This module allows you to manage versions for partner addresses.

+

A list of fields are defined for versioning. These are immutable once set, and force the user to create a new partner +if they want to change one of these fields.

+

This forces historical consistency. For example, the moment you confirm a +sale order, you might want to lock the address of that sale order instead of having it +change everytime that partner is modified (see e.g sale_partner_version).

Table of contents

    @@ -389,7 +391,7 @@ Those fields cannot be changed once an address is versionned.

    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.

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

Contributors

@@ -413,7 +416,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_address_version/tests/test_address_version.py b/partner_address_version/tests/test_address_version.py index 2ec09ca3f..5b974870f 100644 --- a/partner_address_version/tests/test_address_version.py +++ b/partner_address_version/tests/test_address_version.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2018 Akretion - Benoît Guillot # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). @@ -30,7 +29,9 @@ class TestAddressVersion(SavepointCase): cls.partner_vals.update({"parent_id": cls.partner.id}) def test_hash(self): - test_hash = hashlib.md5(str(self.partner_vals)).hexdigest() + test_hash = hashlib.md5( + str(self.partner_vals).encode("utf-8") + ).hexdigest() self.assertEqual(test_hash, self.partner.get_version_hash()) def test_create_version_partner(self):