Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ payment / account.payment / payment_token_id (many2one) : NEW re
payment / account.payment / payment_transaction_id (many2one): NEW relation: payment.transaction
# NOTHING TO DO
payment / payment.acquirer / auto_confirm (selection) : selection_keys is now '['authorize', 'confirm_so', 'generate_and_pay_invoice', 'none']' ('['at_pay_confirm', 'at_pay_now', 'none']')
# TODO: pre-migration. Map values
# Done: post-migration. Mapped some values

payment / payment.acquirer / description (html) : NEW
payment / payment.acquirer / environment (selection) : now required, default = function
Expand All @@ -25,7 +25,7 @@ payment / payment.transaction / payment_method_id (many2one) : DEL re
payment / payment.transaction / payment_token_id (many2one) : NEW relation: payment.token
# NOTHING TO DO
payment / payment.transaction / state (selection) : selection_keys is now '['authorized', 'cancel', 'done', 'draft', 'error', 'pending']' ('['cancel', 'done', 'draft', 'error', 'pending']')
# TODO: pre-migration. Map values
# NOTHING TO DO: 'authorized' value just will stay empty

payment / res.partner / payment_method_ids (one2many) : DEL relation: payment.method
payment / res.partner / payment_token_ids (one2many) : NEW relation: payment.token
Expand Down Expand Up @@ -62,3 +62,4 @@ NEW payment.acquirer: payment.payment_acquirer_payu
NEW payment.acquirer: payment.payment_acquirer_sips
NEW payment.acquirer: payment.payment_acquirer_stripe
NEW payment.acquirer: payment.payment_acquirer_transfer
# Nothing to do
18 changes: 18 additions & 0 deletions addons/payment/migrations/10.0.1.0/post-migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# -*- coding: utf-8 -*-
# Copyright 2017 Eficent - Miquel Raich
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openupgradelib import openupgrade


def map_adquirer_auto_confirm(cr):
openupgrade.map_values(
cr,
openupgrade.get_legacy_name('auto_confirm'), 'auto_confirm',
[('at_pay_confirm', 'confirm_so'),
('at_pay_now', 'generate_and_pay_invoice')],
table='payment_acquirer', write='sql')


@openupgrade.migrate()
def migrate(env, version):
map_adquirer_auto_confirm(env.cr)
15 changes: 15 additions & 0 deletions addons/payment/migrations/10.0.1.0/pre-migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# -*- coding: utf-8 -*-
# Copyright 2017 Eficent <http://www.eficent.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openupgradelib import openupgrade

column_copies = {
'payment_acquirer': [
('auto_confirm', None, None),
],
}


@openupgrade.migrate()
def migrate(env, version):
openupgrade.copy_columns(env.cr, column_copies)
2 changes: 1 addition & 1 deletion odoo/openupgrade/doc/source/modules90-100.rst
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ missing in the new release are marked with |del|.
+-----------------------------------+-----------------------------------+
|pad_project | |
+-----------------------------------+-----------------------------------+
|payment | |
|payment | Done |
+-----------------------------------+-----------------------------------+
|payment_adyen | |
+-----------------------------------+-----------------------------------+
Expand Down