[MIG] contract: Migration to 12.0

This commit is contained in:
sbejaoui
2018-10-25 15:47:09 +02:00
committed by Pedro M. Baeza
parent e8fbf1c17f
commit 134a3dd232
11 changed files with 206 additions and 215 deletions

View File

@@ -1,18 +0,0 @@
# -*- coding: utf-8 -*-
# Copyright 2015-2017 Tecnativa - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
def migrate(cr, version):
"""Rename column for specific price for keeping backwards compatibility."""
if not version:
return
cr.execute("""SELECT column_name
FROM information_schema.columns
WHERE table_name='account_analytic_invoice_line' AND
column_name='price_unit'""")
if cr.fetchone():
cr.execute(
"ALTER TABLE account_analytic_invoice_line "
"RENAME price_unit TO specific_price"
)