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] base, sale: display monetary t-esc in right lang format #31264

Closed
wants to merge 1 commit into
base: 11.0
from

Conversation

Projects
None yet
4 participants
@kebeclibre
Copy link
Contributor

kebeclibre commented Feb 20, 2019

Print a sale order, whose partner has a different lang than the current user
The SO has to have sections (just for the purpose of entering some code)

Before this commit, the section subtotals were displayed in the format
defined on the lang of the current user

This was because those are t-esc directives displayed with a qqweb widget (monetary)
In that case, there is no record to take the context and the lang from

After this commit, we explicitly pass the option lang to the widget
And the data is displayed with the lang set on the "doc" object of the report

OPW 1939989

Description of the issue/feature this PR addresses:

Current behavior before PR:

Desired behavior after PR is merged:

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

[FIX] base, sale: display monetary t-esc in right lang format
Print a sale order, whose partner has a different lang than the current user
The SO has to have sections (just for the purpose of entering some code)

Before this commit, the section subtotals were displayed in the format
defined on the lang of the current user

This was because those are t-esc directives displayed with a qqweb widget (monetary)
In that case, there is no record to take the context and the lang from

After this commit, we explicitly pass the option lang to the widget
And the data is displayed with the lang set on the "doc" object of the report

OPW 1939989

@kebeclibre kebeclibre requested review from mart-e , Gorash and nim-odoo Feb 20, 2019

@robodoo robodoo added the seen 🙂 label Feb 20, 2019

@nim-odoo
Copy link
Contributor

nim-odoo left a comment

I don't really see the point of the _get_lang method. Moreover:

@@ -324,7 +327,7 @@ def value_to_html(self, value, options):
if options.get('from_currency'):
value = options['from_currency'].compute(value, display_currency)

lang = self.user_lang()
lang = self._get_lang(lang_code=options.get('lang'))

This comment has been minimized.

@nim-odoo

nim-odoo Feb 20, 2019

Contributor

Why not simply options.get('lang') or self.user_lang()?

@C3POdoo C3POdoo added the OE label Feb 20, 2019

@robodoo robodoo added the CI 🤖 label Feb 20, 2019

@kebeclibre

This comment has been minimized.

Copy link
Contributor Author

kebeclibre commented Feb 20, 2019

generic solution at #31291

@kebeclibre kebeclibre closed this Feb 20, 2019

@robodoo robodoo added closed 💔 and removed CI 🤖 labels Feb 20, 2019

@nim-odoo nim-odoo deleted the odoo-dev:11.0-translate-monetary-esc-lpe branch Feb 21, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.