CRM, Sales & Marketing mailing list archives

crm-sales-marketing@odoo-community.org

Avatar

Big performance issue with sale orders with more than 500 lines

by
Landoo SL, Josean Soroa
- 22/03/2022 12:05:27
Hi all.
In Odoo version 14, we are facing big performance issues with sale orders that have more than 500 lines.
We are creating lines fron XML-RPC so it has nothing to see with web interface.
The problem is _amount_all method. Each time a line is created, this method reads all lines and computes total amounts of sale order. (line 40 of sale.py)
@api.depends('order_line.price_total')
def _amount_all(self):
...
for line in order.order_line:
...
This is very inefficient.
I can't find nothing developed to avoid this Odoo behaviour.
Has anyone solved this issue?
Many thanks.
-----------------------------------------------------------
Josean Soroa
LANDOO SL - www.landoo.es
-----------------------------------------------------------





Follow-Ups