[IMP]Add filter on Refused stage and group by on previous stage.

bzr revid: bth@tinyerp.com-20130509061412-v4mo1ipaedcm56rk
This commit is contained in:
bth-openerp 2013-05-09 11:44:12 +05:30
parent 389f491114
commit 6850809fab
2 changed files with 11 additions and 1 deletions

View File

@ -236,6 +236,7 @@ class hr_applicant(base_stage, osv.Model):
'color': fields.integer('Color Index'),
'emp_id': fields.many2one('hr.employee', 'employee'),
'user_email': fields.related('user_id', 'email', type='char', string='User Email', readonly=True),
'prev_stage': fields.char('Previous Stage',size=32),
}
_defaults = {
@ -251,7 +252,13 @@ class hr_applicant(base_stage, osv.Model):
_group_by_full = {
'stage_id': _read_group_stage_ids
}
def write(self, cr, uid, ids, vals, context=None):
for data in self.browse(cr, uid, ids, context=context):
if vals.get('stage_id'):
vals['prev_stage'] = data.stage_id.name
return super(hr_applicant, self).write(cr, uid, ids, vals, context=context)
def onchange_job(self, cr, uid, ids, job, context=None):
result = {}

View File

@ -41,6 +41,7 @@
<field name="arch" type="xml">
<tree string="Applicants" fonts="bold:message_unread==True" colors="grey:state in ('cancel','done');blue:state=='pending'">
<field name="message_unread" invisible="1"/>
<field name="prev_stage" invisible="1"/>
<field name="create_date"/>
<field name="name" string="Subject"/>
<field name="partner_name"/>
@ -186,11 +187,13 @@
<separator/>
<filter string="Next Actions" context="{'invisible_next_action':False, 'invisible_next_date':False}"
domain="[('date_action','&lt;&gt;',False)]" help="Filter and view on next actions and date"/>
<filter string="Refused" help="Refused Stage" domain="[('state','=','cancel')]"/>
<field name="job_id"/>
<field name="user_id"/>
<separator/>
<field name="categ_ids"/>
<group expand="0" string="Group By...">
<filter string="Previous Stage" context="{'group_by':'prev_stage'}"/>
<filter string="Responsible" domain="[]" context="{'group_by':'user_id'}"/>
<filter string="Department" domain="[]" context="{'group_by':'department_id'}"/>
<filter string="Job" domain="[]" context="{'group_by':'job_id'}"/>