The column rename from ne to bn requires a simple migration script:
It goes in a subfolder with the version (odooversion.moduleversion) of the migrations folder with pre-* to be run before the module update (as opposed to post-*).
You will need to use and copy the openupgrade column_rename function and call it in a migrate function
# res_partner_attributes_add_BN/migrations/8.0.1.0/pre-migration.py
column_spec = {
'res_partner': [
("ne", "bn"),
],
}
def rename_columns(cr, column_spec):
# Copy from https://github.com/OpenUpgrade/OpenUpgrade/blob/8.0/openerp/openupgrade/openupgrade.py#L179
def migrate(cr, version):
if version is None:
return
rename_columns(cr, column_spec):
Coverage increased (+1.79%) to 57.58% when pulling f42f7f19dfbfb66e94c25f5dac5dec5256840423 on savoirfairelinux:8.0-port-add-BN into a7a9d568b1d1046279c48cd66e1cfac1415f3d1b on OCA:8.0.
Coverage increased (+1.79%) to 57.58% when pulling f42f7f19dfbfb66e94c25f5dac5dec5256840423 on savoirfairelinux:8.0-port-add-BN into a7a9d568b1d1046279c48cd66e1cfac1415f3d1b on OCA:8.0.
Coverage increased (+1.79%) to 57.58% when pulling 658d6c8e160889eaf3b7c2d1a99fba0b13c81df1 on savoirfairelinux:8.0-port-add-BN into a7a9d568b1d1046279c48cd66e1cfac1415f3d1b on OCA:8.0.
Coverage increased (+1.79%) to 57.58% when pulling 658d6c8e160889eaf3b7c2d1a99fba0b13c81df1 on savoirfairelinux:8.0-port-add-BN into a7a9d568b1d1046279c48cd66e1cfac1415f3d1b on OCA:8.0.
The column rename from
ne
tobn
requires a simple migration script:It goes in a subfolder with the version (odooversion.moduleversion) of the
migrations
folder withpre-*
to be run before the module update (as opposed topost-*
).You will need to use and copy the openupgrade
column_rename
function and call it in amigrate
function