Commit f0305cb7 authored by Jérome Perrin's avatar Jérome Perrin

Revert "officejs_support_request_ui: use accessors on ERP5 documents"

This reverts commit 5b251ce6.
parent 1e3acb66
...@@ -19,9 +19,8 @@ count_by_state = {} ...@@ -19,9 +19,8 @@ count_by_state = {}
count_by_date = {"le2": {}, "2to7": {}, "7to30": {}, "gt30": {}} count_by_date = {"le2": {}, "2to7": {}, "7to30": {}, "gt30": {}}
for sr in support_request_list: for sr in support_request_list:
sr = sr.getObject() sr_date = sr.start_date
sr_date = sr.getStartDate() sr_state = sr.getProperty("simulation_state")
sr_state = sr.getSimulationState()
if sr_state not in count_by_state: if sr_state not in count_by_state:
count_by_state[sr_state] = 0 count_by_state[sr_state] = 0
......
  • 5b251ce6 was really killing the performance, because we were supposed to access brain of object, not to get the object from the database, which becomes expensive when the number of document grow.

    It was observed that for more than 2000 support requests, this script took almost 30 seconds.

    This MR also fix the fact that we don't need to get so many support requests.

    In the (far) future, I think we can:

    • put support requests in stock table , so that we can use inventory API. It was already discussed that deliveries should be in stock table.
    • use the group_by_time_sequence once !6 is finished and merged
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment