Odoo eCommerce development is rife with pitfalls. A competent Odoo developer can develop an excellent eCommerce platform on Odoo. However, a few unassuming mistakes can wreak havoc on the entire project. And these mistakes happen more often than one would think. That is why, the developers can never be too careful during Odoo eCommerce development. Here are some of the common pitfalls and mistakes to avoid when developing an eCommerce platform on Odoo.
Thorough Testing
Here’s a golden rule. Whenever you find yourself asking the question, “should we give it a test?” the answer is always YES!
“But, it is only a small modification...” The answer is still YES.
“Yeah, we have only added a popular module. We haven’t changed any code”. Great! But the answer is still YES.
In fact, make sure that you test your Odoo eCommerce with all of its modules. While you are at it, test all the modules on all the versions of your Odoo eCommerce that would be going live. Quite often, the code on one module is incompatible with the code on another. If you will be using a custom module, then it is imperative that you test its compatibility with every version of Odoo eCommerce you will be using as well as the different modules. Sure, it’s a lot of work in the back end, but it’ll ensure that you don’t end up with an unhappy customer.
Customizing Everything
One of the primary advantages of open source platforms like Odoo is that they are cost-effective. Some businesses completely fail to take full benefit of this advantage by going for heavy customization of the software. This not only increases the costs, but also exposes them to new risks. Most Odoo developers have easy access to almost all the common bugs that appear in the Odoo platform, because those bugs and their fixes have been documented for years. When businesses go for heavy customizations, they expose themselves to risks of previously unknown bugs. Even though the developers may be finally able to find and fix these bugs, such issues take significantly more time to be fixed. Precious time is unnecessarily wasted.
Core Files Modification
Any modifications that you make to your Odoo eCommerce build must not be applied to the core files directly. Whenever possible, make use of overrides. This way, it will be easier for the future developers to identify the modifications easily and understand their role in the mountains of code, without having to sift through all of it. It saves them time and is a best practice. This brings us to another important best practice.
Writing Comments Against Each Modification
Good developers often end up wasting their precious time because bad developers did not think it is worth their time to write simple comments explaining the modifications they make to the code. This is singularly the worst coding practice. At the same time, it can have tremendous ramifications for the business. Suppose a developer is analyzing the code to understand why their business’s Odoo eCommerce build is down. Every second they spend on understanding the role of this new code is possibly costing the business a great deal of money in lost revenues and customer trust.
So, it cannot be reiterated enough – use comments profusely.
You know what, while you are at it, format your code and make it easy to understand for other developers. Use indentations and formatting as much as you need.
Reduce Usage of JavaScript
People love to make their websites shiny, lively, and full of animations. A few years ago, developers used Flash to add the animations; today, it is the turn of JavaScript. One thing that is common between them? Both of them slow down your website. What’s worse is that a single JavaScript error can throw a wrench into your website’s accessibility. The risks are high and the rewards are not really worth it. Minimize the usage of JavaScript.
Always Keep Your Development Sites in Developer Mode
Unless you want to go to “config” and set “dev mode” every time you are delving into the code, it’s better to keep the development sites in the developer mode by default. You can do this by first creating a class with the settings values, followed by overriding the “web.Home” controller, and then by adding auto-debug mode behavior.
If you don’t want to go through all those troubles, then you can simply use the Odoo Debug extension for Chrome or Odoo Easy Debug extension for Mozilla Firefox to set the default modes to debug.