~vauxoo/addons-vauxoo/7.0-user_story_fix1-kty

« back to all changes in this revision

Viewing changes to openacademy/openacademy.py

  • Committer: nhomar at vauxoo
  • Date: 2011-09-26 03:07:44 UTC
  • Revision ID: nhomar@vauxoo.com-20110926030744-wl67urbutgrprcf9
[FIX] SOme useless code

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
        'session_ids':fields.one2many('openacademy.session', 'course_id', 'Sessions', required=False),
20
20
 
21
21
    }
22
 
    
23
 
    
24
 
#    def create(self, cr, user, vals, context={}):
25
 
#        res_id = super(Course, self).create(cr, user, vals, context)
26
 
#        obj_partner=self.pool.get('res.partner')
27
 
#        p_ids = obj_partner.search(cr,user,['|',
28
 
#                       ('is_instructor','=',True),'&',
29
 
#                       ('name','like','p'),
30
 
#                       ('name','like','a')],
31
 
#                       context=context, order='name')
32
 
#        for o in obj_partner.browse(cr, user, p_ids, context=context):
33
 
#            print o.name
34
 
#        return res_id
35
 
#    def write(self, cr, user, ids, vals, context=None):
36
 
#        print "SELF ES : %s" % self
37
 
#        print "CR ES : %s" % cr
38
 
#        print "USER ES : %s" % user
39
 
#        print "VALS ES : %s" % vals
40
 
#        print "CONTEXT ES : %s" % context
41
 
#        print "IDS ES : %s" % ids
42
 
#        res = super(Course, self).write(cr, user, ids, vals, context)
43
 
#        print "RES ES : %s" % res
44
 
#        return res
45
 
 
46
 
    
 
22
 
 
23
 
47
24
    def _check_description(self, cr, user, ids):
48
25
        for s in self.browse(cr,user,ids):
49
26
            if s.description==s.name:
68
45
            new_name='%s (%s)' % (new_name,len(list)+1)
69
46
        defaults['name']=new_name
70
47
        return super(Course,self).copy(cr,uid,id,defaults,context=context)
71
 
 
72
 
 
73
48
Course()
74
49
 
75
50
class Session(osv.osv):
82
57
 
83
58
 
84
59
    def _get_remaining_seats_percent(self,seats,attendee_list):
85
 
        print "attendee_list %s" % attendee_list
86
60
        return seats and ((100.0 * (seats - len(attendee_list)))/ seats) or 0
87
61
 
88
62
    def _get_attendee_count(self, cr, uid, ids, name, args, context=None):