For any company it is important to have software that helps it manage internal and external administrative processes, such as managing the supply chain in the food industry, for this there are ERPs and perhaps the most robust, functional and versatile of these be Odoo.
ERP stands for Enterprise Resource Planning and refers to the software that manages day-to-day business activities. It integrates supply chain, services, purchasing, accounting, human resources and financial processes, all in one system to unify business operations.
Odoo is one of these software, recognized for being configured with different modules that allow the user the integral management of a company, covering all essential areas such as: payroll, accounting, sales and customer service. It can be implemented in any type of industries without problems.
Odoo is also characterized by having CRM, or Customer Relationship Management, functions, which refers to a technological tool designed to manage and collect important information and data about a company's contacts, customers, and potential customers.
This is an essential tool for any sales team that wants to stay competitive and grow the company, so Odoo has important and effective CRM features that will contribute to this goal. Among the most important functions are:
In their official documentation, they define Locust as “an easy-to-use, programmable, and scalable performance testing tool. You define the behavior of your users in normal Python code, rather than being stuck in a restrictive domain-specific language or user interface. This makes Locust infinitely expandable and very developer friendly.”
To install Locust, Odoo Locust and other dependencies
pip install locust OdooLocust odoo-client-lib
After this, we are going to start creating the Odoo Locust load test
Create a python file and put the below code in it. Here we are going to perform a load test using the OdooLocustUser class.
from locust import task, between from OdooLocust.OdooLocustUser import OdooLocustUser class Seller(OdooLocustUser): wait_time = between(0.1, 10) host = '127.0.0.1' database="database_name" login = "login" password="password" port = port protocol="jsonrpc" @task(10) def read_partners(self): customer_model = self.client.get_model('res.partner') customer_ids = cust_model.search() customers = cust_model.read(cust_ids) @task(5) def read_products(self): product_model = self.client.get_model('product.product') ids = prod_model.search() products = prod_model.read(ids)
Run load test
After the previous step, the Python file should be executed:
locust -f file_name.py
While running the above command, we get some details about which port will be executed as below.
After this, in any web browser you have accessible go to 127.0.0.1:8089 and the Locust UI will be displayed.
In the interface, Locust needs three inputs to start Odoo:
1. Number of users.
2. Generation rate: users started per second.
3. Host: if we specify the host in the Python code, it will automatically be filled in here; otherwise we can also add from the UI.
With all this data entered, the load test will look like this:
And in this simple and fast way, it is possible to perform a load test with Odoo databases using Locust.
At Rootstack we are official Odoo partners, so we have the most experienced staff to work with this type of platform and give your company the ERP and CRM solution it needs. Do you have questions about how Odoo CRM works? Do not hesitate to contact us.