diff options
| author | Martin Trigaux <mat@odoo.com> | 2019-07-25 09:52:25 +0000 |
|---|---|---|
| committer | Martin Trigaux <mat@odoo.com> | 2019-08-01 09:06:25 +0000 |
| commit | 18d9c2cab2426d337e53b9c1e10a3aa103649936 (patch) | |
| tree | 8db0dcf10d078ccf76966abe8e44c1d3d0ea8b3a /odoo/addons/test_new_api/tests/test_new_fields.py | |
| parent | 66ef641f33d4173fc55fe1016a292a2ebf55bdd3 (diff) | |
[FIX] base: single lang behaviour
If a db is in single lang (en_US or not) but still has translations, the
translation should be updated in addition to updating the referenced record
Add tests to formalise the expected behaviour:
If one language only (en_US or not), when writing on a translatable field:
- record field should updated
- value of potential existing en_US translation should be updated
- src of potential existing translations should be updated
- no new translation should be created
If en_US and fr_FR, when writing on a translatable field in en_US:
- record field should updated
- value of potential existing en_US translation should be updated
- src of potential existing translations should be updated
- new en_US translation should be created if was not present
If en_US and fr_FR, when writing on a translatable field in fr_FR:
- record field should not be updated
- value of potential existing fr_FR translation should be updated
- src of potential existing translations should not be updated
- new fr_FR translation should be created if was not present
Adapt test_new_api test
get_installed is ormcached, just putting active = True is not enough
Diffstat (limited to 'odoo/addons/test_new_api/tests/test_new_fields.py')
| -rw-r--r-- | odoo/addons/test_new_api/tests/test_new_fields.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/odoo/addons/test_new_api/tests/test_new_fields.py b/odoo/addons/test_new_api/tests/test_new_fields.py index b8f254e512f..d372f6f23ae 100644 --- a/odoo/addons/test_new_api/tests/test_new_fields.py +++ b/odoo/addons/test_new_api/tests/test_new_fields.py @@ -1230,8 +1230,7 @@ class TestFields(common.TransactionCase): email = self.env.ref('test_new_api.emailmessage_0_0') self.assertEqual(email.message, message) - french = self.env['res.lang']._lang_get('fr_FR') - french.active = True + self.env['res.lang'].load_lang('fr_FR') def count(msg): # return the number of translations of msg.label |
