Skip to content

Commit

Permalink
[OU-ADD] payment_stripe: Migration to 16.0
Browse files Browse the repository at this point in the history
TT45236
  • Loading branch information
victoralmau committed Nov 28, 2023
1 parent fa97688 commit b109c13
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docsource/modules150-160.rst
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ Module coverage 15.0 -> 16.0
+-------------------------------------------------+----------------------+-------------------------------------------------+
| payment_sips | | |
+-------------------------------------------------+----------------------+-------------------------------------------------+
| payment_stripe | | |
| payment_stripe | Done | |
+-------------------------------------------------+----------------------+-------------------------------------------------+
| |del| payment_transfer |Done |Renamed to payment_custom. |
+-------------------------------------------------+----------------------+-------------------------------------------------+
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<odoo>
<record id="payment.payment_provider_stripe" model="payment.provider">
<field name="allow_express_checkout">True</field>
<field name="allow_tokenization">True</field>
<!-- <field name="allow_tokenization">True</field> -->
<field name="code">stripe</field>
<field name="express_checkout_form_view_id" ref="express_checkout_form"/>
</record>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright 2023 Tecnativa - Víctor Martínez
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openupgradelib import openupgrade


@openupgrade.migrate()
def migrate(env, version):
openupgrade.delete_records_safely_by_xml_id(
env,
[
"payment_stripe.payment_method_stripe",
],
)
openupgrade.load_data(env.cr, "payment_stripe", "16.0.2.0/noupdate_changes.xml")
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2023 Tecnativa - Víctor Martínez
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openupgradelib import openupgrade

_xmlids_renames = [
(
"payment_stripe.action_payment_acquirer_onboarding",
"payment_stripe.action_payment_provider_onboarding",
),
(
"payment_stripe.payment_acquirer_form",
"payment_stripe.payment_provider_form",
),
]


@openupgrade.migrate()
def migrate(env, version):
openupgrade.rename_xmlids(env.cr, _xmlids_renames)
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---Models in module 'payment_stripe'---
---Fields in module 'payment_stripe'---
payment_stripe / payment.acquirer / provider (False) : DEL selection_keys: ['adyen', 'alipay', 'authorize', 'buckaroo', 'mollie', 'none', 'ogone', 'paypal', 'payulatam', 'payumoney', 'sips', 'stripe'], mode: modify
payment_stripe / payment.acquirer / stripe_publishable_key (char) : DEL
payment_stripe / payment.acquirer / stripe_secret_key (char) : DEL
payment_stripe / payment.acquirer / stripe_webhook_secret (char) : DEL
payment_stripe / payment.provider / code (False) : NEW selection_keys: ['adyen', 'alipay', 'aps', 'asiapay', 'authorize', 'buckaroo', 'custom', 'demo', 'flutterwave', 'mercado_pago', 'mollie', 'none', 'ogone', 'paypal', 'payulatam', 'payumoney', 'razorpay', 'sips', 'stripe'], mode: modify
payment_stripe / payment.provider / stripe_publishable_key (char) : NEW
payment_stripe / payment.provider / stripe_secret_key (char) : NEW
payment_stripe / payment.provider / stripe_webhook_secret (char) : NEW
# NOTHING TO DO: `payment.acquirer` renamed to `payment.provider` in payment module

---XML records in module 'payment_stripe'---
DEL account.payment.method: payment_stripe.payment_method_stripe (noupdate)
# DONE: post-migration (delete record)

NEW ir.actions.act_window: payment_stripe.action_payment_provider_onboarding
DEL ir.actions.act_window: payment_stripe.action_payment_acquirer_onboarding
# DONE: pre-migration (renamed)

NEW ir.ui.view: payment_stripe.express_checkout
NEW ir.ui.view: payment_stripe.express_checkout_form
NEW ir.ui.view: payment_stripe.payment_provider_form
NEW ir.ui.view: payment_stripe.sdk_assets
DEL ir.ui.view: payment_stripe.payment_acquirer_form
# DONE: pre-migration (renamed)

0 comments on commit b109c13

Please sign in to comment.