Skip to content

Commit a05143d

Browse files
committed
ODOO-159: Refactor module structure by splitting core and enhanced features
Major architectural improvements: Module Restructure: - Renamed payment_multisafepay_official to payment_multisafepay (core module) - Created payment_multisafepay_enhaced module for business-specific features - Separated core payment functionality from enhanced custom features Core Module (payment_multisafepay): - Refactored controllers/main.py for better maintainability * Split large _get_order method into smaller focused helper methods * Improved shopping cart line filtering using display_type blacklist * Fixed webhook validation error handling (_set_error with state_message) - Enhanced payment_method.py with amount-based filtering * Added minimum/maximum amount restrictions from MultiSafepay API * Implemented availability reporting for debugging - Improved payment_provider.py with better multi-company support * Added copy=False to multisafepay_api_key to prevent credential sharing * Enhanced SDK initialization and configuration management - Updated payment_transaction.py for Odoo 19 compatibility * Fixed method signatures for _set_done, _set_canceled, _set_error * Improved refund handling with better validation - Added comprehensive i18n support (de_DE, es_ES, fr_FR, it_IT, nl_BE, nl_NL) Enhanced Module (payment_multisafepay_enhaced): - Moved business-specific logic to separate module - Implemented pricelist-based payment method filtering * Added _get_pricelist_from_context to retrieve pricelist from multiple sources * Support for e-commerce, backend orders, and website contexts * Automatic filtering based on allowed pricelists configuration - Enhanced payment transaction with custom refund reason tracking - Improved stock picking integration for order fulfillment - Enhanced account move integration for invoice management - Maintained all custom wizard and view functionality Technical Improvements: - Better separation of concerns between core and custom features - Improved code organization and maintainability - Enhanced error handling and logging - Fixed Python method resolution order (MRO) for proper inheritance chain - Updated module dependencies and metadata This refactoring provides a cleaner architecture where: 1. Core MultiSafepay functionality remains in the base module 2. Custom business logic lives in the enhanced module 3. Both modules can be maintained and deployed independently
1 parent 033f4f1 commit a05143d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+5128
-3151
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
uses: actions/checkout@v2
1818

1919
- name: Build project
20-
run: ./bin/release.sh ${{ env.VERSION }}
20+
run: ./release.sh ${{ env.VERSION }}
2121

2222
- name: Create Release
2323
id: create_release
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
from . import models
77
from . import controllers
8-
from . import wizard
98
from . import utils
109

1110
import odoo.addons.payment as payment

payment_multisafepay_official/__manifest__.py renamed to payment_multisafepay/__manifest__.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,13 @@
1515
'post_init_hook': 'post_init_hook',
1616
'uninstall_hook': 'uninstall_hook',
1717
'depends': [
18-
'account',
1918
'payment',
20-
'stock',
21-
'sale',
22-
'sale_stock',
23-
'website_sale',
2419
],
2520
'external_dependencies': {'python': ['multisafepay']},
2621
'data': [
2722
'views/payment_templates.xml',
2823
'views/payment_provider_views.xml',
2924
'views/payment_method_views.xml',
30-
'views/payment_transaction_views.xml',
31-
'wizard/payment_refund_wizard_views.xml',
3225
'data/payment_provider_data.xml',
3326
],
3427
}
File renamed without changes.

payment_multisafepay_official/controllers/main.py renamed to payment_multisafepay/controllers/main.py

Lines changed: 420 additions & 182 deletions
Large diffs are not rendered by default.

payment_multisafepay_official/data/payment_provider_data.xml renamed to payment_multisafepay/data/payment_provider_data.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77
<field name="redirect_form_view_id" ref="multisafepay_form"/>
88

9-
<field name="image_128" type="base64" file="payment_multisafepay_official/static/description/icon.png"/>
10-
<field name="module_id" ref="base.module_payment_multisafepay_official"/>
9+
<field name="image_128" type="base64" file="payment_multisafepay/static/description/icon.png"/>
10+
<field name="module_id" ref="base.module_payment_multisafepay"/>
1111

1212
<field name="support_refund">partial</field>
1313

payment_multisafepay/i18n/de_DE.po

