Skip to content

Commit b3823b0

Browse files
committed
[FIX] util/fields : Addition of rename field name into __renamed_fields
If the dictionary for model is not initiated the we do not get name of field being renamed in the "__renamed_fields" variable this commit aims add the name of renamed field in the variable. Part of odoo/upgrade#5202 Signed-off-by: Christophe Simonis (chs) <[email protected]>
1 parent b5ec562 commit b3823b0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/util/fields.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -335,9 +335,9 @@ def move_field_to_module(cr, model, fieldname, old_module, new_module, skip_inhe
335335

336336
def rename_field(cr, model, old, new, update_references=True, domain_adapter=None, skip_inherit=()):
337337
_validate_model(model)
338-
rf = ENVIRON["__renamed_fields"].get(model)
339-
if rf:
340-
rf[new] = rf.pop(old, old)
338+
339+
rf = ENVIRON["__renamed_fields"][model]
340+
rf[new] = rf.pop(old, old)
341341

342342
try:
343343
with savepoint(cr):

0 commit comments

Comments
 (0)