In Odoo we can calculate the fields in two ways, depending on other fields and not depending on the other fields. On this page, we are going to discuss how to define a compute method using the studio module.
Let's check how to define a compute method to calculate the total quantity of Sale Orders.
For that first of all we have to create a field for the quantity in the Sale Order model.
To define a compute method for this field go to the more option that is in the editor.
In the opening view, we can add dependent fields and a Python code for the field.
We are defining it shown in the image below.
At the end, you will be able to see the total quantity of the products in the field.