diff options
| author | Mahendra Barad (OpenERP) <mba@tinyerp.com> | 2014-01-07 18:41:34 +0530 |
|---|---|---|
| committer | Mahendra Barad (OpenERP) <mba@tinyerp.com> | 2014-01-07 18:41:34 +0530 |
| commit | 8eb7fb82de5bd5b7ec412f77d04d7b929a41a928 (patch) | |
| tree | a7ba226b1fa43eb6d5cc8e636aadf40ac26bb404 /addons/project_issue | |
| parent | 0562d90529bd43141d1996a13e8760cd5d1b6875 (diff) | |
[IMP]added the legend widget for priority and kanban state
bzr revid: mba@tinyerp.com-20140107131134-fho22izhbw86w1w5
Diffstat (limited to 'addons/project_issue')
| -rw-r--r-- | addons/project_issue/project_issue.py | 15 | ||||
| -rw-r--r-- | addons/project_issue/project_issue_demo.xml | 2 | ||||
| -rw-r--r-- | addons/project_issue/project_issue_view.xml | 44 |
3 files changed, 22 insertions, 39 deletions
diff --git a/addons/project_issue/project_issue.py b/addons/project_issue/project_issue.py index 8e789e03658..0b66fd9376d 100644 --- a/addons/project_issue/project_issue.py +++ b/addons/project_issue/project_issue.py @@ -250,7 +250,7 @@ class project_issue(osv.Model): " * Normal is the default situation\n" " * Blocked indicates something is preventing the progress of this issue\n" " * Ready for next stage indicates the issue is ready to be pulled to the next stage", - readonly=True, required=False), + required=False), 'email_from': fields.char('Email', size=128, help="These people will receive email.", select=1), 'email_cc': fields.char('Watchers Emails', size=256, help="These email addresses will be added to the CC field of all inbound and outbound emails for this record before being sent. Separate multiple email addresses with a comma"), 'date_open': fields.datetime('Opened', readonly=True,select=True), @@ -308,17 +308,10 @@ class project_issue(osv.Model): def set_priority(self, cr, uid, ids, priority, *args): """Set lead priority """ - return self.write(cr, uid, ids, {'priority' : priority}) + return self.write(cr, uid, ids, {'priority' : str(priority)}) - def set_high_priority(self, cr, uid, ids, *args): - """Set lead priority to high - """ - return self.set_priority(cr, uid, ids, '1') - - def set_normal_priority(self, cr, uid, ids, *args): - """Set lead priority to normal - """ - return self.set_priority(cr, uid, ids, '3') + def set_kanban_state(self, cr, uid, ids, state, context=None): + self.write(cr, uid, ids, {'kanban_state': state }, context=context); def copy(self, cr, uid, id, default=None, context=None): issue = self.read(cr, uid, id, ['name'], context=context) diff --git a/addons/project_issue/project_issue_demo.xml b/addons/project_issue/project_issue_demo.xml index 63fa37c84c3..29e5b05a1d1 100644 --- a/addons/project_issue/project_issue_demo.xml +++ b/addons/project_issue/project_issue_demo.xml @@ -35,7 +35,7 @@ <!-- Issues --> <record id="crm_case_buginaccountsmodule0" model="project.issue"> <field eval="time.strftime('%Y-%m-08 10:15:00')" name="date"/> - <field name="priority">5</field> + <field name="priority">4</field> <field name="user_id" ref="base.user_root"/> <field name="partner_id" ref="base.res_partner_2"/> <field name="section_id" ref="crm.section_sales_department"/> diff --git a/addons/project_issue/project_issue_view.xml b/addons/project_issue/project_issue_view.xml index 68c6712f530..b9f9828af6f 100644 --- a/addons/project_issue/project_issue_view.xml +++ b/addons/project_issue/project_issue_view.xml @@ -55,10 +55,10 @@ <label for="name" class="oe_edit_only"/> <h1> <field name="name" class="oe_inline"/> - <field name="kanban_state" invisible='1'/> - <button name="set_kanban_state_done" help="In Progress" attrs="{'invisible': [('kanban_state', 'in', ['done','blocked'])]}" type="object" icon="gtk-normal" class="oe_link oe_right"/> - <button name="set_kanban_state_blocked" help="Ready for Next Stage" attrs="{'invisible': [('kanban_state', 'in', ['normal','blocked'])]}" type="object" icon="gtk-yes" class="oe_link oe_right"/> - <button name="set_kanban_state_normal" help="Blocked" attrs="{'invisible': [('kanban_state', 'in', ['done','normal'])]}" type="object" icon="gtk-no" class="oe_link oe_right"/> + <div class="oe_right"> + <field name="kanban_state" class="oe_inline" widget="legend" options="{'action':'set_kanban_state'}" /> + <field name="priority" class="oe_inline" widget="legend" options="{'action':'set_priority'}"/> + </div> </h1> <label for="categ_ids" class="oe_edit_only"/> <field name="categ_ids" widget="many2many_tags"/> @@ -78,7 +78,6 @@ <group> <field name="id"/> <field name="version_id" groups="base.group_user"/> - <field name="priority" groups="base.group_user"/> <label for="task_id" groups="base.group_user"/> <div groups="base.group_user"> <field name="task_id" on_change="onchange_task_id(task_id)" class="oe_inline" context="{'default_project_id':project_id}"/> @@ -219,28 +218,19 @@ <div class="oe_kanban_footer_left"> <field name="categ_ids"/> <div class="oe_right"> - <span class="oe_kanban_highlight" groups="base.group_user"> - <a t-if="record.kanban_state.raw_value === 'normal'" type="object" string="In Progress" name="set_kanban_state_done" class="oe_kanban_status"> </a> - <a t-if="record.kanban_state.raw_value === 'done'" type="object" string="Ready for next stage" name="set_kanban_state_blocked" class="oe_kanban_status oe_kanban_status_green"> </a> - <a t-if="record.kanban_state.raw_value === 'blocked'" type="object" string="Blocked" name="set_kanban_state_normal" class="oe_kanban_status oe_kanban_status_red"> </a> - <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> - <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> - <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"/> + <table> + <tr> + <td groups="base.group_user"> + <field name="kanban_state" class="oe_inline" widget="legend" options="{'action':'set_kanban_state'}" /> + </td> + <td groups="base.group_user"> + <field name="priority" class="oe_inline" widget="legend" options="{'action':'set_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> <div class="oe_kanban_footer_left"> |
