[FIX] project,project_issue: missing indexes on stage/state/project_id/user_id

bzr revid: odo@openerp.com-20140402110700-h3ryoroibj1m92ig
This commit is contained in:
Olivier Dony 2014-04-02 13:07:00 +02:00
parent 9a02917bdc
commit 4fe43d9ac6
2 changed files with 7 additions and 7 deletions

View File

@ -766,10 +766,10 @@ class task(base_stage, osv.osv):
'description': fields.text('Description'), 'description': fields.text('Description'),
'priority': fields.selection([('4','Very Low'), ('3','Low'), ('2','Medium'), ('1','Important'), ('0','Very important')], 'Priority', select=True), '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."), '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', track_visibility='onchange', 'stage_id': fields.many2one('project.task.type', 'Stage', track_visibility='onchange', select=True,
domain="['&', ('fold', '=', False), ('project_ids', '=', project_id)]"), domain="['&', ('fold', '=', False), ('project_ids', '=', project_id)]"),
'state': fields.related('stage_id', 'state', type="selection", store=True, 'state': fields.related('stage_id', 'state', type="selection", store=True,
selection=_TASK_STATE, string="Status", readonly=True, selection=_TASK_STATE, string="Status", readonly=True, select=True,
help='The status is set to \'Draft\', when a case is created.\ help='The status is set to \'Draft\', when a case is created.\
If the case is in progress the status is set to \'Open\'.\ If the case is in progress the status is set to \'Open\'.\
When the case is over, the status is set to \'Done\'.\ When the case is over, the status is set to \'Done\'.\
@ -788,7 +788,7 @@ class task(base_stage, osv.osv):
'date_start': fields.datetime('Starting Date',select=True), 'date_start': fields.datetime('Starting Date',select=True),
'date_end': fields.datetime('Ending Date',select=True), 'date_end': fields.datetime('Ending Date',select=True),
'date_deadline': fields.date('Deadline',select=True), 'date_deadline': fields.date('Deadline',select=True),
'project_id': fields.many2one('project.project', 'Project', ondelete='set null', select="1", track_visibility='onchange'), 'project_id': fields.many2one('project.project', 'Project', ondelete='set null', select=True, track_visibility='onchange'),
'parent_ids': fields.many2many('project.task', 'project_task_parent_rel', 'task_id', 'parent_id', 'Parent Tasks'), 'parent_ids': fields.many2many('project.task', 'project_task_parent_rel', 'task_id', 'parent_id', 'Parent Tasks'),
'child_ids': fields.many2many('project.task', 'project_task_parent_rel', 'parent_id', 'task_id', 'Delegated Tasks'), 'child_ids': fields.many2many('project.task', 'project_task_parent_rel', 'parent_id', 'task_id', 'Delegated Tasks'),
'notes': fields.text('Notes'), 'notes': fields.text('Notes'),
@ -814,7 +814,7 @@ class task(base_stage, osv.osv):
'project.task': (lambda self, cr, uid, ids, c={}: ids, ['work_ids', 'remaining_hours', 'planned_hours'], 10), 'project.task': (lambda self, cr, uid, ids, c={}: ids, ['work_ids', 'remaining_hours', 'planned_hours'], 10),
'project.task.work': (_get_task, ['hours'], 10), 'project.task.work': (_get_task, ['hours'], 10),
}), }),
'user_id': fields.many2one('res.users', 'Assigned to', track_visibility='onchange'), 'user_id': fields.many2one('res.users', 'Assigned to', select=True, track_visibility='onchange'),
'delegated_user_id': fields.related('child_ids', 'user_id', type='many2one', relation='res.users', string='Delegated To'), 'delegated_user_id': fields.related('child_ids', 'user_id', type='many2one', relation='res.users', string='Delegated To'),
'partner_id': fields.many2one('res.partner', 'Customer'), 'partner_id': fields.many2one('res.partner', 'Customer'),
'work_ids': fields.one2many('project.task.work', 'task_id', 'Work done'), 'work_ids': fields.one2many('project.task.work', 'task_id', 'Work done'),

View File

@ -259,7 +259,7 @@ class project_issue(base_stage, osv.osv):
'company_id': fields.many2one('res.company', 'Company'), 'company_id': fields.many2one('res.company', 'Company'),
'description': fields.text('Private Note'), 'description': fields.text('Private Note'),
'state': fields.related('stage_id', 'state', type="selection", store=True, 'state': fields.related('stage_id', 'state', type="selection", store=True,
selection=_TASK_STATE, string="Status", readonly=True, selection=_TASK_STATE, string="Status", readonly=True, select=True,
help='The status is set to \'Draft\', when a case is created.\ help='The status is set to \'Draft\', when a case is created.\
If the case is in progress the status is set to \'Open\'.\ If the case is in progress the status is set to \'Open\'.\
When the case is over, the status is set to \'Done\'.\ When the case is over, the status is set to \'Done\'.\
@ -283,9 +283,9 @@ class project_issue(base_stage, osv.osv):
'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority', select=True), 'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority', select=True),
'version_id': fields.many2one('project.issue.version', 'Version'), 'version_id': fields.many2one('project.issue.version', 'Version'),
'stage_id': fields.many2one ('project.task.type', 'Stage', 'stage_id': fields.many2one ('project.task.type', 'Stage',
track_visibility='onchange', track_visibility='onchange', select=True,
domain="['&', ('fold', '=', False), ('project_ids', '=', project_id)]"), domain="['&', ('fold', '=', False), ('project_ids', '=', project_id)]"),
'project_id':fields.many2one('project.project', 'Project', track_visibility='onchange'), 'project_id': fields.many2one('project.project', 'Project', track_visibility='onchange', select=True),
'duration': fields.float('Duration'), 'duration': fields.float('Duration'),
'task_id': fields.many2one('project.task', 'Task', domain="[('project_id','=',project_id)]"), 'task_id': fields.many2one('project.task', 'Task', domain="[('project_id','=',project_id)]"),
'day_open': fields.function(_compute_day, string='Days to Open', \ 'day_open': fields.function(_compute_day, string='Days to Open', \