Skip to content

Commit 9df8174

Browse files
authored
Merge pull request #4958 from ForgeFlow/18.0-mig-payment
[18.0][OU-ADD] payment
2 parents 8e3493e + 7cac076 commit 9df8174

File tree

5 files changed

+118
-1
lines changed

5 files changed

+118
-1
lines changed

docsource/modules170-180.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -732,7 +732,7 @@ Module coverage 17.0 -> 18.0
732732
+---------------------------------------------------+----------------------+-------------------------------------------------+
733733
| partner_autocomplete | | |
734734
+---------------------------------------------------+----------------------+-------------------------------------------------+
735-
| payment | | |
735+
| payment | Done | |
736736
+---------------------------------------------------+----------------------+-------------------------------------------------+
737737
| payment_adyen | |No DB layout changes. |
738738
+---------------------------------------------------+----------------------+-------------------------------------------------+
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version='1.0' encoding='utf-8' ?>
2+
<odoo>
3+
<record id="payment_method_emi_india" model="payment.method">
4+
<field name="code">emi_india</field>
5+
</record>
6+
</odoo>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Copyright 2025 ForgeFlow S.L. (https://www.forgeflow.com)
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
from openupgradelib import openupgrade, openupgrade_merge_records
4+
5+
6+
def merge_ogone_sips_into_worldline(env):
7+
ogone = env["payment.provider"].search([("code", "=", "ogone")], limit=1)
8+
sips = env.ref("payment.payment_provider_sips")
9+
worldline = env.ref("payment.payment_provider_worldline")
10+
to_merge = []
11+
if ogone:
12+
to_merge.append(ogone.id)
13+
if sips:
14+
to_merge.append(sips.id)
15+
if to_merge:
16+
openupgrade_merge_records.merge_records(
17+
env,
18+
"payment.provider",
19+
to_merge,
20+
worldline.id,
21+
{"openupgrade_other_fields": "preserve"},
22+
delete=False,
23+
)
24+
25+
26+
@openupgrade.migrate()
27+
def migrate(env, version):
28+
merge_ogone_sips_into_worldline(env)
29+
openupgrade.load_data(env, "payment", "18.0.2.0/noupdate_changes_manual.xml")
30+
openupgrade.load_data(env, "payment", "18.0.2.0/noupdate_changes.xml")
31+
openupgrade.delete_records_safely_by_xml_id(env, ["payment.payment_provider_sips"])
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Copyright 2025 ForgeFlow S.L. (https://www.forgeflow.com)
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
from openupgradelib import openupgrade
4+
5+
_xmlid_renames = [
6+
("website_payment.action_activate_stripe", "payment.action_activate_stripe"),
7+
("payment.payment_method_emi", "payment.payment_method_emi_india"),
8+
]
9+
10+
11+
def fill_payment_support_refund(env):
12+
openupgrade.logged_query(
13+
env.cr,
14+
"""
15+
UPDATE payment_method
16+
SET support_refund = 'none'
17+
WHERE support_refund IS NULL""",
18+
)
19+
20+
21+
@openupgrade.migrate()
22+
def migrate(env, version):
23+
openupgrade.rename_xmlids(env.cr, _xmlid_renames)
24+
fill_payment_support_refund(env)
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---Models in module 'payment'---
2+
---Fields in module 'payment'---
3+
payment / payment.method / support_refund (selection) : now required
4+
payment / payment.method / support_refund (selection) : selection_keys is now '['full_only', 'none', 'partial']' ('['full_only', 'partial']')
5+
# DONE: pre-migration: empty -> 'none'
6+
7+
payment / payment.provider / support_refund (selection) : selection_keys is now '['full_only', 'none', 'partial']' ('['full_only', 'partial']')
8+
# NOTHING TO DO: not stored
9+
10+
payment / payment.provider / module_state (selection) : not stored anymore
11+
# NOTHING TO DO: now it's related
12+
13+
payment / payment.transaction / callback_hash (char) : DEL
14+
payment / payment.transaction / callback_is_done (boolean) : DEL
15+
payment / payment.transaction / callback_method (char) : DEL
16+
payment / payment.transaction / callback_model_id (many2one) : DEL relation: ir.model
17+
payment / payment.transaction / callback_res_id (integer) : DEL
18+
# NOTHING TO DO: simply removed, see https://github.com/odoo/odoo/commit/d6452a11ed1edfb0df7ffbd81cef08e96f97c4c0
19+
20+
payment / res.country / is_stripe_supported_country (boolean): previously in module website_payment
21+
# NOTHING TO DO
22+
23+
---XML records in module 'payment'---
24+
NEW ir.actions.server: payment.action_activate_stripe [renamed from website_payment module]
25+
# DONE: pre-migration: renamed xmlid
26+
27+
NEW ir.ui.view: payment.availability_report
28+
NEW ir.ui.view: payment.availability_report_button
29+
NEW ir.ui.view: payment.availability_report_records
30+
NEW ir.ui.view: payment.no_pms_available_warning
31+
NEW ir.ui.view: payment.state_header
32+
DEL ir.ui.view: payment.pay_meth_link
33+
DEL ir.ui.view: payment.transaction_status
34+
NEW payment.method: payment.payment_method_abitab (noupdate)
35+
NEW payment.method: payment.payment_method_alipay_plus (noupdate)
36+
NEW payment.method: payment.payment_method_astropay (noupdate)
37+
NEW payment.method: payment.payment_method_banco_guayaquil (noupdate)
38+
NEW payment.method: payment.payment_method_banco_pichincha (noupdate)
39+
NEW payment.method: payment.payment_method_facilito (noupdate)
40+
NEW payment.method: payment.payment_method_nuvei_local (noupdate)
41+
NEW payment.method: payment.payment_method_oxxopay (noupdate)
42+
NEW payment.method: payment.payment_method_paylater_india (noupdate)
43+
NEW payment.method: payment.payment_method_post_finance (noupdate)
44+
NEW payment.method: payment.payment_method_redpagos (noupdate)
45+
NEW payment.method: payment.payment_method_spei (noupdate)
46+
NEW payment.method: payment.payment_method_webpay (noupdate)
47+
NEW payment.provider: payment.payment_provider_nuvei (noupdate)
48+
# NOTHING TO DO
49+
50+
NEW payment.method: payment.payment_method_emi_india (noupdate)
51+
DEL payment.method: payment.payment_method_emi (noupdate)
52+
# DONE: pre-migration: rename xmlids
53+
54+
NEW payment.provider: payment.payment_provider_worldline (noupdate)
55+
DEL payment.provider: payment.payment_provider_sips (noupdate)
56+
# DONE: post-migration: Let's merge the Ogone & SIPS into Worldline. More info in https://github.com/odoo/odoo/pull/175194

0 commit comments

Comments
 (0)