From a6305277f35dad2cfd7cdbf046d7e62d1da0280d Mon Sep 17 00:00:00 2001 From: Guille Date: Wed, 21 Oct 2020 12:32:04 +0200 Subject: [PATCH] [MIG] contract_mandate: Migration to 13.0 --- contract_mandate/README.rst | 11 +++++----- contract_mandate/__manifest__.py | 6 +++--- contract_mandate/i18n/contract_mandate.pot | 2 +- contract_mandate/models/contract.py | 20 ++----------------- contract_mandate/readme/CONTRIBUTORS.rst | 1 + .../static/description/index.html | 9 +++++---- .../tests/test_contract_mandate.py | 10 +++------- 7 files changed, 21 insertions(+), 38 deletions(-) diff --git a/contract_mandate/README.rst b/contract_mandate/README.rst index 738d0c8d6..06551d9c6 100644 --- a/contract_mandate/README.rst +++ b/contract_mandate/README.rst @@ -14,13 +14,13 @@ Contract Mandate :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fcontract-lightgray.png?logo=github - :target: https://github.com/OCA/contract/tree/12.0/contract_mandate + :target: https://github.com/OCA/contract/tree/13.0/contract_mandate :alt: OCA/contract .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/contract-12-0/contract-12-0-contract_mandate + :target: https://translation.odoo-community.org/projects/contract-13-0/contract-13-0-contract_mandate :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/110/12.0 + :target: https://runbot.odoo-community.org/runbot/110/13.0 :alt: Try me on Runbot |badge1| |badge2| |badge3| |badge4| |badge5| @@ -50,7 +50,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. @@ -67,6 +67,7 @@ Contributors * Carlos Dauden * Thomas Binsfeld +* Guillermo Llinares Maintainers ~~~~~~~~~~~ @@ -81,6 +82,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/contract `_ project on GitHub. +This module is part of the `OCA/contract `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/contract_mandate/__manifest__.py b/contract_mandate/__manifest__.py index cd1467c3f..32e5150b7 100644 --- a/contract_mandate/__manifest__.py +++ b/contract_mandate/__manifest__.py @@ -4,13 +4,13 @@ { "name": "Contract Mandate", "summary": "Mandate in contracts and their invoices", - "version": "12.0.1.0.2", + "version": "13.0.1.0.0", "author": "Odoo Community Association (OCA), " "Tecnativa", "website": "https://github.com/OCA/contract", - "depends": ["contract_payment_mode", "account_banking_mandate",], + "depends": ["contract_payment_mode", "account_banking_mandate"], "category": "Sales Management", "license": "AGPL-3", - "data": ["views/contract_view.xml",], + "data": ["views/contract_view.xml"], "installable": True, "auto_install": True, } diff --git a/contract_mandate/i18n/contract_mandate.pot b/contract_mandate/i18n/contract_mandate.pot index b604bb17d..47a2a89df 100644 --- a/contract_mandate/i18n/contract_mandate.pot +++ b/contract_mandate/i18n/contract_mandate.pot @@ -4,7 +4,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 12.0\n" +"Project-Id-Version: Odoo Server 13.0\n" "Report-Msgid-Bugs-To: \n" "Last-Translator: <>\n" "Language-Team: \n" diff --git a/contract_mandate/models/contract.py b/contract_mandate/models/contract.py index 3790111d3..dc2a92903 100644 --- a/contract_mandate/models/contract.py +++ b/contract_mandate/models/contract.py @@ -24,16 +24,14 @@ class ContractContract(models.Model): string="Commercial Entity", ) - @api.multi @api.onchange("payment_mode_id") def _onchange_payment_mode_id(self): self.ensure_one() if not self.mandate_required: self.mandate_id = False - @api.multi def _prepare_invoice(self, date_invoice, journal=None): - invoice_vals = super(ContractContract, self)._prepare_invoice( + invoice_vals, move_form = super()._prepare_invoice( date_invoice, journal=journal ) if self.mandate_id: @@ -48,18 +46,4 @@ class ContractContract(models.Model): limit=1, ) invoice_vals["mandate_id"] = mandate.id - return invoice_vals - - @api.model - def _finalize_invoice_creation(self, invoices): - """ - This override preserves the contract when calling the partner's - onchange. - """ - mandates_by_invoice = {} - for invoice in invoices: - mandates_by_invoice[invoice] = invoice.mandate_id - res = super(ContractContract, self)._finalize_invoice_creation(invoices) - for invoice in invoices: - invoice.mandate_id = mandates_by_invoice.get(invoice) - return res + return invoice_vals, move_form diff --git a/contract_mandate/readme/CONTRIBUTORS.rst b/contract_mandate/readme/CONTRIBUTORS.rst index f66ece595..ceb56b4dc 100644 --- a/contract_mandate/readme/CONTRIBUTORS.rst +++ b/contract_mandate/readme/CONTRIBUTORS.rst @@ -1,2 +1,3 @@ * Carlos Dauden * Thomas Binsfeld +* Guillermo Llinares diff --git a/contract_mandate/static/description/index.html b/contract_mandate/static/description/index.html index 62f1c5e46..4d3058504 100644 --- a/contract_mandate/static/description/index.html +++ b/contract_mandate/static/description/index.html @@ -3,7 +3,7 @@ - + Contract Mandate