Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0037835Openbravo ERP02. Master data managementpublic2018-02-05 16:012018-02-22 18:19
0037835: Performance issue in Generate Invoices process
Generate Invoices process takes too long to load in environments with high amount of data
- Run "Generate Invoices" process from the backend

It takes 2531974.042 ms to load
No tags attached.
? generate_invoice.sql (12,894) 2018-02-05 16:24
? generate_invoices_query_plan (7,879) 2018-02-05 16:24
Issue History
2018-02-05 16:01JONHMNew Issue
2018-02-05 16:01JONHMAssigned To => Triage Finance
2018-02-05 16:01JONHMFile Added: generate_invoices.sql
2018-02-05 16:01JONHMModules => Core
2018-02-05 16:01JONHMResolution time => 1519599600
2018-02-05 16:01JONHMTriggers an Emergency Pack => No
2018-02-05 16:02JONHMFile Added: generate_invoices_test_plan
2018-02-05 16:12jfrancesIssue Monitored: jfrances
2018-02-05 16:24JONHMFile Deleted: generate_invoices.sql
2018-02-05 16:24JONHMFile Deleted: generate_invoices_test_plan
2018-02-05 16:24JONHMFile Added: generate_invoice.sql
2018-02-05 16:24JONHMFile Added: generate_invoices_query_plan
2018-02-06 11:20dmiguelezAssigned ToTriage Finance => collazoandy4
2018-02-06 22:22collazoandy4Statusnew => scheduled
2018-02-12 17:09collazoandy4Note Added: 0102338
2018-02-15 17:45collazoandy4Note Added: 0102447
2018-02-16 17:19collazoandy4Note Edited: 0102447bug_revision_view_page.php?bugnote_id=0102447#r16731
2018-02-20 09:55hgbotCheckin
2018-02-20 09:55hgbotNote Added: 0102517
2018-02-20 09:55hgbotStatusscheduled => resolved
2018-02-20 09:55hgbotResolutionopen => fixed
2018-02-20 09:55hgbotFixed in SCM revision => [^]
2018-02-20 09:56dmiguelezReview Assigned To => dmiguelez
2018-02-20 09:56dmiguelezNote Added: 0102518
2018-02-20 09:56dmiguelezStatusresolved => closed
2018-02-20 09:56dmiguelezFixed in Version => 3.0PR18Q2
2018-02-22 18:19hudsonbotCheckin
2018-02-22 18:19hudsonbotNote Added: 0102778

2018-02-12 17:09   
Test Plan
  Open Generate Invoices window and check the business partner field is empty
  Go to Sales Order and create three new records:
    1. Business Partner: Alimentos y Supermercados, S.A, Invoice Terms: Immediate, Product: Agua sin Gas 1L, Ordered Quantity: 5
    2. Business Partner: Hoteles Buenas Noches, S.A., Invoice Terms: After Delivery, Product: Zumo de Pera 0,5L, Ordered Quantity: 6
    3. Business Partner: Restaurantes Luna Llena, S.A., Invoice Terms: After Order Delivered, Product: Zumo de PiƱa 0,5L, Ordered Quantity: 7
  Go to Goods Shipment window and create a new record:
    Business Partner: Hoteles Buenas Noches, S.A.
    Create Lines From the previous order created
    Edit the line created Movement Quantity: 3
    Complete the shipment
    Create another record in Header tab:
      Business Partner: Restaurantes Luna Llena, S.A.
      Create Lines From the previous order created
      Complete the shipment
  Open Generate Invoices window and check the business partner shows 3 records (The three partners created)
2018-02-15 17:45   
(edited on: 2018-02-16 17:19)
With the changes made the execution query cost was reduce from 105544030.57 to 838264.07

2018-02-20 09:55   
Repository: erp/devel/pi
Changeset: b13652428b1cd2b3d8a8c491933e1a7cb5e50c1e
Author: Armaignac <collazoandy4 <at>>
Date: Fri Feb 09 18:44:25 2018 -0500
URL: [^]

Fixes issue 37835: Performance issue in Generate Invoices process

Generate Invoices process takes too long to load in environments with high amount
of data

The query to get all the business partner with pending sales order to invoice was
changed using the index created to minimize the time that the process take to load

M src-db/database/model/tables/C_ORDERLINE.xml
M src-db/database/sourcedata/AD_VAL_RULE.xml
2018-02-20 09:56   
Code Review + Testing Ok
2018-02-22 18:19   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: [^]
Maturity status: Test