diff options
| author | Raphael Collet <rco@odoo.com> | 2020-05-13 14:06:28 +0000 |
|---|---|---|
| committer | Raphael Collet <rco@odoo.com> | 2020-05-14 08:41:44 +0000 |
| commit | 8d99fd9448c53746a17d2be1b81e76a0539a9534 (patch) | |
| tree | 62813696b2d9ba0f402195576f0fcccb88d8e458 /odoo/fields.py | |
| parent | ac9fb3b120b37d27e8bb2db4188decffa23540b9 (diff) | |
[FIX] core: selection override with str or callable
If the original field is defined with a selection list, overrides with
method or methods names fall back on the list.
closes odoo/odoo#51232
X-original-commit: 272ba8d2238d1d1b87f47b114b55e6eed25314a8
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Diffstat (limited to 'odoo/fields.py')
| -rw-r--r-- | odoo/fields.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/odoo/fields.py b/odoo/fields.py index 89064379bcb..23d9a8c4a58 100644 --- a/odoo/fields.py +++ b/odoo/fields.py @@ -2174,9 +2174,11 @@ class Selection(Field): if values is not None and values != [kv[0] for kv in selection]: _logger.warning("%s: selection=%r overrides existing selection; use selection_add instead", self, selection) values = [kv[0] for kv in selection] - labels.update(selection) + labels = dict(selection) self.ondelete = {} else: + values = None + labels = {} self.selection = selection self.ondelete = None |
