[IMP] base: better default for translation overwrite

FP request: hide the field from the view as too technical
MAT analysis: it should be true by default as most expected behaviour
(it was the reason why it was displayed in the first place)

closes odoo/odoo#35679

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
This commit is contained in:
Martin Trigaux
2019-08-13 14:21:00 +00:00
parent caa43300f2
commit 43d355c208
3 changed files with 3 additions and 1 deletions
@@ -22,6 +22,7 @@ class BaseLanguageImport(models.TransientModel):
data = fields.Binary('File', required=True, attachment=False)
filename = fields.Char('File Name', required=True)
overwrite = fields.Boolean('Overwrite Existing Terms',
default=True,
help="If you enable this option, existing translations (including custom ones) "
"will be overwritten and replaced by those in this file")
@@ -12,7 +12,7 @@
<field name="code" string="Code" placeholder="e.g. en_US"/>
<field name="data" filename="filename"/>
<field name="filename" invisible="1"/>
<field name="overwrite"/>
<field name="overwrite" groups="base.group_no_one"/>
</group>
<footer>
<button name="import_lang" string="_Import" type="object" class="btn-primary"/>
@@ -266,6 +266,7 @@ class TestTranslationFlow(common.TransactionCase):
'code': 'fr_FR',
'data': export.data,
'filename': export.name,
'overwrite': False,
})
with mute_logger('odoo.addons.base.models.res_lang'):
import_fr.with_context(create_empty_translation=True).import_lang()