Lines changed: 333 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,333 @@
1+
# Translation of Odoo Server.
2+
# This file contains the translation of the following modules:
3+
# * payment_multisafepay
4+
#
5+
msgid ""
6+
msgstr ""
7+
"Project-Id-Version: Odoo Server 19.0+e\n"
8+
"Report-Msgid-Bugs-To: \n"
9+
"POT-Creation-Date: 2025-11-17 09:50+0000\n"
10+
"PO-Revision-Date: 2025-11-17 09:50+0000\n"
11+
"Last-Translator: \n"
12+
"Language-Team: \n"
13+
"MIME-Version: 1.0\n"
14+
"Content-Type: text/plain; charset=UTF-8\n"
15+
"Content-Transfer-Encoding: \n"
16+
"Plural-Forms: \n"
17+
18+
#. module: payment_multisafepay
19+
#: model_terms:ir.ui.view,arch_db:payment_multisafepay.payment_provider_form_multisafepay
20+
msgid "<i class=\"fa fa-refresh\"/> Sync Payment Methods"
21+
msgstr "<i class=\"fa fa-refresh\"/> Zahlungsmethoden synchronisieren"
22+
23+
#. module: payment_multisafepay
24+
#: model:ir.model.fields,field_description:payment_multisafepay.field_payment_provider__multisafepay_api_key
25+
msgid "API Key"
26+
msgstr "API-Schlüssel"
27+
28+
#. module: payment_multisafepay
29+
#. odoo-python
30+
#: code:addons/payment_multisafepay/controllers/main.py:0
31+
msgid "An unexpected error occurred. Please try again."
32+
msgstr "Ein unerwarteter Fehler ist aufgetreten. Bitte versuchen Sie es erneut."
33+
34+
#. module: payment_multisafepay
35+
#: model:ir.model.fields,field_description:payment_multisafepay.field_payment_provider__code
36+
msgid "Code"
37+
msgstr "Code"
38+
39+
#. module: payment_multisafepay
40+
#. odoo-python
41+
#: code:addons/payment_multisafepay/models/payment_transaction.py:0
42+
msgid ""
43+
"Could not connect to MultiSafepay API for transaction %s.\n"
44+
"\n"
45+
"Error: %s"
46+
msgstr ""
47+
"Verbindung zur MultiSafepay API für Transaktion %s konnte nicht hergestellt werden.\n"
48+
"\n"
49+
"Fehler: %s"
50+
51+
#. module: payment_multisafepay
52+
#. odoo-python
53+
#: code:addons/payment_multisafepay/models/payment_transaction.py:0
54+
msgid ""
55+
"Could not retrieve order information from MultiSafepay for transaction %s.\n"
56+
"\n"
57+
"Reference: %s\n"
58+
"Provider: %s\n"
59+
"\n"
60+
"Please check your internet connection and try again later."
61+
msgstr ""
62+
"Bestellinformationen konnten nicht von MultiSafepay für Transaktion %s abgerufen werden.\n"
63+
"\n"
64+
"Referenz: %s\n"
65+
"Anbieter: %s\n"
66+
"\n"
67+
"Bitte überprüfen Sie Ihre Internetverbindung und versuchen Sie es später erneut."
68+
69+
#. module: payment_multisafepay
70+
#: model:ir.model.fields,field_description:payment_multisafepay.field_payment_method__display_name
71+
#: model:ir.model.fields,field_description:payment_multisafepay.field_payment_provider__display_name
72+
#: model:ir.model.fields,field_description:payment_multisafepay.field_payment_transaction__display_name
73+
msgid "Display Name"
74+
msgstr "Anzeigename"
75+
76+
#. module: payment_multisafepay
77+
#: model:ir.model.fields,field_description:payment_multisafepay.field_payment_method__id
78+
#: model:ir.model.fields,field_description:payment_multisafepay.field_payment_provider__id
79+
#: model:ir.model.fields,field_description:payment_multisafepay.field_payment_transaction__id
80+
msgid "ID"
81+
msgstr "ID"
82+
83+
#. module: payment_multisafepay
84+
#: model:ir.model.fields,field_description:payment_multisafepay.field_payment_method__main_currency_id
85+
msgid "Main Currency"
86+
msgstr "Hauptwährung"
87+
88+
#. module: payment_multisafepay
89+
#: model:ir.model.fields,field_description:payment_multisafepay.field_payment_method__maximum_amount
90+
msgid "Maximum Amount (EUR)"
91+
msgstr "Maximalbetrag (EUR)"
92+
93+
#. module: payment_multisafepay
94+
#: model:ir.model.fields,field_description:payment_multisafepay.field_payment_method__minimum_amount
95+
msgid "Minimum Amount (EUR)"
96+
msgstr "Mindestbetrag (EUR)"
97+
98+
#. module: payment_multisafepay
99+
#: model:payment.provider,name:payment_multisafepay.payment_provider_multisafepay
100+
msgid "MultiSafepay"
101+
msgstr "MultiSafepay"
102+
103+
#. module: payment_multisafepay
104+
#. odoo-python
105+
#: code:addons/payment_multisafepay/controllers/main.py:0
106+
msgid ""
107+
"MultiSafepay API error: Transaction not found. Please refresh and try again."
108+
msgstr ""
109+
"MultiSafepay API-Fehler: Transaktion nicht gefunden. Bitte aktualisieren und erneut versuchen."
110+
111+
#. module: payment_multisafepay
112+
#: model_terms:ir.ui.view,arch_db:payment_multisafepay.payment_provider_form_multisafepay
113+
msgid "MultiSafepay Credentials"
114+
msgstr "MultiSafepay-Anmeldedaten"
115+
116+
#. module: payment_multisafepay
117+
#. odoo-python
118+
#: code:addons/payment_multisafepay/controllers/main.py:0
119+
msgid "MultiSafepay SDK is not initialized."
120+
msgstr "MultiSafepay SDK ist nicht initialisiert."
121+
122+
#. module: payment_multisafepay
123+
#: model:ir.model.fields.selection,name:payment_multisafepay.selection__payment_provider__code__multisafepay
124+
msgid "Multisafepay"
125+
msgstr "Multisafepay"
126+
127+
#. module: payment_multisafepay
128+
#. odoo-python
129+
#: code:addons/payment_multisafepay/controllers/main.py:0
130+
msgid "No customer info partner associated."
131+
msgstr "Kein Kundeninformationspartner zugeordnet."
132+
133+
#. module: payment_multisafepay
134+
#. odoo-python
135+
#: code:addons/payment_multisafepay/models/payment_transaction.py:0
136+
msgid ""
137+
"No response received from MultiSafepay when attempting to refund transaction %s.\n"
138+
"\n"
139+
"Please check your internet connection and try again later."
140+
msgstr ""
141+
"Keine Antwort von MultiSafepay beim Versuch, Transaktion %s zu erstatten.\n"
142+
"\n"
143+
"Bitte überprüfen Sie Ihre Internetverbindung und versuchen Sie es später erneut."
144+
145+
#. module: payment_multisafepay
146+
#: model:ir.model.fields,field_description:payment_multisafepay.field_payment_method__only_multisafepay
147+
msgid "Only Multisafepay"
148+
msgstr "Nur Multisafepay"
149+
150+
#. module: payment_multisafepay
151+
#: model:ir.model,name:payment_multisafepay.model_payment_method
152+
msgid "Payment Method"
153+
msgstr "Zahlungsmethode"
154+
155+
#. module: payment_multisafepay
156+
#: model:ir.model,name:payment_multisafepay.model_payment_provider
157+
msgid "Payment Provider"
158+
msgstr "Zahlungsanbieter"
159+
160+
#. module: payment_multisafepay
161+
#: model:ir.model,name:payment_multisafepay.model_payment_transaction
162+
msgid "Payment Transaction"
163+
msgstr "Zahlungstransaktion"
164+
165+
#. module: payment_multisafepay
166+
#. odoo-python
167+
#: code:addons/payment_multisafepay/controllers/main.py:0
168+
msgid "Payment provider not found."
169+
msgstr "Zahlungsanbieter nicht gefunden."
170+
171+
#. module: payment_multisafepay
172+
#. odoo-python
173+
#: code:addons/payment_multisafepay/controllers/main.py:0
174+
msgid "Payment reference is missing. Please try again."
175+
msgstr "Zahlungsreferenz fehlt. Bitte versuchen Sie es erneut."
176+
177+
#. module: payment_multisafepay
178+
#. odoo-python
179+
#: code:addons/payment_multisafepay/models/payment_transaction.py:0
180+
msgid ""
181+
"Refund amount exceeds available amount.\n"
182+
"\n"
183+
"Transaction: %s\n"
184+
"Requested Refund: %.2f %s\n"
185+
"Maximum Available: %.2f %s\n"
186+
"Already Refunded: %.2f %s\n"
187+
"\n"
188+
"Please adjust the refund amount."
189+
msgstr ""
190+
"Erstattungsbetrag überschreitet verfügbaren Betrag.\n"
191+
"\n"
192+
"Transaktion: %s\n"
193+
"Angeforderte Erstattung: %.2f %s\n"
194+
"Maximal verfügbar: %.2f %s\n"
195+
"Bereits erstattet: %.2f %s\n"
196+
"\n"
197+
"Bitte passen Sie den Erstattungsbetrag an."
198+
199+
#. module: payment_multisafepay
200+
#. odoo-python
201+
#: code:addons/payment_multisafepay/models/payment_transaction.py:0
202+
msgid "Refund failed at MultiSafepay: %s\n"
203+
msgstr "Erstattung bei MultiSafepay fehlgeschlagen: %s\n"
204+
205+
#. module: payment_multisafepay
206+
#. odoo-python
207+
#: code:addons/payment_multisafepay/models/payment_transaction.py:0
208+
msgid ""
209+
"Refunds can only be processed from a refund transaction linked to an "
210+
"original payment transaction."
211+
msgstr ""
212+
"Erstattungen können nur über eine Erstattungstransaktion verarbeitet werden, die mit einer "
213+
"ursprünglichen Zahlungstransaktion verknüpft ist."
214+
215+
#. module: payment_multisafepay
216+
#: model:ir.model.fields,help:payment_multisafepay.field_payment_method__only_multisafepay
217+
msgid ""
218+
"Technical field to identify if this payment method has MultiSafepay as one "
219+
"of its providers."
220+
msgstr ""
221+
"Technisches Feld zur Identifizierung, ob diese Zahlungsmethode MultiSafepay als einen "
222+
"ihrer Anbieter hat."
223+
224+
#. module: payment_multisafepay
225+
#: model:ir.model.fields,help:payment_multisafepay.field_payment_provider__multisafepay_api_key
226+
msgid ""
227+
"The API key for the Multisafepay account. This is used to authenticate "
228+
"requests to the Multisafepay API."
229+
msgstr ""
230+
"Der API-Schlüssel für das Multisafepay-Konto. Dieser wird verwendet, um "
231+
"Anfragen an die Multisafepay API zu authentifizieren."
232+
233+
#. module: payment_multisafepay
234+
#: model:ir.model.fields,help:payment_multisafepay.field_payment_method__main_currency_id
235+
msgid "The main currency of the first provider linked to this payment method."
236+
msgstr "Die Hauptwährung des ersten Anbieters, der mit dieser Zahlungsmethode verknüpft ist."
237+
238+
#. module: payment_multisafepay
239+
#: model:ir.model.fields,help:payment_multisafepay.field_payment_method__maximum_amount
240+
msgid ""
241+
"The maximum payment amount in EUR that this payment provider is available "
242+
"for. Leave 0 to make it available for any payment amount."
243+
msgstr ""
244+
"Der maximale Zahlungsbetrag in EUR, für den dieser Zahlungsanbieter verfügbar ist. "
245+
"Lassen Sie 0, um ihn für jeden Zahlungsbetrag verfügbar zu machen."
246+
247+
#. module: payment_multisafepay
248+
#: model:ir.model.fields,help:payment_multisafepay.field_payment_method__minimum_amount
249+
msgid ""
250+
"The minimum payment amount in EUR that this payment provider is available "
251+
"for. Leave 0 to make it available for any payment amount."
252+
msgstr ""
253+
"Der minimale Zahlungsbetrag in EUR, für den dieser Zahlungsanbieter verfügbar ist. "
254+
"Lassen Sie 0, um ihn für jeden Zahlungsbetrag verfügbar zu machen."
255+
256+
#. module: payment_multisafepay
257+
#: model:ir.model.fields,help:payment_multisafepay.field_payment_provider__code
258+
msgid "The technical code of this payment provider."
259+
msgstr "Der technische Code dieses Zahlungsanbieters."
260+
261+
#. module: payment_multisafepay
262+
#. odoo-python
263+
#: code:addons/payment_multisafepay/controllers/main.py:0
264+
msgid ""
265+
"There was a problem processing your payment. Possible reasons could be: "
266+
"\"insufficient funds\", or \"verification failed\"."
267+
msgstr ""
268+
"Bei der Verarbeitung Ihrer Zahlung ist ein Problem aufgetreten. Mögliche Gründe könnten sein: "
269+
"\"unzureichende Mittel\", oder \"Überprüfung fehlgeschlagen\"."
270+
271+
#. module: payment_multisafepay
272+
#. odoo-python
273+
#: code:addons/payment_multisafepay/models/payment_transaction.py:0
274+
msgid ""
275+
"This order has already been fully refunded.\n"
276+
"\n"
277+
"Transaction: %s\n"
278+
"Order Status: %s\n"
279+
"Original Amount: %.2f %s\n"
280+
"\n"
281+
"No additional refunds can be processed."
282+
msgstr ""
283+
"Diese Bestellung wurde bereits vollständig erstattet.\n"
284+
"\n"
285+
"Transaktion: %s\n"
286+
"Bestellstatus: %s\n"
287+
"Ursprünglicher Betrag: %.2f %s\n"
288+
"\n"
289+
"Keine zusätzlichen Erstattungen können verarbeitet werden."
290+
291+
#. module: payment_multisafepay
292+
#. odoo-python
293+
#: code:addons/payment_multisafepay/controllers/main.py:0
294+
msgid "Transaction amount is missing or invalid."
295+
msgstr "Transaktionsbetrag fehlt oder ist ungültig."
296+
297+
#. module: payment_multisafepay
298+
#. odoo-python
299+
#: code:addons/payment_multisafepay/controllers/main.py:0
300+
msgid "Transaction currency is missing or invalid."
301+
msgstr "Transaktionswährung fehlt oder ist ungültig."
302+
303+
#. module: payment_multisafepay
304+
#. odoo-python
305+
#: code:addons/payment_multisafepay/controllers/main.py:0
306+
msgid "Transaction not found. Please refresh and try again."
307+
msgstr "Transaktion nicht gefunden. Bitte aktualisieren und erneut versuchen."
308+
309+
#. module: payment_multisafepay
310+
#. odoo-python
311+
#: code:addons/payment_multisafepay/controllers/main.py:0
312+
msgid "Transaction reference is missing."
313+
msgstr "Transaktionsreferenz fehlt."
314+
315+
#. module: payment_multisafepay
316+
#: model_terms:payment.provider,auth_msg:payment_multisafepay.payment_provider_multisafepay
317+
msgid "Your payment has been authorized."
318+
msgstr "Ihre Zahlung wurde autorisiert."
319+
320+
#. module: payment_multisafepay
321+
#: model_terms:payment.provider,cancel_msg:payment_multisafepay.payment_provider_multisafepay
322+
msgid "Your payment has been cancelled."
323+
msgstr "Ihre Zahlung wurde storniert."
324+
325+
#. module: payment_multisafepay
326+
#: model_terms:payment.provider,pending_msg:payment_multisafepay.payment_provider_multisafepay
327+
msgid "Your payment has been processed but is waiting for approval."
328+
msgstr "Ihre Zahlung wurde verarbeitet, wartet aber auf Genehmigung."
329+
330+
#. module: payment_multisafepay
331+
#: model_terms:payment.provider,done_msg:payment_multisafepay.payment_provider_multisafepay
332+
msgid "Your payment has been processed."
333+
msgstr "Ihre Zahlung wurde verarbeitet."

0 commit comments

Comments
 (0)