Skip to content

Replace legacy modules with Odoo 18 compatible payment_monero_rpc#19

Merged
t-900-a merged 6 commits intomonero-integrations:mainfrom
niyid:feature/payment_monero_rpc
Jun 19, 2025
Merged

Replace legacy modules with Odoo 18 compatible payment_monero_rpc#19
t-900-a merged 6 commits intomonero-integrations:mainfrom
niyid:feature/payment_monero_rpc

Conversation

@niyid
Copy link
Contributor

@niyid niyid commented May 9, 2025

Monero RPC Payment Module for Odoo 18

Overview

This module provides Monero cryptocurrency payment integration for Odoo 18 using direct RPC calls to the Monero daemon and wallet. The module has been completely refactored from previous versions to ensure compatibility with Odoo 18's architecture while maintaining the core functionality of processing Monero payments.

Key Features

  • Full compatibility with Odoo 18
  • Direct RPC communication with Monero daemon/wallet (no external libraries)
  • Automated payment verification through scheduled jobs
  • Support for multiple wallet addresses
  • Seamless integration with Odoo's payment flow

Technical Migration Details

Odoo 18 Compatibility

This module has been specifically redesigned for Odoo 18, addressing compatibility breaks from previous versions (v15/v16/v17). Key architectural changes have been implemented to align with Odoo 18's framework requirements while maintaining the module's functionality.

Payment Provider Implementation

The module now implements the payment.provider model instead of the deprecated payment.acquirer model that was used in versions prior to v15. This change follows Odoo's payment framework evolution and ensures proper integration with the current payment flow system.

Secondary Address System

The module has moved away from using the long payment_ids (which are no longer supported) to using secondary Monero addresses for payment tracking. This architectural change provides better isolation between transactions and improves the reliability of payment matching.

Automated Payment Verification

The module implements Odoo cron jobs to:

  • Periodically check for incoming transactions
  • Verify transaction confirmations
  • Update payment statuses accordingly
  • Reconcile completed payments with orders

This automation ensures payment integrity and reduces manual verification requirements.

Installation Requirements

  • Odoo 18
  • Access to a Monero wallet RPC instance
  • Proper network configuration for RPC communication

Configuration

After installation, the module can be configured through the Odoo Payment Provider settings:

  1. Enable the Monero payment provider
  2. Configure Monero RPC connection details
  3. Set confirmation thresholds and verification intervals
  4. Test the connection to ensure proper communication

Package reorganization

The 2 modules monero-rpc-odoo and monero-rpc-odoo-pos have been merged into one and following the naming convention for payment modules renamed to payment_monero_rpc.

Upgrading from Previous Versions

Due to significant changes in both Odoo's payment framework and this module's architecture, a clean installation is recommended when upgrading from versions prior to Odoo 18. Data migration scripts are included but should be tested in a staging environment before use in production.

Odoo Module Migration Compatibility Table

Overview of Version Transitions

Migration Path Compatibility Level Major Changes Development Effort
15 → 16 Moderate Architecture changes, View modifications Medium
16 → 17 Challenging Python requirements, Major UI/UX changes High
17 → 18 Moderate API changes, New features integration Medium
15 → 17 Difficult Combined challenges of both migrations Very High
16 → 18 Difficult Multiple architectural changes High
15 → 18 Very Difficult Comprehensive rewrite often needed Very High

Detailed Migration Compatibility Table

Component Odoo 15 → 16 Odoo 16 → 17 Odoo 17 → 18
Python Requirements Python 3.7+ → 3.8+ Python 3.8+ → 3.10+ Python 3.10+ → 3.11+
PostgreSQL 12+ → 13+ 13+ → 14+ 14+ → 15+
Model Structure Minor changes Field attribute changes New model patterns
ORM Methods Some deprecations Several renamed methods API refinements
View Architecture QWeb changes Major view architecture changes New view components
JavaScript Framework Owl 1.0 → 2.0 Owl 2.0 → 3.0 Component architecture improvements
Report System Minor changes Major reporting engine update Enhanced PDF capabilities
Security Framework Compatible New security features Enhanced access control
Business Logic Mostly compatible Significant changes in core modules New business patterns
Module Structure Compatible Directory structure changes Standardized patterns

