mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
[15.0][MIG] contract_payment_mode: Migration to 15.0
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
{
|
||||
"name": "Contract Payment Mode",
|
||||
"summary": "Payment mode in contracts and their invoices",
|
||||
"version": "14.0.1.0.0",
|
||||
"version": "15.0.1.0.0",
|
||||
"author": "Domatix, " "Tecnativa, " "Odoo Community Association (OCA)",
|
||||
"website": "https://github.com/OCA/contract",
|
||||
"depends": ["contract", "account_payment_partner"],
|
||||
|
||||
@@ -10,14 +10,13 @@ _logger = logging.getLogger(__name__)
|
||||
|
||||
def post_init_hook(cr, registry):
|
||||
"""Copy payment mode from partner to the new field at contract."""
|
||||
with api.Environment.manage():
|
||||
env = api.Environment(cr, SUPERUSER_ID, {})
|
||||
m_contract = env["contract.contract"]
|
||||
contracts = m_contract.search([("payment_mode_id", "=", False)])
|
||||
if contracts:
|
||||
_logger.info("Setting payment mode: %d contracts" % len(contracts))
|
||||
for contract in contracts:
|
||||
payment_mode = contract.partner_id.customer_payment_mode_id
|
||||
if payment_mode:
|
||||
contract.payment_mode_id = payment_mode.id
|
||||
_logger.info("Setting payment mode: Done")
|
||||
env = api.Environment(cr, SUPERUSER_ID, {})
|
||||
m_contract = env["contract.contract"]
|
||||
contracts = m_contract.search([("payment_mode_id", "=", False)])
|
||||
if contracts:
|
||||
_logger.info("Setting payment mode: %d contracts" % len(contracts))
|
||||
for contract in contracts:
|
||||
payment_mode = contract.partner_id.customer_payment_mode_id
|
||||
if payment_mode:
|
||||
contract.payment_mode_id = payment_mode.id
|
||||
_logger.info("Setting payment mode: Done")
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
# Marc Tormo i Bochaca <mtbochaca@gmail.com>, 2017
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 9.0c\n"
|
||||
"Project-Id-Version: Odoo Server 15.0c\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2019-05-29 10:30+0000\n"
|
||||
"PO-Revision-Date: 2019-10-09 18:37+0000\n"
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 14.0\n"
|
||||
"Project-Id-Version: Odoo Server 15.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: \n"
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
# OCA Transbot <transbot@odoo-community.org>, 2017
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 9.0c\n"
|
||||
"Project-Id-Version: Odoo Server 15.0c\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2019-05-29 10:30+0000\n"
|
||||
"PO-Revision-Date: 2019-10-29 21:33+0000\n"
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
# Translators:
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: contract (8.0)\n"
|
||||
"Project-Id-Version: contract (15.0)\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2019-05-29 10:30+0000\n"
|
||||
"PO-Revision-Date: 2015-11-07 12:33+0000\n"
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
# OCA Transbot <transbot@odoo-community.org>, 2017
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 9.0c\n"
|
||||
"Project-Id-Version: Odoo Server 15.0c\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2019-05-29 10:30+0000\n"
|
||||
"PO-Revision-Date: 2017-04-01 02:46+0000\n"
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * contract_payment_mode
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 14.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"PO-Revision-Date: 2022-02-06 20:59+0000\n"
|
||||
"Last-Translator: Ignacio Buioli <ibuioli@gmail.com>\n"
|
||||
"Language-Team: none\n"
|
||||
"Language: es_AR\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
||||
"X-Generator: Weblate 4.3.2\n"
|
||||
|
||||
#. module: contract_payment_mode
|
||||
#: model:ir.model,name:contract_payment_mode.model_contract_contract
|
||||
msgid "Contract"
|
||||
msgstr "Contrato"
|
||||
|
||||
#. module: contract_payment_mode
|
||||
#: model:ir.model.fields,field_description:contract_payment_mode.field_contract_contract__display_name
|
||||
msgid "Display Name"
|
||||
msgstr "Mostrar Nombre"
|
||||
|
||||
#. module: contract_payment_mode
|
||||
#: model:ir.model.fields,field_description:contract_payment_mode.field_contract_contract__id
|
||||
msgid "ID"
|
||||
msgstr "ID"
|
||||
|
||||
#. module: contract_payment_mode
|
||||
#: model:ir.model.fields,field_description:contract_payment_mode.field_contract_contract____last_update
|
||||
msgid "Last Modified on"
|
||||
msgstr "Última Modificación el"
|
||||
|
||||
#. module: contract_payment_mode
|
||||
#: model:ir.model.fields,field_description:contract_payment_mode.field_contract_contract__payment_mode_id
|
||||
msgid "Payment Mode"
|
||||
msgstr "Modo de Pago"
|
||||
@@ -5,7 +5,7 @@
|
||||
# Translators:
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: contract (8.0)\n"
|
||||
"Project-Id-Version: contract (15.0)\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2019-05-29 10:30+0000\n"
|
||||
"PO-Revision-Date: 2015-11-07 12:33+0000\n"
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
# OCA Transbot <transbot@odoo-community.org>, 2017
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 9.0c\n"
|
||||
"Project-Id-Version: Odoo Server 15.0c\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2019-05-29 10:30+0000\n"
|
||||
"PO-Revision-Date: 2017-04-01 02:46+0000\n"
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
# OCA Transbot <transbot@odoo-community.org>, 2017
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 9.0c\n"
|
||||
"Project-Id-Version: Odoo Server 15.0c\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2019-05-29 10:30+0000\n"
|
||||
"PO-Revision-Date: 2017-04-01 02:46+0000\n"
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
# OCA Transbot <transbot@odoo-community.org>, 2017
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 9.0c\n"
|
||||
"Project-Id-Version: Odoo Server 15.0c\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2019-05-29 10:30+0000\n"
|
||||
"PO-Revision-Date: 2017-04-01 02:46+0000\n"
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
# Ashish Deshmukh <ashish.p.deshmukh@gmail.com>, 2017
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 10.0\n"
|
||||
"Project-Id-Version: Odoo Server 15.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2019-05-29 10:30+0000\n"
|
||||
"PO-Revision-Date: 2017-08-17 01:05+0000\n"
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
# Bole <bole@dajmi5.com>, 2018
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 10.0\n"
|
||||
"Project-Id-Version: Odoo Server 15.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2019-05-29 10:30+0000\n"
|
||||
"PO-Revision-Date: 2018-02-10 03:15+0000\n"
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
# Bole <bole@dajmi5.com>, 2017
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 10.0\n"
|
||||
"Project-Id-Version: Odoo Server 15.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2019-05-29 10:30+0000\n"
|
||||
"PO-Revision-Date: 2017-06-17 01:39+0000\n"
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
# OCA Transbot <transbot@odoo-community.org>, 2017
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 9.0c\n"
|
||||
"Project-Id-Version: Odoo Server 15.0c\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2019-05-29 10:30+0000\n"
|
||||
"PO-Revision-Date: 2017-04-01 02:46+0000\n"
|
||||
|
||||
@@ -7,23 +7,22 @@
|
||||
# Stefano <stefano.sforzi@agilebg.com>, 2017
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 9.0c\n"
|
||||
"Project-Id-Version: Odoo Server 15.0c\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2019-05-29 10:30+0000\n"
|
||||
"PO-Revision-Date: 2022-03-27 00:17+0000\n"
|
||||
"Last-Translator: Andrea Cometa <a.cometa@apuliasoftware.it>\n"
|
||||
"PO-Revision-Date: 2017-04-01 02:46+0000\n"
|
||||
"Last-Translator: Stefano <stefano.sforzi@agilebg.com>, 2017\n"
|
||||
"Language-Team: Italian (https://www.transifex.com/oca/teams/23907/it/)\n"
|
||||
"Language: it\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
||||
"X-Generator: Weblate 4.3.2\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
|
||||
#. module: contract_payment_mode
|
||||
#: model:ir.model,name:contract_payment_mode.model_contract_contract
|
||||
msgid "Contract"
|
||||
msgstr "Contratto"
|
||||
msgstr ""
|
||||
|
||||
#. module: contract_payment_mode
|
||||
#: model:ir.model.fields,field_description:contract_payment_mode.field_contract_contract__payment_mode_id
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
# Erwin van der Ploeg <erwin@odooexperts.nl>, 2017
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 9.0c\n"
|
||||
"Project-Id-Version: Odoo Server 15.0c\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2019-05-29 10:30+0000\n"
|
||||
"PO-Revision-Date: 2017-04-01 02:46+0000\n"
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
# Pedro Castro Silva <pedrocs@sossia.pt>, 2017
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 10.0\n"
|
||||
"Project-Id-Version: Odoo Server 15.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2019-05-29 10:30+0000\n"
|
||||
"PO-Revision-Date: 2020-02-17 19:13+0000\n"
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
# OCA Transbot <transbot@odoo-community.org>, 2017
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 9.0c\n"
|
||||
"Project-Id-Version: Odoo Server 15.0c\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2019-05-29 10:30+0000\n"
|
||||
"PO-Revision-Date: 2019-10-10 20:36+0000\n"
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
# Daniel Reis <dreis.pt@gmail.com>, 2017
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 9.0c\n"
|
||||
"Project-Id-Version: Odoo Server 15.0c\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2019-05-29 10:30+0000\n"
|
||||
"PO-Revision-Date: 2017-04-01 02:46+0000\n"
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
# OCA Transbot <transbot@odoo-community.org>, 2017
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 9.0c\n"
|
||||
"Project-Id-Version: Odoo Server 15.0c\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2019-05-29 10:30+0000\n"
|
||||
"PO-Revision-Date: 2017-04-01 02:46+0000\n"
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
# nek, 2018
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 10.0\n"
|
||||
"Project-Id-Version: Odoo Server 15.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2019-05-29 10:30+0000\n"
|
||||
"PO-Revision-Date: 2018-03-17 03:26+0000\n"
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
# Translators:
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: contract (8.0)\n"
|
||||
"Project-Id-Version: contract (15.0)\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2019-05-29 10:30+0000\n"
|
||||
"PO-Revision-Date: 2015-11-07 12:33+0000\n"
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
# OCA Transbot <transbot@odoo-community.org>, 2017
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 9.0c\n"
|
||||
"Project-Id-Version: Odoo Server 15.0c\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2019-05-29 10:30+0000\n"
|
||||
"PO-Revision-Date: 2017-04-01 02:46+0000\n"
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
# Ediz Duman <neps1192@gmail.com>, 2017
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 10.0\n"
|
||||
"Project-Id-Version: Odoo Server 15.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2019-05-29 10:30+0000\n"
|
||||
"PO-Revision-Date: 2017-06-13 02:40+0000\n"
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
# Ediz Duman <neps1192@gmail.com>, 2017
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 10.0\n"
|
||||
"Project-Id-Version: Odoo Server 15.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2019-05-29 10:30+0000\n"
|
||||
"PO-Revision-Date: 2017-06-13 02:40+0000\n"
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
# ITGeeker <alanljj@qq.com>, 2017
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 9.0c\n"
|
||||
"Project-Id-Version: Odoo Server 15.0c\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2019-05-29 10:30+0000\n"
|
||||
"PO-Revision-Date: 2019-10-16 18:31+0000\n"
|
||||
|
||||
@@ -3,9 +3,13 @@
|
||||
# Copyright 2017 Tecnativa - David Vidal
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from unittest.mock import patch
|
||||
|
||||
import odoo.tests
|
||||
from odoo.tests import tagged
|
||||
|
||||
from odoo.addons.account.models.account_payment_method import AccountPaymentMethod
|
||||
|
||||
from ..hooks import post_init_hook
|
||||
|
||||
|
||||
@@ -14,9 +18,28 @@ class TestContractPaymentInit(odoo.tests.HttpCase):
|
||||
def setUp(self):
|
||||
super().setUp()
|
||||
|
||||
self.payment_method = self.env["account.payment.method"].create(
|
||||
{"name": "Test Payment Method", "code": "Test", "payment_type": "inbound"}
|
||||
Method_get_payment_method_information = (
|
||||
AccountPaymentMethod._get_payment_method_information
|
||||
)
|
||||
|
||||
def _get_payment_method_information(self):
|
||||
res = Method_get_payment_method_information(self)
|
||||
res["Test"] = {"mode": "multi", "domain": [("type", "=", "bank")]}
|
||||
return res
|
||||
|
||||
with patch.object(
|
||||
AccountPaymentMethod,
|
||||
"_get_payment_method_information",
|
||||
_get_payment_method_information,
|
||||
):
|
||||
self.payment_method = self.env["account.payment.method"].create(
|
||||
{
|
||||
"name": "Test Payment Method",
|
||||
"code": "Test",
|
||||
"payment_type": "inbound",
|
||||
}
|
||||
)
|
||||
|
||||
self.payment_mode = self.env["account.payment.mode"].create(
|
||||
{
|
||||
"name": "Test payment mode",
|
||||
|
||||
@@ -2,9 +2,8 @@
|
||||
<odoo>
|
||||
<!--FORM view-->
|
||||
<record id="contract_contract_form_view" model="ir.ui.view">
|
||||
<field
|
||||
name="name"
|
||||
>contract.contract form view (in contract_payment_mode)</field>
|
||||
<field name="name">contract.contract form view (in contract_payment_mode)
|
||||
</field>
|
||||
<field name="model">contract.contract</field>
|
||||
<field name="inherit_id" ref="contract.contract_contract_form_view" />
|
||||
<field name="arch" type="xml">
|
||||
@@ -15,9 +14,8 @@
|
||||
</record>
|
||||
<!--TREE view-->
|
||||
<record id="contract_contract_tree_view" model="ir.ui.view">
|
||||
<field
|
||||
name="name"
|
||||
>contract.contract tree view (in contract_payment_mode)</field>
|
||||
<field name="name">contract.contract tree view (in contract_payment_mode)
|
||||
</field>
|
||||
<field name="model">contract.contract</field>
|
||||
<field name="inherit_id" ref="contract.contract_contract_tree_view" />
|
||||
<field name="arch" type="xml">
|
||||
@@ -28,9 +26,8 @@
|
||||
</record>
|
||||
<!--FORM view-->
|
||||
<record id="contract_contract_search_view" model="ir.ui.view">
|
||||
<field
|
||||
name="name"
|
||||
>contract.contract search view (in contract_payment_mode)</field>
|
||||
<field name="name">contract.contract search view (in contract_payment_mode)
|
||||
</field>
|
||||
<field name="model">contract.contract</field>
|
||||
<field name="inherit_id" ref="contract.contract_contract_search_view" />
|
||||
<field name="arch" type="xml">
|
||||
@@ -43,7 +40,8 @@
|
||||
<record id="contract_contract_supplier_form_view" model="ir.ui.view">
|
||||
<field
|
||||
name="name"
|
||||
>contract.contract supplier form view (in contract_payment_mode)</field>
|
||||
>contract.contract supplier form view (in contract_payment_mode)
|
||||
</field>
|
||||
<field name="model">contract.contract</field>
|
||||
<field name="priority">18</field>
|
||||
<field name="inherit_id" ref="contract.contract_contract_supplier_form_view" />
|
||||
|
||||
Reference in New Issue
Block a user