From 4caa9596bcc6bfe3494de451f8c988c23ea6efcf Mon Sep 17 00:00:00 2001 From: Lucas Perais Date: Fri, 5 Aug 2022 13:08:31 +0000 Subject: [PATCH] [FIX] web: ask to save new record before translating Have a translatable field in a form view. Create a new record with that form view. Click on the button to open translations for that field. Before this commit, the record was not saved before opening the translation dialog, hence changing the translations could not work properly. After this commit, this feature is back, and we ask to save a new record before opening the translation dialog. closes odoo/odoo#97608 Signed-off-by: Lucas Perais (lpe) --- addons/web/static/src/legacy/legacy_fields.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/addons/web/static/src/legacy/legacy_fields.js b/addons/web/static/src/legacy/legacy_fields.js index 528886f383e..e67dfb2ff64 100644 --- a/addons/web/static/src/legacy/legacy_fields.js +++ b/addons/web/static/src/legacy/legacy_fields.js @@ -171,6 +171,13 @@ class FieldAdapter extends ComponentAdapter { } } else if (evType === "history_back") { return this.wowlEnv.config.historyBack(); + } else if (evType === "translate") { + const { fieldParams, record, update } = this.props; + return this.translationDialog({ + fieldName: fieldParams.name, + record, + updateField: update, + }); } super._trigger_up(...arguments); }