Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[13.0] list view color in Arabic Language #57934

Open
abdallamohamedcore opened this issue Sep 17, 2020 · 2 comments
Open

[13.0] list view color in Arabic Language #57934

abdallamohamedcore opened this issue Sep 17, 2020 · 2 comments
Labels

Comments

@abdallamohamedcore
Copy link

Impacted versions:
13.0
Steps to reproduce:

  • Go to any list view has decoration as example "Pipeline"
  • Records appear correct color decoration
  • Switch to the Arabic language
  • Open the same screen

Current behavior:

  • Records do not appear as same decoration in the English version

Video/Screenshot link (optional):

  • The screen in English:
    image

  • The screen in Arabic:
    image

@pedrobaeza pedrobaeza added the Internationalization about translations label Sep 17, 2020
@pedrobaeza
Copy link
Collaborator

@mart-e not sure if you are the proper to check this.

@mart-e
Copy link
Contributor

mart-e commented Sep 17, 2020

Oh that's a fun one.
The line is in red thanks to the expression

decoration-danger="activity_date_deadline and (activity_date_deadline < current_date)"

When evaluating the condition in Arabic, you get something like activity_date_deadline = "2020-09-17" but current_date = "٢٠٢٠-٠٩-١٧"
current_date is a localised moment() date.

Possible Patch ?
diff --git a/addons/web/static/src/js/views/basic/basic_model.js b/addons/web/static/src/js/views/basic/basic_model.js
index 7c449b43ce3..e38a5eda708 100644
--- a/addons/web/static/src/js/views/basic/basic_model.js
+++ b/addons/web/static/src/js/views/basic/basic_model.js
@@ -3545,7 +3545,7 @@ var BasicModel = AbstractModel.extend({
             active_id: evalContext.id || false,
             active_ids: evalContext.id ? [evalContext.id] : [],
             active_model: element.model,
-            current_date: moment().format('YYYY-MM-DD'),
+            current_date: moment().locale("en").format('YYYY-MM-DD'),
             id: evalContext.id || false,
             current_company_id: current_company,
         }, session.user_context, element.context, evalContext);

@aab-odoo maybe ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants