~openerp-commiter/openobject-training/6.1-migration-kbh

« back to all changes in this revision

Viewing changes to training_room/wizard/training_create_session_wizard.py

  • Committer: Khushboo Bhatt (Open ERP)
  • Date: 2012-07-11 04:51:26 UTC
  • mfrom: (2671.2.10 6.1)
  • Revision ID: kbh@tinyerp.com-20120711045126-x3ghm5dqcuhdgd55
[MERGE]merge with project branch

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
    def _default_get_location(self, cr, uid, context=None, field='location_id'):
36
36
        if context is None:
37
37
            context= {}
38
 
        session_pool = self.pool.get('training.session')
39
38
        active_id = context.get('active_id', False)
40
 
        vals = session_pool.on_change_offer(cr, uid, None, active_id)
41
 
        return vals.get('value',{}).get(field,False)
 
39
        if not active_id:
 
40
            return False
 
41
        vals = self.pool.get('training.session').on_change_offer(cr, uid, None, active_id, context=context)
 
42
        return vals.get('value',{}).get(field, False)
42
43
 
43
44
    def _default_get_delivery_location(self, cr, uid, context=None):
44
45
        return self._default_get_location(cr, uid, context=context, field='delivery_location_id')