diff options
| author | Martin Trigaux <mat@odoo.com> | 2019-01-25 15:04:42 +0000 |
|---|---|---|
| committer | Martin Trigaux <mat@odoo.com> | 2019-08-19 11:44:34 +0000 |
| commit | 7593b887dff4fcd474ca72aead6825481b419d86 (patch) | |
| tree | 28c5445d1440701de5c7534e1d8accef222798d8 /odoo/tools | |
| parent | a248171d96de3ad6d8e22c855886dfae61e145e2 (diff) | |
[REF] fields: use ir.model.fields.selection
The selection values of a selection field are now stored in database in the
model ir.model.fields.selection
This will allow to have a modular approche on selections and each selection
is now linked to the module that declared it.
Previously to this change, the selections were linked to the field, meaning
uninstalling a module had no impact on the selections stored on database.
With this change, the selections will now be translated in the correct module
(having an external id) and the records having a used selection will now be
reset to null.
closes odoo/odoo#30228
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Co-authored-by: Raphaƫl Collet <rco@odoo.com>
Diffstat (limited to 'odoo/tools')
| -rw-r--r-- | odoo/tools/translate.py | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/odoo/tools/translate.py b/odoo/tools/translate.py index ae36cc3a2cf..4d7392bd25f 100644 --- a/odoo/tools/translate.py +++ b/odoo/tools/translate.py @@ -639,17 +639,7 @@ class PoFileReader: match = re.match(r'(selection):([\w.]+),([\w]+)', occurrence) if match: - type, model_name, field_name = match.groups() - yield { - 'type': type, - 'model': model_name, - 'name': model_name+','+field_name, - 'src': source, - 'value': translation, - 'comments': comments, - 'res_id': int(line_number), - 'module': module, - } + _logger.info("Skipped deprecated occurrence %s", occurrence) continue match = re.match(r'(sql_constraint|constraint):([\w.]+)', occurrence) @@ -944,11 +934,6 @@ def trans_generate(lang, modules, cr): continue field = field_model._fields[field_name] - if isinstance(getattr(field, 'selection', None), (list, tuple)): - name = "%s,%s" % (record.model, field_name) - for dummy, val in field.selection: - push_translation(module, 'selection', name, 0, val) - for field_name, field in record._fields.items(): if field.translate: name = model + "," + field_name |
