Daily updates from Odoo
Thursday, May 24, 2018
4 changes · master
Enhancements to existing features
The HR attendance kiosk now makes a regular background check to keep its session active. This helps prevent kiosk sessions from closing after seven days, reducing interruptions for employees checking in or out.
Original PR description
Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
This update improves how inventory barcode workflows support manufacturing work orders. It helps teams process shop floor activities more smoothly and reduces friction when tracking production operations through barcode scanning.
Exports now process external reference identifiers at the end in larger batches instead of repeatedly during each export step. This reduces export time especially for records with related fields, improving performance for large data exports without changing the exported data.
Original PR description
#22493 added significant batching to the generation & fetching of XIDs, but because _export_rows is recursive it really only did so for the toplevel XIDs (and to a lower extent for o2m/m2m fields),…
#22493 added significant batching to the generation & fetching of XIDs, but because _export_rows is recursive it really only did so for the toplevel XIDs (and to a lower extent for o2m/m2m fields), and e.g. m2o xids are *significantly* slower than exporting a simple field: on my machine, exporting one field of 10000 records before this PR,
## Integer field
4113226 function calls (3683145 primitive calls) in 4.866 seconds
| ncalls | tottime | percall | cumtime | percall | filename:lineno(function) |
|--------------:|--------:|--------:|--------:|--------:|------------------------------------|
| 1 | 0.080 | 0.080 | 4.866 | 4.866 | models.py:692(_export_rows) |
| 70010/10010 | 0.120 | 0.000 | 2.999 | 0.000 | models.py:4699(\_\_getitem\_\_) |
| 70000/10000 | 0.198 | 0.000 | 2.979 | 0.000 | fields.py:949(\_\_get\_\_) |
| 10 | 0.003 | 0.000 | 2.836 | 0.284 | fields.py:1038(determine_value) |
| 10 | 0.000 | 0.000 | 2.833 | 0.283 | models.py:2619(_prefetch_field) |
| 10 | 0.138 | 0.014 | 2.828 | 0.283 | models.py:2568(read) |
| 1 | 0.003 | 0.003 | 1.345 | 1.345 | models.py:621(__ensure_xml_id) |
| 10 | 0.049 | 0.005 | 1.342 | 0.134 | models.py:2671(_read_from_database)|
| 230040 | 0.317 | 0.000 | 0.954 | 0.000 | fields.py:2551(\_\_get\_\_) |
| 10000 | 0.091 | 0.000 | 0.666 | 0.000 | _collections_abc.py:824(update) |
## M2O field (same m2o for all records)
5463322 function calls (4973238 primitive calls) in 9.825 seconds
| ncalls | tottime | percall | cumtime | percall | filename:lineno(function) |
|------------:|--------:|--------:|--------:|--------:|------------------------------------------------------------|
| 10001/1 | 0.349 | 0.000 | 9.827 | 9.827 | models.py:692(_export_rows) |
| 10001 | 0.159 | 0.000 | 5.337 | 0.001 | models.py:621(__ensure_xml_id) |
| 70010/10010 | 0.128 | 0.000 | 3.485 | 0.000 | models.py:4699(\_\_getitem\_\_) |
| 70000/10000 | 0.214 | 0.000 | 3.457 | 0.000 | fields.py:949(\_\_get\_\_) |
| 20020 | 0.041 | 0.000 | 3.151 | 0.000 | sql_db.py:149(wrapper) |
| 10 | 0.004 | 0.000 | 3.137 | 0.314 | fields.py:1038(determine_value) |
| 10 | 0.001 | 0.000 | 3.133 | 0.313 | models.py:2619(_prefetch_field) |
| 10 | 0.143 | 0.014 | 3.127 | 0.313 | models.py:2568(read) |
| 10013 | 0.046 | 0.000 | 3.093 | 0.000 | sql_db.py:221(execute) |
| 10013 | 2.698 | 0.000 | 3.042 | 0.000 | {method 'execute' of 'psycopg2.extensions.cursor' objects} |
## M2O field (different m2o for all records)
6333236 function calls (5793157 primitive calls) in 17.154 seconds
| ncalls | tottime | percall | cumtime | percall | filename:lineno(function) |
|------------:|--------:|--------:|--------:|--------:|--------------------------------------------------------------|
| 10001/1 | 0.443 | 0.000 | 17.157 | 17.157 | models.py:692(_export_rows) |
| 10001 | 0.482 | 0.000 | 11.713 | 0.001 | models.py:621(__ensure_xml_id) |
| 10001 | 4.152 | 0.000 | 4.207 | 0.000 | {method 'copy_from' of 'psycopg2.extensions.cursor' objects} |
| 70010/10010 | 0.186 | 0.000 | 4.184 | 0.000 | models.py:4699(\_\_getitem\_\_) |
| 70000/10000 | 0.250 | 0.000 | 4.134 | 0.000 | fields.py:949(\_\_get\_\_) |
| 30019 | 0.074 | 0.000 | 4.017 | 0.000 | sql_db.py:149(wrapper) |
| 10013 | 0.059 | 0.000 | 3.907 | 0.000 | sql_db.py:221(execute) |
| 10013 | 3.442 | 0.000 | 3.843 | 0.000 | {method 'execute' of 'psycopg2.extensions.cursor' objects} |
| 10 | 0.004 | 0.000 | 3.779 | 0.378 | fields.py:1038(determine_value) |
| 10 | 0.001 | 0.000 | 3.775 | 0.377 | models.py:2619(_prefetch_field) |
# Fix
By replacing the xid insertion by a placeholder then collecting the placeholders & batching their conversion to xids, the impact of relational XID exports can be *significantly* lessened, using the same benches post-PR:
## Integer
4183240 function calls (3733159 primitive calls) in 4.898 seconds
| ncalls | tottime | percall | cumtime | percall | filename:lineno(function) |
|------------:|--------:|--------:|--------:|--------:|-------------------------------------|
| 1 | 0.120 | 0.120 | 4.898 | 4.898 | models.py:692(_export_rows) |
| 70010/10010 | 0.123 | 0.000 | 3.069 | 0.000 | models.py:4711(\_\_getitem\_\_) |
| 70000/10000 | 0.192 | 0.000 | 3.048 | 0.000 | fields.py:949(\_\_get\_\_) |
| 10 | 0.004 | 0.000 | 2.910 | 0.291 | fields.py:1038(determine_value) |
| 10 | 0.001 | 0.000 | 2.906 | 0.291 | models.py:2631(_prefetch_field) |
| 10 | 0.136 | 0.014 | 2.901 | 0.290 | models.py:2580(read) |
| 10 | 0.049 | 0.005 | 1.399 | 0.140 | models.py:2683(_read_from_database) |
| 1 | 0.002 | 0.002 | 1.342 | 1.342 | models.py:621(\_\_ensure_xml_id) |
| 250040 | 0.339 | 0.000 | 1.054 | 0.000 | fields.py:2551(\_\_get\_\_) |
| 10000 | 0.089 | 0.000 | 0.788 | 0.000 | _collections_abc.py:824(update) |
## M2O field (same m2o for all records)
4573449 function calls (4093360 primitive calls) in 5.530 seconds
| ncalls | tottime | percall | cumtime | percall | filename:lineno(function) |
|------------:|--------:|--------:|--------:|--------:|--------------------------------------------------------------|
| 10001/1 | 0.319 | 0.000 | 5.530 | 5.530 | models.py:692(_export_rows) |
| 70010/10010 | 0.124 | 0.000 | 3.261 | 0.000 | models.py:4711(\_\_getitem\_\_) |
| 70000/10000 | 0.192 | 0.000 | 3.238 | 0.000 | fields.py:949(\_\_get\_\_) |
| 10 | 0.004 | 0.000 | 2.991 | 0.299 | fields.py:1038(determine_value) |
| 10 | 0.001 | 0.000 | 2.988 | 0.299 | models.py:2631(_prefetch_field) |
| 10 | 0.141 | 0.014 | 2.983 | 0.298 | models.py:2580(read) |
| 2 | 0.006 | 0.003 | 1.511 | 0.755 | models.py:621(\_\_ensure_xml_id) |
| 10 | 0.056 | 0.006 | 1.342 | 0.134 | models.py:2683(_read_from_database) |
| 270048 | 0.363 | 0.000 | 1.126 | 0.000 | fields.py:2551(\_\_get\_\_) |
| 2 | 0.744 | 0.372 | 0.744 | 0.372 | {method 'copy_from' of 'psycopg2.extensions.cursor' objects} |
## M2O field (different m2o for all records)
5463361 function calls (4903280 primitive calls) in 7.163 seconds
| ncalls | tottime | percall | cumtime | percall | filename:lineno(function) |
|------------:|--------:|--------:|--------:|--------:|--------------------------------------------------------------|
| 10001/1 | 0.350 | 0.000 | 7.163 | 7.163 | models.py:692(_export_rows) |
| 70010/10010 | 0.125 | 0.000 | 3.336 | 0.000 | models.py:4711(\_\_getitem\_\_) |
| 70000/10000 | 0.195 | 0.000 | 3.312 | 0.000 | fields.py:949(\_\_get\_\_) |
| 10 | 0.003 | 0.000 | 3.057 | 0.306 | fields.py:1038(determine_value) |
| 10 | 0.001 | 0.000 | 3.054 | 0.305 | models.py:2631(_prefetch_field) |
| 10 | 0.141 | 0.014 | 3.048 | 0.305 | models.py:2580(read) |
| 2 | 0.007 | 0.004 | 2.884 | 1.442 | models.py:621(\_\_ensure_xml_id) |
| 350040 | 0.478 | 0.000 | 1.488 | 0.000 | fields.py:2551(\_\_get\_\_) |
| 10 | 0.057 | 0.006 | 1.397 | 0.140 | models.py:2683(_read_from_database) |
| 2 | 1.260 | 0.630 | 1.260 | 0.630 | {method 'copy_from' of 'psycopg2.extensions.cursor' objects} |Website editors can now delete a page directly from its page properties dialog. This saves time by removing the need to open the page manager and search for the page before deleting it.
Original PR description
With this commit, it is now possible to delete a page directly from it's page properties dialog. Before this commit, you had to go into the page manager and then find your page that could take some time. task-1850578 Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr