Commit f3f5850
committed
[FIX] evaluation: fix operation with empty matrices
Task Description
When using empty matrices for math operation (multiplication or
inversion), as in the FORECAST formula, we got a traceback and the
error message was not clear for the user. This commits aims to fix
it by checking that the matrices used in theses operations are not
empty and returning an understandable error if it's not the case.
Related Task
closes #7034
Task: 5001658
X-original-commit: 867ce19
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
Signed-off-by: Hendrickx Anthony (anhe) <anhe@odoo.com>1 parent 14a6da6 commit f3f5850
File tree
6 files changed
+157
-25
lines changed- src/functions
- tests/functions
6 files changed
+157
-25
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | 1 | | |
3 | | - | |
4 | 2 | | |
5 | 3 | | |
6 | 4 | | |
| |||
31 | 29 | | |
32 | 30 | | |
33 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
34 | 36 | | |
35 | | - | |
36 | | - | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
117 | 120 | | |
118 | | - | |
| 121 | + | |
119 | 122 | | |
120 | 123 | | |
121 | 124 | | |
| |||
144 | 147 | | |
145 | 148 | | |
146 | 149 | | |
147 | | - | |
| 150 | + | |
148 | 151 | | |
149 | 152 | | |
150 | 153 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
284 | 284 | | |
285 | 285 | | |
286 | 286 | | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
368 | 368 | | |
369 | 369 | | |
370 | 370 | | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
371 | 376 | | |
372 | 377 | | |
373 | 378 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
| |||
524 | 526 | | |
525 | 527 | | |
526 | 528 | | |
| 529 | + | |
| 530 | + | |
527 | 531 | | |
528 | 532 | | |
529 | 533 | | |
| |||
567 | 571 | | |
568 | 572 | | |
569 | 573 | | |
| 574 | + | |
570 | 575 | | |
571 | 576 | | |
572 | 577 | | |
| |||
598 | 603 | | |
599 | 604 | | |
600 | 605 | | |
| 606 | + | |
601 | 607 | | |
602 | 608 | | |
603 | 609 | | |
| |||
680 | 686 | | |
681 | 687 | | |
682 | 688 | | |
| 689 | + | |
683 | 690 | | |
684 | 691 | | |
685 | 692 | | |
| |||
723 | 730 | | |
724 | 731 | | |
725 | 732 | | |
| 733 | + | |
726 | 734 | | |
727 | 735 | | |
728 | 736 | | |
| |||
750 | 758 | | |
751 | 759 | | |
752 | 760 | | |
753 | | - | |
754 | | - | |
755 | | - | |
756 | | - | |
757 | | - | |
| 761 | + | |
758 | 762 | | |
759 | 763 | | |
760 | 764 | | |
| |||
1001 | 1005 | | |
1002 | 1006 | | |
1003 | 1007 | | |
1004 | | - | |
1005 | | - | |
1006 | | - | |
1007 | | - | |
1008 | | - | |
1009 | | - | |
1010 | | - | |
1011 | | - | |
1012 | | - | |
1013 | | - | |
| 1008 | + | |
1014 | 1009 | | |
1015 | 1010 | | |
1016 | 1011 | | |
| |||
1148 | 1143 | | |
1149 | 1144 | | |
1150 | 1145 | | |
| 1146 | + | |
1151 | 1147 | | |
1152 | 1148 | | |
1153 | 1149 | | |
| |||
1188 | 1184 | | |
1189 | 1185 | | |
1190 | 1186 | | |
| 1187 | + | |
1191 | 1188 | | |
1192 | 1189 | | |
1193 | 1190 | | |
| |||
1338 | 1335 | | |
1339 | 1336 | | |
1340 | 1337 | | |
| 1338 | + | |
1341 | 1339 | | |
1342 | 1340 | | |
1343 | 1341 | | |
| |||
1407 | 1405 | | |
1408 | 1406 | | |
1409 | 1407 | | |
| 1408 | + | |
1410 | 1409 | | |
1411 | 1410 | | |
1412 | 1411 | | |
| |||
1556 | 1555 | | |
1557 | 1556 | | |
1558 | 1557 | | |
| 1558 | + | |
1559 | 1559 | | |
1560 | 1560 | | |
1561 | 1561 | | |
| |||
1595 | 1595 | | |
1596 | 1596 | | |
1597 | 1597 | | |
| 1598 | + | |
1598 | 1599 | | |
1599 | 1600 | | |
1600 | 1601 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
822 | 823 | | |
823 | 824 | | |
824 | 825 | | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
825 | 835 | | |
826 | 836 | | |
827 | 837 | | |
| |||
856 | 866 | | |
857 | 867 | | |
858 | 868 | | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
859 | 878 | | |
860 | 879 | | |
861 | 880 | | |
| |||
914 | 933 | | |
915 | 934 | | |
916 | 935 | | |
917 | | - | |
| 936 | + | |
918 | 937 | | |
919 | 938 | | |
920 | 939 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
| 3 | + | |
2 | 4 | | |
3 | 5 | | |
4 | 6 | | |
| |||
3185 | 3187 | | |
3186 | 3188 | | |
3187 | 3189 | | |
| 3190 | + | |
| 3191 | + | |
| 3192 | + | |
| 3193 | + | |
| 3194 | + | |
| 3195 | + | |
| 3196 | + | |
| 3197 | + | |
| 3198 | + | |
| 3199 | + | |
| 3200 | + | |
| 3201 | + | |
| 3202 | + | |
| 3203 | + | |
| 3204 | + | |
| 3205 | + | |
| 3206 | + | |
3188 | 3207 | | |
3189 | 3208 | | |
3190 | 3209 | | |
| |||
3246 | 3265 | | |
3247 | 3266 | | |
3248 | 3267 | | |
| 3268 | + | |
| 3269 | + | |
| 3270 | + | |
| 3271 | + | |
| 3272 | + | |
| 3273 | + | |
| 3274 | + | |
| 3275 | + | |
| 3276 | + | |
| 3277 | + | |
| 3278 | + | |
| 3279 | + | |
| 3280 | + | |
| 3281 | + | |
| 3282 | + | |
| 3283 | + | |
| 3284 | + | |
3249 | 3285 | | |
3250 | 3286 | | |
3251 | 3287 | | |
| |||
3307 | 3343 | | |
3308 | 3344 | | |
3309 | 3345 | | |
| 3346 | + | |
| 3347 | + | |
| 3348 | + | |
| 3349 | + | |
| 3350 | + | |
| 3351 | + | |
| 3352 | + | |
| 3353 | + | |
| 3354 | + | |
| 3355 | + | |
| 3356 | + | |
| 3357 | + | |
| 3358 | + | |
| 3359 | + | |
| 3360 | + | |
| 3361 | + | |
| 3362 | + | |
| 3363 | + | |
3310 | 3364 | | |
3311 | 3365 | | |
3312 | 3366 | | |
| |||
3434 | 3488 | | |
3435 | 3489 | | |
3436 | 3490 | | |
| 3491 | + | |
| 3492 | + | |
| 3493 | + | |
| 3494 | + | |
| 3495 | + | |
| 3496 | + | |
| 3497 | + | |
| 3498 | + | |
| 3499 | + | |
| 3500 | + | |
| 3501 | + | |
| 3502 | + | |
| 3503 | + | |
| 3504 | + | |
| 3505 | + | |
| 3506 | + | |
| 3507 | + | |
3437 | 3508 | | |
3438 | 3509 | | |
3439 | 3510 | | |
| |||
3508 | 3579 | | |
3509 | 3580 | | |
3510 | 3581 | | |
| 3582 | + | |
| 3583 | + | |
| 3584 | + | |
| 3585 | + | |
| 3586 | + | |
| 3587 | + | |
| 3588 | + | |
| 3589 | + | |
| 3590 | + | |
| 3591 | + | |
| 3592 | + | |
| 3593 | + | |
| 3594 | + | |
| 3595 | + | |
| 3596 | + | |
| 3597 | + | |
| 3598 | + | |
| 3599 | + | |
3511 | 3600 | | |
3512 | 3601 | | |
3513 | 3602 | | |
| |||
0 commit comments