[MERGE] Sync with trunk
authorThibault Delavallée <tde@openerp.com>
Thu, 19 Dec 2013 14:40:25 +0000 (15:40 +0100)
committerThibault Delavallée <tde@openerp.com>
Thu, 19 Dec 2013 14:40:25 +0000 (15:40 +0100)
bzr revid: tde@openerp.com-20131219144025-cu9hxr0ctcmajyrr

1  2 
addons/document/document.py
addons/hr_recruitment/hr_recruitment.py
addons/hr_recruitment/hr_recruitment_view.xml

Simple merge
@@@ -172,32 -171,9 +172,32 @@@ class hr_applicant(osv.Model)
                      duration = float(ans.days)
                      res[issue.id][field] = abs(float(duration))
          return res
 +    
 +
 +    def attachment_tree_view(self, cr, uid, ids, context):
 +        domain = ['&', ('res_model', '=', 'hr.applicant'), ('res_id', 'in', ids)]
 +        res_id = ids and ids[0] or False
 +        return {
 +            'name': _('Attachments'),
 +            'domain': domain,
 +            'res_model': 'ir.attachment',
 +            'type': 'ir.actions.act_window',
 +            'view_id': False,
 +            'view_mode': 'tree,form',
 +            'view_type': 'form',
 +            'limit': 80,
 +            'context': "{'default_res_model': '%s','default_res_id': %d}" % (self._name, res_id)
 +        }
 +
 +    def _compute_attachments(self, cr, uid, ids, fields, args, context=None):
 +        res = {}
 +        attachment_pool = self.pool.get('ir.attachment')
 +        for applicant in ids:
 +            res[applicant] = attachment_pool.search_count(cr, uid, [('res_model', '=', 'hr.applicant'), ('res_id', '=', applicant)], context=context)
 +        return res
  
      _columns = {
-         'name': fields.char('Subject', size=128, required=True),
+         'name': fields.char('Subject / Application Name', size=128, required=True),
          'active': fields.boolean('Active', help="If the active field is set to false, it will allow you to hide the case without removing it."),
          'description': fields.text('Description'),
          'email_from': fields.char('Email', size=128, help="These people will receive email."),