Upgrading to Flectra 2 - A Journal
Let's upgrade Flectra
A few years ago, just before Covid, we were looking for an e-commerce engine to start our online shop that was spun out of our main business. We were also looking for an accounting system to replace the Windows-based system that our succession of bookkeepers insisted on using. When our last bookkeeper emigrated we felt it was an opportune time to bring it all in-house and rely on an open-source system where we could take it places we never considered before with a closed-sourced system and, at the same time, begin to offer support and subscriptions from the creators to our customers who would find the product as useful as we did.
We looked at open-source accounting systems about a decade ago, sans the e-commerce requirement. At the time the main contenders were OpenBravo, Tiny ERP and SQLedger. We didn't settle on any of them at the time. Our risk assessment was as follows:
None of these projects would have turned out to be a good option to bet the company accounting system on. OpenBravo, stopped its open-source editions in 2019. Seems they regret the use of Open in their name now. Tiny ERP became Odoo and, as I will expand on, is being closed off section by section and SQLedger went nowhere.
When it came time to look at this again Tiny ERP, now Odoo, stood out as a great option feature and customisation wise and it was now web-based but its business model left no doubt that the community edition is on notice. While looking we came across Flectra, a fork of Odoo, and it at least seemed to address some of the risks with Odoo. There was a lot of bad stuff being said online but since we were new to the Odoo/Flectra world it was hard to tell who was "in the right". Suffice it to say no one looked clean but I could understand the fork given Odoo's moves to reduce functionality. We wouldn't want to sign up for a project that looked hostile to its community user base.
The lack of a vibrant community around Flectra and that it was a new, unproven project was a big risk for us but we were under pressure and accepting the risk implemented Flectra.
Shortly after implementing Flectra 1.6 and then upgrading to 1.7 Flectra 2 was announced. This was not great news for us major version upgrade option from Flectra and Odoot is something we knew was going to happen sooner or later. Unlike Odoo where it is relatively easy to find assistance in the community with Flectra, this is less so. Flectra's main communication channel is Telegram which is a walled garden that cannot be queried nor searched with a browser. Questions need to be answered time and again as there is no history for users to refer to. It's hard to build up a knowledge repository this was which is supposed to be one of the benefits of open-source for adopters.
This journal is our contribution to the Flectra community and to FlectraHQ to see if we can help build up the expertise and knowledge that a vibrant open-source community can provide and to thank the Flectra developers for their efforts. I am not sure where this journey will end but I am hopeful that with the community expertise, we can assist each other and Flectra with this important project.to get all things sorted. To make sure its clear we have not yet completed the upgrade process but want to document what we have tried so far in the hope it helps others and we can work out the steps required for a successful upgrade as a community.
We set up a virtual machine to test the upgrade process. This would allow us to snapshot and roll back as needed as we experimented with the upgrade. We are using a Ubuntu 20.04 virtual machine as its version of Python and Postgres have fewer issues with Odoo 12,13 and 14 than Ubuntu 22.04. to get all things sorted.to get all things sorted.to get all things sorted.to get all things sorted.to get all things sorted. Our production server is using Ubuntu 18.04 just in case this becomes relevant later.
The plan is, based on fragmented information online, to upgrade from Flectra 1.7 to Odoo 12, then 13 and 14 before installing Felctra 2. The major version upgrades will be done with the Odoo community tool OpenUpgrade. There was a change in the way OpenUpgrade works from 13 to 14 which we will document, but the high-level steps for each version upgrade are as follows:
Sounds like a walk-in-the-park right? Sadly far things don't look good. Here is what we have achieved so far.
Note: The /var/lib/odoo/.local/share/Odoo/filestore directory will not exist until you run Odoo so you may need to create it or run odoo to create it then stop odoo and copy over the files.
We don't know a whole lot about Odoo and Flectra internals and development but have written some basic modules. This processes is teaching us a whole lot about Flectra's internals we wish we didn't need to know but it all helps in the long-run.
Note: The addons directory will not exist until you install Odoo.
We had to edit "views.xml" , "templates.xml" and models to accommodate changes between versions of Odoo. This is something that will be different for your custom modules. Our modules are simple so it was mainly related to xpath queries to change the layout templates. We did find that, on occasion, we needed to delete the entries from ir_ui_view in order for changes to templates.xml to be loaded despite running an update.
Next, we need to install OpenUpgrade. The OpenUpgrade library is required by the OpenUpgrade scripts. As far as we can tell this needs to be installed separately from the GitHub repository. Don't use the library that comes with Ubuntu 20.04 instead install the latest version with:
Next, we need to clone the github repo and switch to the right branch for the upgrade. In this case (Flectra 1.7 (Odoo 11) to Odoo 12)
We use the account financial report module amongst others. We didn't find versions of all the 3rd party modules that we used in Flectra. This is probably the cause of some of the issues we have experienced.
We will assume the steps to upgrade complete for now. As you may suspect, running the upgrades steps is where most of the work lies and we will document the challenges we came across in the following sections.
Not quite. As you can guess the upgrade steps don't go according to plan..
Before we began the upgrade to Odoo 12. We ran an update on Flectra 1.7 to make sure the database was up-to-date.
During this process, we got errors updating the themes. Theme Art, Hermit, Techperspective etc were noted as not upgraded due to being incompatible. We got the same error attempting to update them via the web interface. We tried uninstalling them and then reinstalling them. We managed to get Theme Art to install, at least according to the web interface. None of the other themes would install though. Strangely it didn't seem to bother the e-commerce that their themes were missing. We have multiple e-commerce sites and we cannot use the same theme on different sites and so had to install a different theme for each site. So before the upgrade only Theme Art was installed even though other sites where using "Theme Hermit" etc. So there is some issue here that may be causing issues with our upgrade. Anyone else had these problems with theme and Flectra 1.7?
We got several errors during the OpenUpgrade process.
After this the OpenUpgrade process ran to the end but the following modules were not upgraded.
We will need to check the ir_module_module table to see if we can work out the modules we need here, mapping from Flectra to Odoo.
I edited my client's host file to point to the upgrade server to ensure that any url would be mapped correctly and then started the Odoo service and access the website with http://url:8069
The first page looked promising and had only minor style issues but upon logging in numerous errors were presented. We suspect most of these relate to the missing modules.
We will be updating this post before documenting our process from 12 to 13. We are unsure if we need to resolve all these problems in 12 before upgrading to 13 and then 14. Can we just ignore the missing modules until we get to Flectra 2 where they will be available again?
We continued to upgrade from Odoo 12 to Odoo 13 and overcome some obstacles there but we still got a way to go to get to Flectra2 and see if it all works. We will document these in a later post too. Please share your stories and experiences.