Key Technical Changes By Version

Odoo 15 → 16

  • ORM Changes:

    • Deprecation of fields.Date.context_today in favor of new approaches
    • Changes to search domain handling
    • Enhanced recordset operations
  • View Changes:

    • Owl 2.0 adoption requiring component rewrites
    • Changes to QWeb template inheritance
    • New kanban and list view behaviors
  • API Changes:

    • Modified HTTP controllers architecture
    • Changes in RPC call handling
    • New decorators for controllers

Odoo 16 → 17

  • Major Framework Changes:

    • Python 3.10 required with new syntax possibilities
    • Large-scale view architecture redesign
    • Component-based UI replaces many older patterns
  • Core Changes:

    • Authentication system modifications
    • Database API changes
    • New async processing capabilities
  • Frontend:

    • Comprehensive JavaScript framework changes
    • New theming system
    • Responsive design improvements

Odoo 17 → 18

  • Technical Foundation:

    • Python 3.11 optimization advantages
    • New database access patterns
    • Enhanced caching mechanisms
  • Developer Experience:

    • New developer tools and debugging
    • Improved module testing framework
    • Better documentation and typing
  • Enterprise Features:

    • Enhanced integration capabilities
    • New API endpoints
    • Better extensibility points

Module Migration Strategy

Strategy Element Recommendation
Assessment Conduct thorough code analysis before migration
Database Test data migration separately from code updates
Approach Consider full rewrites for 15→18 migrations
Testing Implement automated tests before migration
Timeline Allow 1.5-3x development time compared to original module
Recommended Path Migrate one version at a time rather than skipping
Custom Modules Consider rebuilding vs migrating for major version jumps
Community Modules Check for maintained versions before custom migration

Common Migration Issues

  1. Database Schema Conflicts: Fields renamed or removed between versions
  2. API Deprecations: Methods removed without direct replacements
  3. UI Component Incompatibility: View definitions becoming invalid
  4. Report Template Failures: QWeb reports requiring reconstruction
  5. Security Model Changes: Access rights and rule modifications
  6. Performance Bottlenecks: Previously efficient code becoming slow
  7. Third-party Dependencies: Library compatibility issues

Best Practices for Migration

  1. Modular Approach: Migrate core functionality first, then extensions
  2. Testing Framework: Build comprehensive tests before migration
  3. Version Control: Use feature branches for migration work
  4. Documentation: Document all changes and decisions during migration
  5. Incremental Testing: Test each component after migration
  6. User Training: Plan for training on new interfaces after migration
  7. Parallel Running: Consider running old and new systems in parallel initially

@niyid niyid force-pushed the feature/payment_monero_rpc branch 3 times, most recently from cd0b3f9 to b390376 Compare May 15, 2025 09:53
@niyid niyid force-pushed the feature/payment_monero_rpc branch from 191ca9e to a853df3 Compare May 20, 2025 12:25
TODO - payment_form_monero.js upgrade to OWL 3

Updated README

Updated README and sample data

Set required confirmations to 2

Handling logo display for payment provider and payment method

Added preconfigured support for more popular currencies on payment provider and payment method

Minimum confirmations should be 2 and updated config settings. Use 'noupdate' for data

Improved on Unit Tests

Compacting

consolidation of 5 commits; make it easier for testing
@niyid niyid force-pushed the feature/payment_monero_rpc branch from e6a938d to 945a3bf Compare May 28, 2025 17:19
@t-900-a t-900-a merged commit 5a28dbe into monero-integrations:main Jun 19, 2025
@niyid
Copy link
Contributor Author

niyid commented Jun 19, 2025

Thank you for the prompt response and providing this repository.

@t-900-a
Copy link
Collaborator

t-900-a commented Jun 19, 2025

@serhack I may have prematurely merged this in without a full review. We will revert if need be. I do not have time to dedicate to this project.

@niyid
Copy link
Contributor Author

niyid commented Jun 19, 2025 via email

@niyid
Copy link
Contributor Author

niyid commented Jun 20, 2025 via email

@niyid
Copy link
Contributor Author

niyid commented Jun 20, 2025 via email

@niyid
Copy link
Contributor Author

niyid commented Jun 20, 2025

monero-odoo

@niyid
Copy link
Contributor Author

niyid commented Jun 20, 2025

moneo-odoo2

@bosd
Copy link

bosd commented Jun 21, 2025

I may have prematurely merged this in without a full review. We will revert if need be. I do not have time to dedicate to this project.

I agree, We have merged this one way too quickly.

Hi @niyid

Thank you for your significant effort and contribution to this project. It's great to see this level of engagement, and we appreciate you taking the time to put this pull request together.

The PR was merged prematurely before a full review could be completed, and I've identified several key architectural and functional issues that need to be addressed. We can work through these together, and we will revert the merge if necessary while we sort them out.

I've broken the feedback down into several point

  1. Branching Strategy
    As per the process outlined in issue Repo Maintenance --> Setup Branch structure #11, pull requests targeting a specific Odoo version must be made against the corresponding branch.

Action Required: Please retarget this work to the 18.0 branch. The master branch is not used for version-specific development.

  1. Module Structure & Dependencies
    The current monolithic approach, where all functionality (B2B, POS, etc.) is in one module, goes against Odoo's design principles and the architecture discussed in issue Refactor module structure and naming convention #6.

This creates two problems:

Maintainability: A single "do-it-all" module is difficult to maintain and extend.

Unwanted Dependencies: It forces users to install unrelated packages. For example, a B2B service company should not be required to install Point of Sale to use our Monero integration.

Action Required: The functionality needs to be refactored into separate, modular packages as originally designed. For example, the POS-related payment logic should be in its own module that depends on a base "Monero payments" module. If you have any feedback on the architecture please discuss it in issue #6

Functional Scope

Monero as a Compliant Currency
A core goal of this project is to demonstrate Monero's use in legitimate, compliant business processes. This requires a robust integration that handles Monero as a formal currency within Odoo's accounting system.

The current implementation appears to have moved away from this by not including the XMR currency setup & base Cryptocurrency modules. This functionality is critical and needs to be a central part of the base module.

Functional test

