[CLEAN] crm, hr_recruitmnet, project: cleaned priority / kanban state in kanban views

bzr revid: tde@openerp.com-20140508152536-s3my5onl33z3kxxx
This commit is contained in:
Thibault Delavallée 2014-05-08 17:25:36 +02:00
parent 90233e4833
commit ea1e0e3275
9 changed files with 26 additions and 63 deletions

View File

@ -304,7 +304,7 @@
</div>
<div class="oe_kanban_bottom_right">
<img t-att-src="kanban_image('res.users', 'image_small', record.user_id.raw_value)" t-att-title="record.user_id.value" width="24" height="24" class="oe_kanban_avatar pull-right"/>
<div class="pull-left">
<div class="pull-left" groups="base.group_user">
<field name="priority" widget="priority"/>
</div>
</div>

View File

@ -293,9 +293,9 @@
<field name="title_action"/>
</div>
<div style="width:240px"><field name="categ_ids"/></div>
<div class="oe_kanban_right">
<div class="oe_kanban_bottom_right">
<img t-att-src="kanban_image('res.users', 'image_small', record.user_id.raw_value)" t-att-title="record.user_id.value" width="24" height="24" class="oe_kanban_avatar pull-right"/>
<div class="pull-left">
<div class="pull-left" groups="base.group_user">
<field name="priority" widget="priority"/>
</div>
</div>

View File

@ -38,21 +38,7 @@
<field name="categ_ids"/>
<div class="oe_right">
Creation: <field name="create_date"/>
<span class="oe_kanban_highlight">
<t t-set="priority" t-value="record.priority.raw_value || 5"/>
<a type="object" name="set_priority" args="['3']" t-if="priority gt 3" title="Normal Priority">
<img src="/web/static/src/img/icons/star-off.png" width="16" height="16"/>
</a>
<a type="object" name="set_priority" args="['5']" t-if="priority lte 3" title="Normal Priority">
<img t-attf-src="/web/static/src/img/icons/star-#{priority lte 3 ? 'on' : 'off'}.png" width="16" height="16"/>
</a>
<a type="object" name="set_priority" args="['2']" title="High Priority">
<img t-attf-src="/web/static/src/img/icons/star-#{priority lte 2 ? 'on' : 'off'}.png" width="16" height="16"/>
</a>
<a type="object" name="set_priority" args="['1']" title="Highest Priority">
<img t-attf-src="/web/static/src/img/icons/star-#{priority == 1 ? 'on' : 'off'}.png" width="16" height="16"/>
</a>
</span>
<field name="priority" widget="priority"/>
<t t-if="record.date_deadline.raw_value and record.date_deadline.raw_value lt (new Date())">
<span t-attf-class="oe_kanban_status oe_kaban_status_red"> </span>
</t>

View File

@ -565,7 +565,7 @@ class task(osv.osv):
},
'kanban_state': {
'project.mt_task_blocked': lambda self, cr, uid, obj, ctx=None: obj.kanban_state == 'blocked',
'project.mt_task_done': lambda self, cr, uid, obj, ctx=None: obj.kanban_state == 'done',
'project.mt_task_ready': lambda self, cr, uid, obj, ctx=None: obj.kanban_state == 'done',
},
}

View File

@ -93,11 +93,11 @@
<field name="default" eval="False"/>
<field name="description">Task blocked</field>
</record>
<record id="mt_project_task_done" model="mail.message.subtype">
<field name="name">Task Done</field>
<record id="mt_task_ready" model="mail.message.subtype">
<field name="name">Task Ready for Next Stage</field>
<field name="res_model">project.task</field>
<field name="default" eval="False"/>
<field name="description">Task Done</field>
<field name="description">Task Ready for Next Stage</field>
</record>
<record id="mt_task_stage" model="mail.message.subtype">
<field name="name">Stage Changed</field>

View File

