~school-dev-team/school-base-openerp-module/school-ampa-openerp-module

« back to all changes in this revision

Viewing changes to oerp_modules/training/migrations/0.4/pre-30-migrate_participation_stakholder_state.py

  • Committer: pereerro
  • Date: 2013-11-30 20:34:17 UTC
  • Revision ID: pereerro-20131130203417-whwzik8hkmm6j89g
[REF] Begining of integration with school and training.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
__name__ = "Update state of requests and participations"
 
2
 
 
3
def migrate(cr, v):
 
4
    for old, new in [('confirmed', 'accepted'), ('undermined', 'refused'), ('pending', 'requested')]:
 
5
        cr.execute('UPDATE training_participation_stakeholder_request SET state=%s WHERE state=%s', (new, old))
 
6
        
 
7
    for old, new in [('confirmed', 'accepted'), ('undermined', 'refused'), ('requested', 'draft')]:
 
8
        cr.execute('UPDATE training_participation_stakeholder SET state=%s WHERE state=%s', (new, old))