[ADD] Additions to the base migration#2210
Conversation
|
Hi, @StefanRijnhart . _field_renames = [
('ir.server.object.lines', 'ir_server_object_lines', 'type', 'evaluation_type'),
]
openupgrade.rename_fields(env, _field_renames)
=======================================================================
base / ir.server.object.lines / evaluation_type (selection) : NEW required, selection_keys: ['equation', 'reference', 'value'], req_default: function, hasdefault
base / ir.server.object.lines / type (selection) : DEL required, selection_keys: ['equation', 'reference', 'value'], req_default: function
Please add it in your one. def fix_binding_fields(env):
"""
Adapt binding_type and binding_view_types fields values.
Useful for manually created actions.
"""
model_name_lists = [
'ir.actions.act_url',
'ir.actions.act_window',
'ir.actions.act_window_close',
'ir.actions.actions',
'ir.actions.client',
'ir.actions.report',
'ir.actions.server',
]
for model_name in model_name_lists:
records = env[model_name].search([('binding_type', '=', 'action_form_only')])
vals = {
'binding_type': 'action',
'binding_view_types': "'form'",
}
records.write(vals)
|
70242e7 to
de9c107
Compare
|
Field renamed, thanks. I don't see action_form_only used anywhere in Odoo 12. What should it have been used for? |
|
Ah, I see someting in convert.py. Will have a look |
de9c107 to
a2dfd79
Compare
|
'action_form_only' now migrated correctly. Odoo happens to use table inheritance here (and only here, I believe), see https://github.com/odoo/odoo/blob/13.0/odoo/addons/base/data/base_data.sql#L9-L13. Therefore, we just have to adjust a single table. Thanks, that was a good catch! |
a2dfd79 to
6489fcd
Compare
There was a problem hiding this comment.
I think better use openupgrade.rename_fields than openupgrade.rename_columns in order to keep translation
There was a problem hiding this comment.
Agreed! Code adapted. I also removed the use_env=True argument to the migrate decorator as it has been the default for some time now.
6489fcd to
c5834a9
Compare
c5834a9 to
efe3464
Compare
kos94ok-3D
left a comment
There was a problem hiding this comment.
Code review and functionality test.
Thank you for a great job.
|
Thank you for the review! |
legalsylvain
left a comment
There was a problem hiding this comment.
LGTM. Thanks. Code review. No test.
|
This PR has the |
|
/ocabot merge |
|
Hey, thanks for contributing! Proceeding to merge this for you. |
|
Congratulations, your PR was merged at 91593a5. Thanks a lot for contributing to OCA. ❤️ |
No description provided.