diff options
| author | Victor Feyens <vfe@odoo.com> | 2020-10-07 17:21:20 +0000 |
|---|---|---|
| committer | Victor Feyens <vfe@odoo.com> | 2020-10-19 12:46:42 +0000 |
| commit | 679ebc3381179f6b18364c6f2b4d4f7f34274698 (patch) | |
| tree | fff7d43d14bb1b9d5dc295dbb3db4528b22ec659 /addons/web_editor/static/src | |
| parent | d3daa3793b8fbc9308ec0fb8935d6991b834f3a5 (diff) | |
[FIX] sale_coupon: avoid duplicated checks/filters
Avoid filtering/checking the same condition multiple times on the same
records...
This allows to avoid n more fetch of all applicable coupon programs from
the database (because _check_promo_code is called on each program in a loop).
Also apply the date filter directly in SQL:
* The computation of inherited fields (_inherits) by the orm is intrinsically slow.
The fields rule_date_from and rule_date_to checked in the _filter_on_validity_dates
python filter are inherited from sale.coupon.program.rule model.
* Filtering recordsets in SQL is faster.
closes odoo/odoo#60247
X-original-commit: 294628df479fba4db5e7859f1fc2d2b13bae8c6f
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Diffstat (limited to 'addons/web_editor/static/src')
0 files changed, 0 insertions, 0 deletions
