[IMP] crm, project, hr_recruitment: made stages accute on view according to state

bzr revid: cha@tinyerp.com-20120903093127-vao5eoi61is1pqfx
This commit is contained in:
Ajay Chauhan (OpenERP) 2012-09-03 15:01:27 +05:30
parent e3f1c26e6a
commit c895c53341
5 changed files with 5 additions and 5 deletions

View File

@ -213,7 +213,7 @@ class crm_lead(base_stage, osv.osv):
'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority', select=True),
'date_closed': fields.datetime('Closed', readonly=True),
'stage_id': fields.many2one('crm.case.stage', 'Stage',
domain="['&', '|', ('section_ids', '=', section_id), ('case_default', '=', True), '|', ('type', '=', type), ('type', '=', 'both')]"),
domain="['&', '|', ('section_ids', '=', section_id), ('case_default', '=', True), '&', ('fold', '=', False), '|', ('type', '=', type), ('type', '=', 'both')]"),
'user_id': fields.many2one('res.users', 'Salesperson'),
'referred': fields.char('Referred By', size=64),
'date_open': fields.datetime('Opened', readonly=True),

View File

@ -185,7 +185,7 @@ class hr_applicant(base_stage, osv.Model):
'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',
domain="['|', ('department_id', '=', department_id), ('department_id', '=', False)]"),
domain="['&', ('fold', '=', False), '|', ('department_id', '=', department_id), ('department_id', '=', False)]"),
'state': fields.related('stage_id', 'state', type="selection", store=True,
selection=AVAILABLE_STATES, string="State", readonly=True,
help='The state is set to \'Draft\', when a case is created.\

View File

@ -107,7 +107,7 @@
<form string="Jobs - Recruitment Form" version="7.0">
<header>
<button name="case_close_with_emp" string="Hire" type="object"
states="open,pending" class="oe_highlight"/>
states="draft,open,pending" class="oe_highlight"/>
<button name="case_cancel" string="Refuse" type="object"
states="draft,open,pending" class="oe_highlight"/>
<field name="stage_id" widget="statusbar" clickable="True"/>

View File

@ -739,7 +739,7 @@ class task(base_stage, osv.osv):
'priority': fields.selection([('4','Very Low'), ('3','Low'), ('2','Medium'), ('1','Important'), ('0','Very important')], 'Priority', select=True),
'sequence': fields.integer('Sequence', select=True, help="Gives the sequence order when displaying a list of tasks."),
'stage_id': fields.many2one('project.task.type', 'Stage',
domain="['|', ('project_ids', '=', project_id), ('case_default', '=', True)]"),
domain="['&', ('fold', '=', False), '|', ('project_ids', '=', project_id), ('case_default', '=', True)]"),
'state': fields.related('stage_id', 'state', type="selection", store=True,
selection=_TASK_STATE, string="State", readonly=True,
help='The state is set to \'Draft\', when a case is created.\

View File

@ -424,7 +424,7 @@
<button name="%(action_project_task_reevaluate)d" string="Reactivate" type="action"
states="cancelled,done" context="{'button_reactivate':True}"/>
<button name="action_close" string="Done" type="object"
states="draft,open,pending" class="oe_highlight"/>
states="draft,open,pending"/>
<button name="%(action_project_task_delegate)d" string="Delegate" type="action"
states="pending,open,draft" groups="project.group_delegate_task"/>
<button name="do_cancel" string="Cancel" type="object"