diff --git a/contract_payment_mode/README.rst b/contract_payment_mode/README.rst index 7c1460491..55f3fc028 100644 --- a/contract_payment_mode/README.rst +++ b/contract_payment_mode/README.rst @@ -14,13 +14,13 @@ Contract Payment Mode :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_payment_mode + :target: https://github.com/OCA/contract/tree/13.0/contract_payment_mode :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_payment_mode + :target: https://translation.odoo-community.org/projects/contract-13-0/contract-13-0-contract_payment_mode :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| @@ -57,7 +57,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. @@ -78,6 +78,7 @@ Contributors * Vicent Cubells * David Vidal * Carlos Dauden +* Guillermo Llinares Maintainers ~~~~~~~~~~~ @@ -92,6 +93,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_payment_mode/__manifest__.py b/contract_payment_mode/__manifest__.py index a235ad1c4..2326ae44c 100644 --- a/contract_payment_mode/__manifest__.py +++ b/contract_payment_mode/__manifest__.py @@ -8,13 +8,13 @@ { "name": "Contract Payment Mode", "summary": "Payment mode in contracts and their invoices", - "version": "12.0.1.1.0", + "version": "13.0.1.0.0", "author": "Domatix, " "Tecnativa, " "Odoo Community Association (OCA)", "website": "https://github.com/OCA/contract", "depends": ["contract", "account_payment_partner"], "category": "Sales Management", "license": "AGPL-3", - "data": ["views/contract_view.xml",], + "data": ["views/contract_view.xml"], "post_init_hook": "post_init_hook", "installable": True, "auto_install": True, diff --git a/contract_payment_mode/hooks.py b/contract_payment_mode/hooks.py index 7ba0b9e65..6d556f31f 100644 --- a/contract_payment_mode/hooks.py +++ b/contract_payment_mode/hooks.py @@ -13,7 +13,7 @@ def post_init_hook(cr, registry): with api.Environment.manage(): env = api.Environment(cr, SUPERUSER_ID, {}) m_contract = env["contract.contract"] - contracts = m_contract.search([("payment_mode_id", "=", False),]) + contracts = m_contract.search([("payment_mode_id", "=", False)]) if contracts: _logger.info("Setting payment mode: %d contracts" % len(contracts)) for contract in contracts: diff --git a/contract_payment_mode/i18n/contract_payment_mode.pot b/contract_payment_mode/i18n/contract_payment_mode.pot index 58d48f89b..d8515a808 100644 --- a/contract_payment_mode/i18n/contract_payment_mode.pot +++ b/contract_payment_mode/i18n/contract_payment_mode.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_payment_mode/models/contract.py b/contract_payment_mode/models/contract.py index edba78254..8041d6b4d 100644 --- a/contract_payment_mode/models/contract.py +++ b/contract_payment_mode/models/contract.py @@ -15,28 +15,10 @@ class ContractContract(models.Model): def on_change_partner_id(self): self.payment_mode_id = self.partner_id.customer_payment_mode_id.id - @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=date_invoice, journal=journal ) if self.payment_mode_id: invoice_vals["payment_mode_id"] = self.payment_mode_id.id - invoice = self.env["account.invoice"].new(invoice_vals) - invoice._onchange_payment_mode_id() - invoice_vals = invoice._convert_to_write(invoice._cache) - return invoice_vals - - @api.model - def _finalize_invoice_creation(self, invoices): - """ - This override preserves the payment mode when calling the partner's - onchange. - """ - payment_modes_by_invoice = {} - for invoice in invoices: - payment_modes_by_invoice[invoice] = invoice.payment_mode_id - res = super(ContractContract, self)._finalize_invoice_creation(invoices) - for invoice in invoices: - invoice.payment_mode_id = payment_modes_by_invoice.get(invoice) - return res + return invoice_vals, move_form diff --git a/contract_payment_mode/readme/CONTRIBUTORS.rst b/contract_payment_mode/readme/CONTRIBUTORS.rst index acb944587..6bf6c2898 100644 --- a/contract_payment_mode/readme/CONTRIBUTORS.rst +++ b/contract_payment_mode/readme/CONTRIBUTORS.rst @@ -3,3 +3,4 @@ * Vicent Cubells * David Vidal * Carlos Dauden +* Guillermo Llinares diff --git a/contract_payment_mode/static/description/index.html b/contract_payment_mode/static/description/index.html index 5a7e1bede..e4a0cd8c0 100644 --- a/contract_payment_mode/static/description/index.html +++ b/contract_payment_mode/static/description/index.html @@ -3,7 +3,7 @@ - + Contract Payment Mode