[Merge]merge mistakes
bzr revid: dle@openerp.com-20121129143607-lwzsfxv3rsu2eojc
This commit is contained in:
commit
e08d02dc2b
|
@ -49,11 +49,17 @@ class project_task_type(osv.osv):
|
|||
'fold': fields.boolean('Hide in views if empty',
|
||||
help="This stage is not visible, for example in status bar or kanban view, when there are no records in that stage to display."),
|
||||
}
|
||||
def _get_default_project_id(self, cr, uid, ctx={}):
|
||||
proj = ctx.get('default_project_id', False)
|
||||
if type(proj) is int:
|
||||
return [proj]
|
||||
return proj
|
||||
_defaults = {
|
||||
'sequence': 1,
|
||||
'state': 'open',
|
||||
'fold': False,
|
||||
'case_default': True,
|
||||
'project_ids': _get_default_project_id
|
||||
}
|
||||
_order = 'sequence'
|
||||
|
||||
|
@ -603,18 +609,13 @@ class task(base_stage, osv.osv):
|
|||
stage_obj = self.pool.get('project.task.type')
|
||||
order = stage_obj._order
|
||||
access_rights_uid = access_rights_uid or uid
|
||||
# lame way to allow reverting search, should just work in the trivial case
|
||||
if read_group_order == 'stage_id desc':
|
||||
order = '%s desc' % order
|
||||
# retrieve section_id from the context and write the domain
|
||||
# - ('id', 'in', 'ids'): add columns that should be present
|
||||
# - OR ('case_default', '=', True), ('fold', '=', False): add default columns that are not folded
|
||||
# - OR ('project_ids', 'in', project_id), ('fold', '=', False) if project_id: add project columns that are not folded
|
||||
search_domain = []
|
||||
project_id = self._resolve_project_id_from_context(cr, uid, context=context)
|
||||
if project_id:
|
||||
search_domain += ['|', ('project_ids', '=', project_id)]
|
||||
search_domain += ['|', ('id', 'in', ids), ('case_default', '=', True)]
|
||||
search_domain += [('id', 'in', ids)]
|
||||
stage_ids = stage_obj._search(cr, uid, search_domain, order=order, access_rights_uid=access_rights_uid, context=context)
|
||||
result = stage_obj.name_get(cr, access_rights_uid, stage_ids, context=context)
|
||||
# restore order of the search
|
||||
|
@ -750,7 +751,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="['&', ('fold', '=', False), '|', ('project_ids', '=', project_id), ('case_default', '=', True)]"),
|
||||
domain="['&', ('fold', '=', False), ('project_ids', '=', project_id)]"),
|
||||
'state': fields.related('stage_id', 'state', type="selection", store=True,
|
||||
selection=_TASK_STATE, string="Status", readonly=True,
|
||||
help='The status is set to \'Draft\', when a case is created.\
|
||||
|
@ -936,14 +937,11 @@ class task(base_stage, osv.osv):
|
|||
for task in cases:
|
||||
if task.project_id:
|
||||
section_ids.append(task.project_id.id)
|
||||
# OR all section_ids and OR with case_default
|
||||
search_domain = []
|
||||
if section_ids:
|
||||
search_domain += [('|')] * len(section_ids)
|
||||
search_domain = [('|')] * (len(section_ids)-1)
|
||||
for section_id in section_ids:
|
||||
search_domain.append(('project_ids', '=', section_id))
|
||||
search_domain.append(('case_default', '=', True))
|
||||
# AND with the domain in parameter
|
||||
search_domain += list(domain)
|
||||
# perform search, return the first found
|
||||
stage_ids = self.pool.get('project.task.type').search(cr, uid, search_domain, order=order, context=context)
|
||||
|
|
|
@ -36,6 +36,10 @@
|
|||
<field name="user_id" ref="base.user_demo"/>
|
||||
<field name="description">Implement new website for Sale and Warehouse Management for a customer.</field>
|
||||
<field name="alias_model">project.task</field>
|
||||
</record>
|
||||
|
||||
<!-- We assign after so that default values applies -->
|
||||
<record id="project_project_1" model="project.project">
|
||||
<field name="type_ids" eval="[(6, 0, [ref('project_tt_analysis'),ref('project_tt_specification'),ref('project_tt_development'),ref('project_tt_testing'),ref('project_tt_deployment')])]"/>
|
||||
</record>
|
||||
|
||||
|
@ -45,6 +49,10 @@
|
|||
<field name="privacy_visibility">public</field>
|
||||
<field name="user_id" ref="base.user_demo"/>
|
||||
<field name="alias_model">project.task</field>
|
||||
</record>
|
||||
|
||||
<!-- We assign after so that default values applies -->
|
||||
<record id="project_project_2" model="project.project">
|
||||
<field name="type_ids" eval="[(6, 0, [ref('project_tt_specification'),ref('project_tt_development'),ref('project_tt_testing'),ref('project_tt_merge'),ref('project_tt_deployment')])]"/>
|
||||
</record>
|
||||
|
||||
|
@ -58,6 +66,9 @@
|
|||
<field name="members" eval="[(6, 0, [
|
||||
ref('base.user_root'),
|
||||
ref('base.user_demo')])]"/>
|
||||
</record>
|
||||
|
||||
<record id="project_project_3" model="project.project">
|
||||
<field name="type_ids" eval="[(6, 0, [ref('project_tt_specification'),ref('project_tt_development'),ref('project_tt_testing'),ref('project_tt_merge'),ref('project_tt_deployment')])]"/>
|
||||
</record>
|
||||
|
||||
|
@ -67,24 +78,30 @@
|
|||
<field name="name">Website Design Templates</field>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
<field name="alias_model">project.task</field>
|
||||
<field name="type_ids" eval="[(6, 0, [ref('project_tt_design'),ref('project_tt_development'),ref('project_tt_testing')])]"/>
|
||||
<field name="members" eval="[(6, 0, [
|
||||
ref('base.user_root'),
|
||||
ref('base.user_demo')])]"/>
|
||||
</record>
|
||||
|
||||
<record id="project_project_4" model="project.project">
|
||||
<field name="type_ids" eval="[(6, 0, [ref('project_tt_design'),ref('project_tt_development'),ref('project_tt_testing')])]"/>
|
||||
</record>
|
||||
|
||||
<record id="project_project_5" model="project.project">
|
||||
<field name="priority">2</field>
|
||||
<field name="parent_id" ref="all_projects_account"/>
|
||||
<field name="partner_id" ref="base.res_partner_7"/>
|
||||
<field name="name">Data Import/Export Plugin</field>
|
||||
<field name="alias_model">project.task</field>
|
||||
<field name="type_ids" eval="[(6, 0, [ref('project_tt_development')])]"/>
|
||||
<field name="members" eval="[(6, 0, [
|
||||
ref('base.user_root'),
|
||||
ref('base.user_demo')])]"/>
|
||||
</record>
|
||||
|
||||
<record id="project_project_5" model="project.project">
|
||||
<field name="type_ids" eval="[(6, 0, [ref('project_tt_development')])]"/>
|
||||
</record>
|
||||
|
||||
|
||||
<!-- Tasks -->
|
||||
<record id="project_task_1" model="project.task">
|
||||
|
|
|
@ -89,7 +89,7 @@ class project_issue(base_stage, osv.osv):
|
|||
project_id = self._resolve_project_id_from_context(cr, uid, context=context)
|
||||
if project_id:
|
||||
search_domain += ['|', ('project_ids', '=', project_id)]
|
||||
search_domain += ['|', ('id', 'in', ids), ('case_default', '=', True)]
|
||||
search_domain += [('id', 'in', ids)]
|
||||
# perform search
|
||||
stage_ids = stage_obj._search(cr, uid, search_domain, order=order, access_rights_uid=access_rights_uid, context=context)
|
||||
result = stage_obj.name_get(cr, access_rights_uid, stage_ids, context=context)
|
||||
|
@ -244,7 +244,7 @@ class project_issue(base_stage, osv.osv):
|
|||
'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority', select=True),
|
||||
'version_id': fields.many2one('project.issue.version', 'Version'),
|
||||
'stage_id': fields.many2one ('project.task.type', 'Stage',
|
||||
domain="['&', ('fold', '=', False), '|', ('project_ids', '=', project_id), ('case_default', '=', True)]"),
|
||||
domain="['&', ('fold', '=', False), ('project_ids', '=', project_id)]"),
|
||||
'project_id':fields.many2one('project.project', 'Project'),
|
||||
'duration': fields.float('Duration'),
|
||||
'task_id': fields.many2one('project.task', 'Task', domain="[('project_id','=',project_id)]"),
|
||||
|
@ -442,11 +442,9 @@ class project_issue(base_stage, osv.osv):
|
|||
# OR all section_ids and OR with case_default
|
||||
search_domain = []
|
||||
if section_ids:
|
||||
search_domain += [('|')] * len(section_ids)
|
||||
search_domain += [('|')] * (len(section_ids)-1)
|
||||
for section_id in section_ids:
|
||||
search_domain.append(('project_ids', '=', section_id))
|
||||
search_domain.append(('case_default', '=', True))
|
||||
# AND with the domain in parameter
|
||||
search_domain += list(domain)
|
||||
# perform search, return the first found
|
||||
stage_ids = self.pool.get('project.task.type').search(cr, uid, search_domain, order=order, context=context)
|
||||
|
|
Loading…
Reference in New Issue