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

[FIX] web: html_frame field and lang vs onchange #15583

Merged

Conversation

nle-odoo
Copy link
Contributor

In mass mailing there is several possibilities of states when rendering
the widget with a possibly new value:

  1. we are not in edition
    a. we are in same language than user language => the editor content
    can be updated
    b. we are in a different language => the content cannot be updated

  2. we are in edition
    a. we are editing translation : the editor content cannot be updated
    b. we are not editing translation (editor language == en_US)
    i. we are requesting editor update (by having magic value
    on_change_model_and_list) => the editor can be updated
    ii. we are in same language than user language => the editor content
    can be updated
    iii. we are in a different language => the editor content cannot be
    updated

In summary:

  • if language is the same than the user, we can update the value
  • if value is magic on_change_model_and_list and we are not translating,
    we can update the editor

Before this commit, this worked as expected but for 2.a.ii. which if the
user language was not en_US would for example prevent editor updating.

closes #15414
opw-708032

inspired by a27e24c

note: the fix is a fix for 8.0 and saas-6.

@nle-odoo nle-odoo assigned nle-odoo and unassigned nle-odoo Feb 21, 2017
@nle-odoo nle-odoo added the OE the report is linked to a support ticket (opw-...) label Feb 21, 2017
@yajo
Copy link
Contributor

yajo commented Feb 22, 2017

No runbot here?

@nle-odoo
Copy link
Contributor Author

I guess the push needs to be done after the PR is opened to have runbot notification here

The runbot is there: 9.0-mass-mailing-lang-template-update-nle@runbot

if (this.$iframe.attr('src').match(/[?&]edit_translations=1/)) {
return;
}
// ONLY HAVE THIS IN 8.0 AND SAAS-6
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you missed the version. 8.0 is a complete mess, but this issue happened in 9.0+

Copy link
Contributor Author

@nle-odoo nle-odoo Feb 22, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes till 10.0 (in which the system is completely changed)

@yajo
Copy link
Contributor

yajo commented Feb 22, 2017

Thanks, I tested runbot now. Answering to #15414 (comment)...

it is not possible to edit translation of mail.template in the mass mailing module: this is not changed by my patch, and without my patch when we were editing a translation we saw english, with my patch we see spanish (but still can't translate)

OK, so I get the idea is to have a limited version of mail templates for mass mailings that simply avoids these problems. However, if we really want to not look buggy to the user, I think we should remove the language dropdown. Displaying it to the user but not letting him translate can be easily perceived as a bug:

captura de pantalla de 2017-02-22 11-03-09

So, IMHO it's better to just drop the language selector from that view if possible, and force it to display always only the English version. User will not see it, and he will not perceive the bug.

OTOH, following steps from #15414 (comment), the bug itself is certainly fixed.

Since fixing this revealed many problems on multi-language templates, I'm going to open an issue when we finish this patch, summarizing all problems; to have at least a meeting point on this problem and be able to fix it.

@nle-odoo nle-odoo force-pushed the 9.0-mass-mailing-lang-template-update-nle branch from 3626db7 to 40175a9 Compare February 22, 2017 10:15
@nle-odoo nle-odoo force-pushed the 9.0-mass-mailing-lang-template-update-nle branch from 40175a9 to 3e245bb Compare February 23, 2017 15:39
In mass mailing there is several possibilities of states when rendering
the widget with a possibly new value:

1. we are not in edition
  a. we are in same language than user language => the editor content
     can be updated
  b. we are in a different language => the content cannot be updated

2. we are in edition
  a. we are editing translation : the editor content cannot be updated
  b. we are not editing translation (editor language == en_US)
    i.   we are requesting editor update (by having magic value
         `on_change_model_and_list`) => the editor can be updated
    ii.  we are in same language than user language => the editor content
         can be updated
    iii. we are in a different language => the editor content cannot be
         updated

In summary:

- if language is the same than the user, we can update the value
- if value is magic `on_change_model_and_list` and we are not translating,
  we can update the editor

Before this commit, this worked as expected but for 2.a.ii. which if the
user language was not en_US would for example prevent editor updating.

closes odoo#15583
closes odoo#15414
opw-708032

inspired by a27e24c

note: the fix is a fix for 9.0 and saas-11 only.
@nle-odoo nle-odoo force-pushed the 9.0-mass-mailing-lang-template-update-nle branch from 3e245bb to 65c1926 Compare February 23, 2017 15:53
@nle-odoo nle-odoo merged commit 65c1926 into odoo:9.0 Feb 23, 2017
@nle-odoo nle-odoo deleted the 9.0-mass-mailing-lang-template-update-nle branch February 23, 2017 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OE the report is linked to a support ticket (opw-...)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants