Taler-Odoo Payment System Devlog

On another topic:

Today marks the first complete release of the Taler-Odoo Payment System!!
All the milestones are now implemented, with tons of side-tasks completed as well :fireworks:

There are a few tasks that could be worked on and improved, they are listed in the How to contribute section of the README. Example of such tasks are the above-mentionned ducomentation improvements, or implementing partial refunds in the refund process.

I intend on making a second, smaller budget proposal to NLNet for some of these tasks.

I’ll also make a post in this category for the 1.0.0 release, and where it can be downloaded.

I am super happy to reach the end of this part of the project, and I will now take some time to breath and focus on other things, before coming back for the improvements that are waiting.

3 Likes

Thank you @Nemael for keeping this devlog. I think it’s encouraging for others to pick up tasks and share their work. It seems to be a lot of work and is certainly very generous of you to offer an account of your experience and your progress during this journey through implementing Taler. It really makes the free in free software sound like solidarity rather than laissez-faire. KUDOS to you. :wink:

1 Like

Thank you for the words of encouragement!

It was very important to me to follow this “sit down and explain what you did, why you did, and what problems appeared” process, for documentation and sharing purposes.

When approaching the end of the project, I did reach a point where I had to ask myself “what can I explain that I haven’t explained before in this thread”, and at this point I had to stay more high-level, the devlogs were harder to make, but also more interesting because the topics broadened.

I am extremely happy to have had this opportunity, and I am excited to continue to share and work on this code!

On the 10th of June 2026:

I am coming back to this project! To complete a small new set of milestones, and implement a new feature! I plan on implementing partial refunds, updating the add-on for Odoo 19, and improve the documentation structure + translate it.

I finished converting all the documentation from markdown to .rst, to implement Sphinx documentation. It was a hefty chunk of work! All the text was already written, but the structure had to be redone from scratch. I am happy with the result.

I tried a few of the automatic .md to .rst converters, but none of them worked the way I wanted, maybe my approach to markdown is different from the proper way I should write markdown ¯\_(ツ)_/¯

I also made the documentation ready-to-translate, using Sphinx’s built-in translation tools, with .po files. We are now in the process of translating it.

1 Like

On the 20th of June 2026:

The translation of the documentation is in good progress. I have tackled, and completed the implementation of the new feature, partial refunds.

I implemented safeguards to limit the total refundable amount (so that a bunch of small refunds cannot exceed the original amount), and have updated the documentation and software internationalization accordingly.

This step went smoothly, because I already had a good structure that allowed me to implement partial refunds without big blockers, and I could rely on the refund management system I had implemented before to ensure the safety of the partial refunds.

I will now work on updating the module for Odoo 19 :slight_smile:

1 Like

On the 25th of June 2026:

Upgrading to Odoo 19 was more of a struggle than I expected! It took me 6 evenings to sort out the multiple issues.

Odoo changed a good chunk of the online payment pipeline when they went from Odoo 18 to Odoo 19, as well as the refund flow. I had to re-do part of my Taler Transaction model, to fit this new format.

I redid a chunk of the unit tests, to fit the new refund system, and tested full and partial refund thoroughly, by following each flow that I had documented, to check that everything was working properly.

The main change for the refund flow was that, instead of focusing on the original transaction, the refund flow now focus on the refund transaction, and only keep a link to the original transaction.

I also encountered and fixed issues relating to floating point for the partial refunds. I was going crazy over a case where python was stubbornly telling me that “0.2 + 0.1 > 0.3”, when I was expecting it to be equal, and it turns out that the total was “0.300000000000004”, which was indeed bigger than 0.3…

I locked down on this issue by rounding float values to the currencies’ precision digits, and it should not happen anymore! I don’t think that there are any Odoo-accepted currencies that have a precision value different from 0.01 though, I probably didn’t need to go through the trouble of grabbing this value, and could have hardcoded it.

Next step is uploading a first draft of the documentation on ReadTheDocs, to obtain a link to my online documentation, and add it to the documentation

I’m curious: Aren’t you using Decimal() for calculating amounts? Isn’t this what Odoo does? (Tryton does this since loooong.)

1 Like

Apologies for the long response, I wanted to look into that, and it slipped my mind! Thank you for reading and for your advice.

Odoo does use both Float and Decimal. They have a standardized format accross components with const CURRENCY_DECIMALS, but float is used in some components, and decimal is used in other components.

Odoo also provide these helper functions, which I used to manipulate amount values safely

While I do think my current solution is safe, I may also tinker with the Decimal, to make the data transfer more reliable and easier to read the code.

Thank you for your pointer!

I don’t know how this is handled in Python or Odoo, but generally it’s customary to use integers and avoid floats entirely when working with money, since a tiny difference in arbitrary precision errors can quickly build up to millions.

Maybe Monetary Fields and Currency Handling in Odoo: Complete Guide (2026) | DeployMonkey is useful?

Using Integers does make sense.
This rounding piece is part of only one specific partial-refund flow, where Odoo sends me the refunded amount as a float.
I will explore options, maybe there is a way to make Odoo send me an integer accompanied with precision or comma position, or a Decimal() object, but the Odoo-integrated add-ons also manipulate a float, so I’ll see what’s accessible to me :slight_smile:

Thank you for sharing this link! It does not bring new information to me, but it is a nicely short summary of a lot of
things I have struggled with a few months ago! I’ll keep it close for reference, and for sharing :smiley:

Edit: Actually, now that I look closer at the link you shared, I do see that it talks about a round() method to round any currency, that I did not know about :fireworks:
I will check if Odoo allows me to use that in my flow!

1 Like