From 99b22078de7c1cc07e1fba1e67aa9d455acc09ea Mon Sep 17 00:00:00 2001 From: Nicolas Seinlet Date: Mon, 23 Apr 2018 03:39:05 +0000 Subject: [PATCH] [IMP] point_of_sale: pos order report performance This inner join permit to have filters on orders to be executed earlier in the query plan In a multi-company environment with millions of pos lines, the difference is about 10% faster As you cannot have a line without order, this doesn't introduce reggression. closes odoo/odoo#34849 Signed-off-by: pimodoo --- addons/point_of_sale/report/pos_order_report.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/point_of_sale/report/pos_order_report.py b/addons/point_of_sale/report/pos_order_report.py index 33684c818c7..b73b79cff48 100644 --- a/addons/point_of_sale/report/pos_order_report.py +++ b/addons/point_of_sale/report/pos_order_report.py @@ -69,7 +69,7 @@ class PosOrderReport(models.Model): def _from(self): return """ FROM pos_order_line AS l - LEFT JOIN pos_order s ON (s.id=l.order_id) + INNER JOIN pos_order s ON (s.id=l.order_id) LEFT JOIN product_product p ON (l.product_id=p.id) LEFT JOIN product_template pt ON (p.product_tmpl_id=pt.id) LEFT JOIN uom_uom u ON (u.id=pt.uom_id)