OCA / l10n-canada

Odoo modules for Canada
https://community.odoo.com/project/42
GNU Affero General Public License v3.0
8 stars 31 forks source link

Port BN module to v8 #63

Closed Ehtaga closed 9 years ago

bwrsandman commented 9 years ago

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):
coveralls commented 9 years ago

Coverage Status

Coverage increased (+1.79%) to 57.58% when pulling f42f7f19dfbfb66e94c25f5dac5dec5256840423 on savoirfairelinux:8.0-port-add-BN into a7a9d568b1d1046279c48cd66e1cfac1415f3d1b on OCA:8.0.

coveralls commented 9 years ago

Coverage Status

Coverage increased (+1.79%) to 57.58% when pulling f42f7f19dfbfb66e94c25f5dac5dec5256840423 on savoirfairelinux:8.0-port-add-BN into a7a9d568b1d1046279c48cd66e1cfac1415f3d1b on OCA:8.0.

bwrsandman commented 9 years ago

:+1:

coveralls commented 9 years ago

Coverage Status

Coverage increased (+1.79%) to 57.58% when pulling 658d6c8e160889eaf3b7c2d1a99fba0b13c81df1 on savoirfairelinux:8.0-port-add-BN into a7a9d568b1d1046279c48cd66e1cfac1415f3d1b on OCA:8.0.

coveralls commented 9 years ago

Coverage Status

Coverage increased (+1.79%) to 57.58% when pulling 658d6c8e160889eaf3b7c2d1a99fba0b13c81df1 on savoirfairelinux:8.0-port-add-BN into a7a9d568b1d1046279c48cd66e1cfac1415f3d1b on OCA:8.0.

max3903 commented 9 years ago

:+1: