mirror of
https://github.com/OCA/account-financial-tools.git
synced 2025-02-02 12:47:26 +02:00
[FIX] account_invoice_currency: Columns already exists on migration
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2016 Antonio Espinosa <antonio.espinosa@tecnativa.com>
|
||||
# Copyright 2017 Tecnativa - Pedro M. Baeza
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from openupgradelib import openupgrade
|
||||
@@ -7,17 +8,13 @@ from openupgradelib import openupgrade
|
||||
column_renames = {
|
||||
'account_invoice': [
|
||||
('cc_amount_tax', 'amount_tax_signed'),
|
||||
],
|
||||
}
|
||||
|
||||
column_copies = {
|
||||
'account_invoice': [
|
||||
('cc_amount_untaxed', 'amount_untaxed_signed', None),
|
||||
('cc_amount_total', 'amount_total_company_signed', None),
|
||||
# These columns already exists in vanilla Odoo, but we preserve them
|
||||
# for checks and other uses
|
||||
('cc_amount_untaxed', None),
|
||||
('cc_amount_total', None),
|
||||
],
|
||||
}
|
||||
|
||||
|
||||
def migrate(cr, version):
|
||||
openupgrade.rename_columns(cr, column_renames)
|
||||
openupgrade.copy_columns(cr, column_copies)
|
||||
|
||||
Reference in New Issue
Block a user