@ -443,7 +443,7 @@
</page>
<page string="Extra Info">
<group col="4">
<field name="priority" groups="base.group_user" widget="priority"/>
<field name="priority" groups="base.group_user" widget="priority"/>
<field name="sequence"/>
<field name="partner_id"/>
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
@ -524,21 +524,13 @@
<t t-raw="record.message_summary.raw_value"/>
<field name="categ_ids"/>
</div>
<div class="oe_kanban_bottom_right">
<table>
<tr>
<td groups="base.group_user">
<field name="kanban_state" widget="dropdown_selection"/>
</td>
<td groups="base.group_user">
<field name="priority" widget="priority"/>
</td>
<td>
<img t-att-src="kanban_image('res.users', 'image_small', record.user_id.raw_value)" t-att-title="record.user_id.value" width="24" height="24" class="oe_kanban_avatar"/>
</td>
</tr>
</table>
</div>
<div class="oe_kanban_bottom_right">
<img t-att-src="kanban_image('res.users', 'image_small', record.user_id.raw_value)" t-att-title="record.user_id.value" width="24" height="24" class="oe_kanban_avatar pull-right"/>
<div class="pull-left" groups="base.group_user">
<field name="kanban_state" widget="dropdown_selection"/>
<field name="priority" widget="priority"/>
</div>
</div>
</div>
<div class="oe_clear"></div>
</div>

View File

@ -57,7 +57,7 @@ class project_issue(osv.Model):
},
'kanban_state': {
'project_issue.mt_issue_blocked': lambda self, cr, uid, obj, ctx=None: obj.kanban_state == 'blocked',
'project_issue.mt_issue_done': lambda self, cr, uid, obj, ctx=None: obj.kanban_state == 'done',
'project_issue.mt_issue_ready': lambda self, cr, uid, obj, ctx=None: obj.kanban_state == 'done',
},
}
@ -306,11 +306,6 @@ class project_issue(osv.Model):
'stage_id': _read_group_stage_ids
}
def set_priority(self, cr, uid, ids, priority, *args):
"""Set lead priority
"""
return self.write(cr, uid, ids, {'priority' : str(priority)})
def copy(self, cr, uid, id, default=None, context=None):
issue = self.read(cr, uid, id, ['name'], context=context)
if not default:

View File

@ -48,11 +48,11 @@ Access all issues from the top Project menu, and access the issues of a specific
<field name="default" eval="False"/>
<field name="description">Issue blocked</field>
</record>
<record id="mt_issue_done" model="mail.message.subtype">
<field name="name">Issue Done</field>
<record id="mt_issue_ready" model="mail.message.subtype">
<field name="name">Issue Ready for Next Stage</field>
<field name="res_model">project.issue</field>
<field name="default" eval="False"/>
<field name="description">Issue Done</field>
<field name="description">Issue Ready for Next Stage</field>
</record>
<record id="mt_issue_stage" model="mail.message.subtype">
<field name="name">Stage Changed</field>

View File

@ -216,25 +216,15 @@
<field name="partner_id"/> <br/>
<field name="version_id"/>
</div>
<div class="oe_kanban_footer_left">
<field name="categ_ids"/>
<div class="oe_right">
<table>
<tr>
<td groups="base.group_user">
<field name="kanban_state" widget="dropdown_selection"/>
</td>
<td groups="base.group_user">
<field name="priority" widget="priority"/>
</td>
<td>
<img t-att-src="kanban_image('res.users', 'image_small', record.user_id.raw_value)" t-att-title="record.user_id.value" width="24" height="24" class="oe_kanban_avatar"/>
</td>
</tr>
</table>
<div class="oe_kanban_bottom_right">
<img t-att-src="kanban_image('res.users', 'image_small', record.user_id.raw_value)" t-att-title="record.user_id.value" width="24" height="24" class="oe_kanban_avatar pull-right"/>
<div class="pull-left" groups="base.group_user">
<field name="kanban_state" widget="dropdown_selection"/>
<field name="priority" widget="priority"/>
</div>
</div>
<div class="oe_kanban_footer_left">
<field name="categ_ids"/>
<t t-raw="record.message_summary.raw_value"/>
</div>
</div>