~andorrax/school-base-openerp-module/xavi

« back to all changes in this revision

Viewing changes to contact_annotation/contact_annotation.py

  • Committer: Pere Erro
  • Date: 2012-09-11 10:25:55 UTC
  • Revision ID: pereerro@terra.es-20120911102555-ub0y5jq7p9te97ij
[FIX] Bug #1048613 fixed
[IMP] New wizard to tutorize students

Show diffs side-by-side

added added

removed removed

Lines of Context:
369
369
                args3 += [item]
370
370
        return args3
371
371
        
 
372
    def _get_exceeds_range(self, cr, uid, ids, field_name, arg, context=None):
 
373
        if not context:
 
374
            context = {}
 
375
        ret = {}
 
376
        for item in self.browse(cr, uid, ids, context=context):
 
377
            ret[item.id] = False
 
378
            if context.get('range_from'):
 
379
                if item.valid_from < context.get('range_from'):
 
380
                    ret[item.id] = True
 
381
            if context.get('range_to'):
 
382
                if item.valid_to > context.get('range_to'):
 
383
                    ret[item.id] = True
 
384
        return ret
 
385
                    
372
386
    _columns = {
373
387
        'user_id': fields.many2one('res.users', 'Responsible'),
374
388
        'partner_id': fields.related('contact_id','job_ids','address_id','partner_id',type='many2one',\
387
401
                                        method=True,
388
402
                                        type='date',
389
403
                                        string='Search date',),
 
404
        'exceeds_range' : fields.function(_get_exceeds_range, type='boolean', method=True, string='Exceeds range',),
390
405
    }
391
406
 
392
407
    _order="creation_date desc"