-
- Downloads
[REF] base_vat: Speed-up check_vat if there is not vat
The following line of code:
self.env.ref("base.europe").with_context(lang="fr_CA").country_ids
It is executing the following query:
SELECT res_country_res_country_group_rel.res_country_group_id, res_country_res_country_group_rel.res_country_id FROM res_country_res_country_group_rel, "res_country" LEFT JOIN "ir_translation" AS "res_country__name" ON ("res_country"."id" = "res_country__name"."res_id" AND "res_country__name"."type" = 'model' AND "res_country__name"."name" = 'res.country,name' AND "res_country__name"."lang" = 'fr_CA' AND "res_country__name"."value" != '')
WHERE 1=1 AND res_country_res_country_group_rel.res_country_group_id IN (1) AND res_country_res_country_group_rel.res_country_id = res_country.id
ORDER BY COALESCE("res_country__name"."value", "res_country"."name")
OFFSET 0
With duration: 138.119ms
But it is not needed to spend processing to compute it if it even will not be used if the `vat` is empty
If your website checkout process is creating almost the partners without `vat`
it could have a better performance
closes odoo/odoo#85064
Signed-off-by:
Olivier Colson <oco@odoo.com>
Please register or sign in to comment