odoo/odoo#253683
Created by fw-bot
Statuses:
- legal/cla: Contributor License Agreement check
- ci/runbot: Odoo Test Suite
- ci/upgrade_enterprise: Test upgrades for enterprise master
- ci/template: (runtime 1307s)
- ci/style: Optional style check. Ignore it only if strictly necessary.
- ci/security: Required security check. Can only be ignored by security team.
- label
- odoo-dev:saas-19.1-19.0-website-opw-5892402-nle-502125-fw
- head
- 292aec25acb5eea0d5148af959e4f3ffe5ddc277
- merged
- 3 weeks ago by Bugfix, Nicolas Lempereur (nle)
| odoo/odoo | |
|---|---|
| 19.0 | #250611 |
| saas-19.1 | #253683 |
| saas-19.2 | #253888 |
| master | #253964 |
[FIX] website: save partial AI translation success
Scenario:
- be on odoo SaaS instance
- be on non-translated page with enough content to do 4 requests
to /html_editor/generate_text (that are done in chunk of 2000
characters per request currently) - open the editor and use "Translate to {lang}" (ai translation)
Result: you see a message "Connection lost. Trying to reconnect..." and
after waiting 10-20 seconds, no translation are inserted in the page.
In reality the requests after the 3 first ones were cancelled (with
error 429 too many requests) by nginx, and the 3 first ones worked
correctly but their result was not used because of the error of the
other ones.
Fix:
-
decrease the number of concurrent request from 5 to 3 which is the
current default for this route on SaaS -
adapt the code so if there is errors on one request, successfull
requests will still be applied with the text "Translation Error.
{number} text blocks were skipped during translation. Please try
again." for the blocks that were missed.
This way even if there is an error, the translation is not totally
blocked and doesn't need to be restarted from zero (making it impossible
in the original scenario).
Side note: the number of text blocks not translated was a multiplication
of the total number of text blocks by the number of failed response.
This fix adapts it to just the total of words substrating the number of
translation applied.
Forward-Port-Of: #250611