You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What about a new migration template that would generate migration script for a given module?
When being in the current module's directory: mrbob bobtemplates.odoo:migration
It would ask for:
new module version
use openupgrade? (yes/no)
pre-migrate? (yes/no)
post-migrate? (yes/no)
And then it would:
generate the migrations/{version_number}/(pre/post)-migrate.py file(s)
import logging and add a default _logger.info() message in the migrate method
if the use of openupgrade is selected:
import openupgrade
add the @openupgrade.migrate(use_env=True) decorator and use the env variable in the migrate method
add openupgradelib to the external dependencies of the manifest
change the version of the module accordingly
If it's relevant, the same could be done for pre/post-init hooks (I can write a separate issue for that).
The text was updated successfully, but these errors were encountered:
What about a new
migration
template that would generate migration script for a given module?When being in the current module's directory:
mrbob bobtemplates.odoo:migration
It would ask for:
openupgrade
? (yes/no)And then it would:
migrations/{version_number}/(pre/post)-migrate.py
file(s)logging
and add a default_logger.info()
message in themigrate
methodopenupgrade
is selected:openupgrade
@openupgrade.migrate(use_env=True)
decorator and use theenv
variable in themigrate
methodopenupgradelib
to the external dependencies of the manifestIf it's relevant, the same could be done for pre/post-init hooks (I can write a separate issue for that).
The text was updated successfully, but these errors were encountered: