~therp-nl/openupgrade-server/6.1-fix_client_action_table

« back to all changes in this revision

Viewing changes to openerp/osv/orm.py

  • Committer: Holger Brunn
  • Date: 2012-07-11 08:36:51 UTC
  • Revision ID: hbrunn@therp.nl-20120711083651-yv712fo7i7oi07yz
[IMP] add markers for changes in orm done for the openupgrade server

Show diffs side-by-side

added added

removed removed

Lines of Context:
1415
1415
                position = data.get(filename, 0)
1416
1416
 
1417
1417
        while position<len(datas):
 
1418
            #use savepoints for opgenupgrade instead of transactions
1418
1419
            cr.execute('SAVEPOINT process_lines');
1419
1420
            (res, position, warning, res_id, xml_id) = \
1420
1421
                    process_liness(self, datas, [], current_module, self._name, fields_def, position=position)
1452
1453
        lng = context.get('lang', False) or 'en_US'
1453
1454
        trans = self.pool.get('ir.translation')
1454
1455
        error_msgs = []
 
1456
        #use savepoints for opgenupgrade instead of transactions
1455
1457
        cr.execute('SAVEPOINT validate');
1456
1458
        for constraint in self._constraints:
1457
1459
            fun, msg, fields = constraint
2906
2908
                                # add the NOT NULL constraint
2907
2909
                                cr.commit()
2908
2910
                                try:
 
2911
                                    #use savepoints for opgenupgrade instead of transactions
2909
2912
                                    cr.execute('SAVEPOINT add_constraint');
2910
2913
                                    cr.execute('ALTER TABLE "%s" ALTER COLUMN "%s" SET NOT NULL' % (self._table, k), log_exceptions=False)
2911
2914
                                    cr.execute('RELEASE SAVEPOINT add_constraint');
3207
3210
            sql_actions.sort(key=lambda x: x['order'])
3208
3211
            for sql_action in [action for action in sql_actions if action['execute']]:
3209
3212
                try:
 
3213
                    #use savepoints for opgenupgrade instead of transactions
3210
3214
                    cr.execute('SAVEPOINT add_constraint2');
3211
3215
                    cr.execute(sql_action['query'])
3212
3216
                    cr.execute('RELEASE SAVEPOINT add_constraint2');