'color': fields.integer('Color Index'),
'company_uom_id': fields.related('company_id', 'project_time_mode_id', type='many2one', relation='product.uom'),
}
- def dummy(self, cr, uid, ids, context=None):
- return False
- def open_tasks(self, cr, uid, ids, context=None):
- #Open the View for the Tasks for the project
- """
- This opens Tasks views
- @return :Dictionary value for task view
- """
- if context is None:
- context = {}
- if ids:
- context = dict(context, search_default_project_id=ids[0])
- return {
- 'name': _('Task'),
- 'context': context,
- 'view_type': 'form',
- 'view_mode': 'kanban,tree,calendar,form',
- 'res_model': 'project.task',
- 'view_id': False,
- 'domain':[('project_id','in',ids)],
- 'type': 'ir.actions.act_window',
- 'nodestroy': True
- }
-
def _get_type_common(self, cr, uid, context):
ids = self.pool.get('project.task.type').search(cr, uid, [('project_default','=',1)], context=context)
return ids
'sequence': 10,
'active': True,
'user_id': lambda obj, cr, uid, context: uid,
- 'project_id':lambda self, cr, uid, context: context.get('active_id',False),
'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'project.task', context=c)
}
</field>
</record>
+ <act_window
+ context="{'search_default_project_id': [active_id], 'default_project_id': active_id}"
+ id="act_project_project_2_project_task_all"
+ name="Tasks"
+ res_model="project.task"
+ src_model="project.project"
+ view_mode="kanban,tree,form,calendar,graph"
+ view_type="form"/>
+
+
<record model="ir.ui.view" id="view_project_kanban">
<field name="name">project.project.kanban</field>
<field name="model">project.project</field>
<h4><t t-esc="record.name.value.substr(0,33)"/><t t-if="record.name.value.length > 33">...</t></h4>
<div id="list">
<t t-if="record.use_tasks.raw_value">
- <a id="1" name="open_tasks" class="oe_project_buttons" type="object"><t t-if="record.task_count.value <= 1"> Task</t><t t-if="record.task_count.value > 1"> Tasks</t>(<t t-esc="record.task_count.value"/>)</a>
+ <a id="1" name="%(act_project_project_2_project_task_all)d" class="oe_project_buttons" type="action"><t t-if="record.task_count.value <= 1"> Task</t><t t-if="record.task_count.value > 1"> Tasks</t>(<t t-esc="record.task_count.value"/>)</a>
</t>
</div>
<br/>
- <button class="click_button" type="object">
+ <button class="click_button" type="action">
<table class="project_fields">
<tr id="deadline" t-if="record.date.raw_value">
<th align="left">Deadline</th>
</form>
</field>
</record>
-
-
+
<!-- Project Task Kanban View -->
<record model="ir.ui.view" id="view_task_kanban">
<field name="name">project.task.kanban</field>
<act_window context="{'search_default_user_id': [active_id], 'default_user_id': active_id}" id="act_res_users_2_project_project" name="User's projects" res_model="project.project" src_model="res.users" view_mode="tree,form" view_type="form"/>
- <act_window
- context="{'search_default_project_id': [active_id], 'default_project_id': active_id}"
- id="act_project_project_2_project_task_all"
- name="Tasks"
- res_model="project.task"
- src_model="project.project"
- view_mode="tree,form,calendar,graph"
- view_type="form"/>
-
<record id="task_company" model="ir.ui.view">
<field name="name">res.company.task.config</field>
<field name="model">res.company</field>
});
});
- //if task is true , then open the task when click on the anywhere in the box.
- if(this.record.use_tasks.raw_value)$(this.$element).find('.click_button').attr('data-name','open_tasks');
- if(!this.record.use_tasks.raw_value)$(this.$element).find('.click_button').attr('data-name','dummy');
// set sequence like Tasks,Issues,Timesheets and Phases
my_list = $("#list a")
});
$('#list').replaceWith(my_list);
+ //if task is true , then open the task when click on the anywhere in the box.
+ if(this.record.use_tasks.raw_value)$(this.$element).find('.click_button').attr('data-name',my_list[0].getAttribute('data-name'));
+
/* set background color.
we can do other way to implement new widget.
because we need to rpc call for that.