After above findings after my quick code scan, I tried to perform a functional test of this code.
I was unable to install the module on a fresh local Odoo 18 instance. This is likely due to the added dependencies. Likely I can get it to install, when putting more effort and time into it. (But at this very moment I don't have). Until the module can be installed successfully, we cannot perform any functional testing. Could you please clarify the need for newly added dependencies?

Thank you again for your contribution. I look forward to collaborating with you to get the monero integration into a stable and production ready state.

"I do tend to have a different approach, e.g. working on the 14 branch to complete the features and then migrate it to the newer version. Added benefit it will provide an upgrade path for current users" (Although no one is (or should) run the current code in production.)

@xineohp2021
Copy link

xineohp2021 commented Jun 21, 2025

Thank you @bosd.

This is a detailed architectural critique of the integration module. I do agree that trade-offs are to be carefully considered for instance with regards to modularity for singular packaging rather than the former 2 modules. I have seen that the collection of dependency modules that installing POS separately would not be so disparate, as POS functionality is expectedly related to Online Market functionality and for most use-cases go hand in hand. So the trade off here is the simplicity in the installation - making things less complicated for the user and admin.

I will take a further look at the architectural section; I do agree that the structure of the repository should correspond with the Odoo version considering how rapidly the versions 14 through 18 are so fragmental and different (example is the changes from OWL-1, OWL-2 and then OWL-3).

But one thing in particular you missed is the EOL for each version. Currently Odoo 14, and 15 have reached EOL. Odoo 16 reaches EOL in October (4 months). Odoo 14, 15 and 16 are no longer worth supporting. Even Odoo 17 is borderline as it reaches EOL in October 2026 (just next year).

The XMR currency setup is automated in the data setup and uses the currency to automatically create Monero payment provider and payment method.

With regards to the functional test, please provide the logs so I can be able to suggest solutions.

Once again thank you and welcome back.

@xineohp2021
Copy link

xineohp2021 commented Jun 22, 2025

openart-image_t4yFSsno_1750590508897_raw
logo

@nahuhh
Copy link

nahuhh commented Jun 23, 2025

@bosd can you create the 18.0 branch? Not possible to retarget to a branch that doesn't yet exist ;)

Whether you revert the merge or not, is up to you

@plowsof
Copy link

plowsof commented Jun 24, 2025

@bosd are you aware of #20 , (PR'd to branch 15 and has "fixes for "versions 16, 17 and 18, in their respective branches in [his] repository."

@serhack I may have prematurely merged this in without a full review. We will revert if need be. I do not have time to dedicate to this project.

@xineohp2021 has interpreted this comment as "more of a protest which against having to merge so fast after @serhack had done the review and given him the go ahead to merge" so would be nice for this to be clarified.

@t-900-a has merged 1 of 2 PR's that claim to do the same thing so i'd like to see the reasoning behind this as there is an open bounty for this currently at over 10 XMR https://bounties.monero.social/posts/24/10-233m-upgrade-monero-integration-to-support-odoo-15

@t-900-a
Copy link
Collaborator

t-900-a commented Jun 29, 2025

@plowsof, at the time of the merge, I was unaware of the ongoing work due to a bounty. I am unable to locate the specific comment you mentioned and find it somewhat unclear: "more of a protest which against having to merge so fast after serhack had done the review and given him the go ahead to merge."

@plowsof, the current situation is confusing. I have reached out to you via Matrix and require additional details to stay involved. I am reluctant to engage in public disputes that resemble petty arguments over trivial matters.

@plowsof
Copy link

plowsof commented Jun 29, 2025

i forgot to be more specific: the comment "more of a protest.." occurred in the bounties room on matrix. That is niyid telling us why you merged this PR. If this interpretation is wildly inaccurate or close to the truth then that'd be good to know.

i'm sure this will be cleared up eventually 🙏

@t-900-a
Copy link
Collaborator

t-900-a commented Jun 29, 2025

"wildly inaccurate"

@xineohp2021
Copy link

xineohp2021 commented Jun 30, 2025

@serhack I may have prematurely merged this in without a full review. We will revert if need be. I do not have time to dedicate to this project.

@xineohp2021 has interpreted this comment as "more of a protest which against having to merge so fast after @serhack had done the review and given him the go ahead to merge" so would be nice for this to be clarified.

I need to clarify here - what I said was t-900-a appeared to have protested against merging because he had been instructed to, and which could only have come about because a code review was done (I assume that code reviews come before merging of code).

Screenshot From 2025-07-01 02-52-18

I need to also point out once again that Odoo 14, 15 and marginally 16 really should not be supported because of the EOL as shown in the link -

https://www.odoo.com/documentation/18.0/administration/supported_versions.html

Odoo EOL

They are not even supported any longer on popular hosting websites.

Here you suggest that @serhack worked with them which appears not to be so.

Screenshot From 2025-07-01 02-56-08

Lastly, there is no contention here.

  • The rules are clear - the bounty goes to the first working PR. This PR has already satisfied all the conditions.

  • From what I have learned, obviously the contending code are outdated (Odoo 14, 15) and do not even work which is why there had never been a demo (plowsof told me this himself). But the main point is they are outdated.

I understand that the bounty goes back to 2021 when Odoo 15 was just being released, but within a space of 4 years it had become totally outdated and reached EOL with 3 releases since then. We just have to move with the times. It is just really surprising that there was no interest within those 4 years, until I took it up.

@nahuhh
Copy link

nahuhh commented Jul 1, 2025

@bosd can you create the 18.0 branch? Not possible to retarget to a branch that doesn't yet exist ;)

Whether you revert the merge or not, is up to you

Bumping ^
@t-900-a or @bosd can an 18.0 branch be created so that a compliant PR may be properly submitted? Thanks

  1. Branching Strategy
    As per the process outlined in issue Repo Maintenance --> Setup Branch structure #11, pull requests targeting a specific Odoo version must be made against the corresponding branch.

Action Required: Please retarget this work to the 18.0 branch. The master branch is not used for version-specific development.

@xineohp2021
Copy link

Dear All,

Odoo 19 was released last weekend and that effectively means Odoo 16 has reached EOL.

I plan to upgrade #22 to Odoo 19 and in fact I started working on it and with a few changes should be done. But work cannot continue until I have received an ACK for the current pending PR. I look forward to your cooperation.

Regards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants