[IMP]hr_recruitment: Improved a state field based on stage

bzr revid: mma@tinyerp.com-20120406090603-nr79b6vzy8u6mlp9
This commit is contained in:
Mayur Maheshwari (OpenERP)
2012-04-06 14:36:03 +05:30
parent 0634b27f7c
commit d7fef99135
2 changed files with 19 additions and 17 deletions
+7 -6
View File
@@ -69,10 +69,16 @@ class hr_recruitment_stage(osv.osv):
'name': fields.char('Name', size=64, required=True, translate=True),
'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of stages."),
'department_id':fields.many2one('hr.department', 'Specific to a Department', help="Stages of the recruitment process may be different per department. If this stage is common to all departments, keep tempy this field."),
'state': fields.selection(AVAILABLE_STATES, 'State', size=16,
help='The state is set to \'Draft\', when a case is created.\
\nIf the case is in progress the state is set to \'Open\'.\
\nWhen the case is over, the state is set to \'Done\'.\
\nIf the case needs to be reviewed then the state is set to \'Pending\'.'),
'requirements': fields.text('Requirements')
}
_defaults = {
'sequence': 1,
'state': lambda *a: 'draft',
}
hr_recruitment_stage()
@@ -144,11 +150,7 @@ class hr_applicant(crm.crm_case, osv.osv):
'create_date': fields.datetime('Creation Date', readonly=True, select=True),
'write_date': fields.datetime('Update Date', readonly=True),
'stage_id': fields.many2one ('hr.recruitment.stage', 'Stage'),
'state': fields.selection(AVAILABLE_STATES, 'State', size=16, readonly=True,
help='The state is set to \'Draft\', when a case is created.\
\nIf the case is in progress the state is set to \'Open\'.\
\nWhen the case is over, the state is set to \'Done\'.\
\nIf the case needs to be reviewed then the state is set to \'Pending\'.'),
'state': fields.related('stage_id','state', type='char', selection=AVAILABLE_STATES, string="State", store=True, readonly=True),
'company_id': fields.many2one('res.company', 'Company'),
'user_id': fields.many2one('res.users', 'Responsible'),
# Applicant Columns
@@ -169,7 +171,6 @@ class hr_applicant(crm.crm_case, osv.osv):
'partner_mobile': fields.char('Mobile', size=32),
'type_id': fields.many2one('hr.recruitment.degree', 'Degree'),
'department_id': fields.many2one('hr.department', 'Department'),
'state': fields.selection(AVAILABLE_STATES, 'State', size=16, readonly=True),
'survey': fields.related('job_id', 'survey_id', type='many2one', relation='survey', string='Survey'),
'response': fields.integer("Response"),
'reference': fields.char('Refered By', size=128),
+12 -11
View File
@@ -61,7 +61,7 @@
<field name="availability" invisible="1"/>
<field name="department_id" invisible="context.get('invisible_department', True)"/>
<field name="user_id"/>
<field name="state"/>
<field name="state" groups="base.group_no_one"/>
<button name="case_open" string="In Progress" states="draft,pending" type="object" icon="gtk-go-forward"/>
<button name="case_pending" string="Pending" states="draft,open" type="object" icon="gtk-media-pause"/>
</tree>
@@ -130,12 +130,12 @@
<field name="date_closed"/>
<field name="date_open"/>
</group>
<separator colspan="4" string="Status"/>
<group col="8" colspan="4">
<separator colspan="4" string="Status" groups="base.group_no_one"/>
<group col="8" colspan="4" groups="base.group_no_one">
<field name="state" widget="statusbar" statusbar_visible="draft,open,done" statusbar_colors='{"pending":"blue"}'/>
<button name="case_cancel" string="Refuse" states="draft,open,pending" type="object" icon="gtk-cancel"/>
<button name="case_open" string="In Progress" states="draft,pending" type="object" icon="gtk-go-forward"/>
<button name="case_pending" string="Pending" states="open" type="object" icon="gtk-media-pause"/>
<button name="case_cancel" string="Refuse" states="draft,open,pending" type="object" icon="gtk-cancel" />
<button name="case_open" string="In Progress" states="draft,pending" type="object" icon="gtk-go-forward" />
<button name="case_pending" string="Pending" states="open" type="object" icon="gtk-media-pause" />
<button name="%(action_hr_recruitment_hired_employee)d" string="Hire" states="open,pending" type="action" icon="terp-partner"/>
<button name="case_reset" string="Reset to New" states="done,cancel" type="object" icon="gtk-convert"/>
</group>
@@ -180,7 +180,7 @@
<graph string="Cases By Stage and Estimates" type="bar" orientation="vertical">
<field name="job_id"/>
<field name="salary_expected" operator="+"/>
<field name="state" group="True"/>
<field name="state" group="True" groups="base.group_no_one"/>
</graph>
</field>
</record>
@@ -193,15 +193,15 @@
<search string="Search Jobs">
<filter icon="terp-document-new" string="New" name="filter_new"
domain="[('state','=','draft')]"
help="All Initial Jobs"
help="All Initial Jobs" groups="base.group_no_one"
/>
<filter icon="terp-camera_test" string="In Progress" name="filter_inprogress"
domain="[('state','=','open')]"
help="Open Jobs"
help="Open Jobs" groups="base.group_no_one"
/>
<filter icon="terp-gtk-media-pause" string="Pending"
domain="[('state','=','pending')]"
help="Pending Jobs"
help="Pending Jobs" groups="base.group_no_one"
/>
<separator orientation="vertical"/>
<filter icon="terp-gtk-jump-to-ltr" string="Next Actions"
@@ -225,7 +225,7 @@
<separator orientation="vertical"/>
<filter string="Appreciation" icon="terp-face-plain" domain="[]" context="{'group_by':'priority'}"/>
<filter string="Stage" icon="terp-stage" domain="[]" context="{'group_by':'stage_id'}"/>
<filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
<filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}" groups="base.group_no_one"/>
<filter string="Source" icon="terp-face-plain" domain="[]" context="{'group_by':'source_id'}"/>
<separator orientation="vertical" groups="base.group_no_one"/>
<filter string="Creation Date" icon="terp-go-month" domain="[]" context="{'group_by':'create_date'}" groups="base.group_no_one"/>
@@ -394,6 +394,7 @@
<field name="name" select="1"/>
<field name="department_id" groups="base.group_extended"/>
<field name="sequence"/>
<field name="state"/>
</group>
<separator string="Requirements" colspan="4"/>
<field name="requirements" nolabel="1" colspan="4"/>