Daily updates from Odoo
Friday, August 2, 2019
2 changes
New functionality added to Odoo
Repair orders now include tags and responsible users, making it easier to classify work and assign ownership. The Repair app also gains parts filtering plus graph and pivot reporting views, helping teams analyze repair activity more effectively.
Original PR description
Task: https://www.odoo.com/web?#id=1945878&action=327&model=project.task&view_type=form&menu_id=4720 Pad: https://pad.odoo.com/p/r.43251e7b241dfdc3350864396f58708d 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
This update adds a lazy translation option so shared labels and messages can be translated correctly when the user's language is known. It helps ensure multilingual text appears in the right language across affected business areas without requiring duplicated wording.
Original PR description
Introduces the method `_lt`
The translation method is now evaluated lazily.
It allows to declare global variables with translatable content
i.e. this code will now work:
```python
LABEL = _lt("User")
def _compute_label(self):
context = {'lang': self.partner_id.lang}
self.user_label = LABEL
```
Alternative patch for odoo/enterprise#3665
Doing `self.assertEqual(str(language), "Klingon", ...` is needed as comparing `language` with `"Klingon"`, returns an error:
`AssertionError: Klingon != 'Klingon' : The translation should not be applied yet `