From 01715de04a5b4f92dab3d09cc4240dd4094a2ebf Mon Sep 17 00:00:00 2001 From: luvi Date: Wed, 5 Apr 2023 06:30:35 +0000 Subject: [PATCH] [IMP] base_import: improve date(time) formatting options This commit improves the suggestions displayed to the user when editing the date or datetime options in the sidebar of the Import action. A tooltip is also displayed next to each label, to let the user know how to format properly the date if he wants to write a custom one to match his own needs. Since commit [1], a legacy utils was imported to convert a moment format to strftime. Since this file was legacy, it was needed to remove its import from the import action and replace it with a newer utility function. Because this function was not imported elsewhere, it could be removed completely. In dates.js, a new function allow a user to write a date format in a human readable format, while converting it to a valid Python strftime format, to send back to the server the right date. A test has been added for this improvement. [1]: 2361f021c38550d9c488e073801a004ad7ccbffc task-3248787 closes odoo/odoo#117750 Signed-off-by: Aaron Bohy (aab) --- .../import_data_sidepanel.xml | 7 ++ addons/base_import/static/src/import_model.js | 113 ++++++++++++++---- .../static/tests/import_action_tests.js | 108 ++++++++++++----- addons/web/static/src/legacy/js/core/time.js | 14 --- 4 files changed, 176 insertions(+), 66 deletions(-) diff --git a/addons/base_import/static/src/import_data_sidepanel/import_data_sidepanel.xml b/addons/base_import/static/src/import_data_sidepanel/import_data_sidepanel.xml index addd92a4df2..de0337526a0 100644 --- a/addons/base_import/static/src/import_data_sidepanel/import_data_sidepanel.xml +++ b/addons/base_import/static/src/import_data_sidepanel/import_data_sidepanel.xml @@ -32,14 +32,21 @@
+ + +