~therp-nl/banking-addons/7.0-add_camt_import

« back to all changes in this revision

Viewing changes to account_direct_debit/migrations/7.0.2/pre-migration.py

  • Committer: Holger Brunn
  • Author(s): stefan at therp
  • Date: 2013-08-12 09:21:34 UTC
  • mfrom: (175.4.1 banking-addons-migration70)
  • Revision ID: hbrunn@therp.nl-20130812092134-x51cyubxhswfk510
[FIX] Fixed migration scripts after testing

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
#
23
23
##############################################################################
24
24
 
 
25
import logging
 
26
logger = logging.getLogger()
 
27
 
25
28
def rename_columns(cr, column_spec):
26
29
    """
27
30
    Rename table columns. Taken from OpenUpgrade.
41
44
    if not version:
42
45
        return
43
46
 
44
 
    # workflow state moved to another module
45
 
    cr.execute(
46
 
        """
47
 
        UPDATE ir_model_data 
48
 
        SET module = 'account_banking_payment'
49
 
        WHERE name = 'trans_done_sent'
50
 
        AND module = 'account_direct_debit'
51
 
        """)
52
 
 
53
47
    # rename field debit_move_line_id
54
48
    rename_columns(cr, {
55
49
            'payment_line': [
56
 
                ('debit_move_line_id', 'transit_move_line_id'),
 
50
                ('debit_move_line_id', 'banking_addons_61_debit_move_line_id'),
57
51
                ]})