[FIX] project small stuff: star, search on tags, #documents

bzr revid: fp@tinyerp.com-20121215101227-jb4z7hu57p2q11b4
This commit is contained in:
Fabien Pinckaers 2012-12-15 11:12:27 +01:00
parent 809c92fdef
commit 1be0da09b3
3 changed files with 12 additions and 36 deletions

View File

@ -40,7 +40,7 @@ class project_task_type(osv.osv):
'name': fields.char('Stage Name', required=True, size=64, translate=True),
'description': fields.text('Description'),
'sequence': fields.integer('Sequence'),
'case_default': fields.boolean('Common to All Projects',
'case_default': fields.boolean('Default for New Projects',
help="If you check this field, this stage will be proposed by default on each new project. It will not assign this stage to existing projects."),
'project_ids': fields.many2many('project.project', 'project_task_type_rel', 'type_id', 'project_id', 'Projects'),
'state': fields.selection(_TASK_STATE, 'Related Status', required=True,
@ -58,7 +58,7 @@ class project_task_type(osv.osv):
'sequence': 1,
'state': 'open',
'fold': False,
'case_default': True,
'case_default': False,
'project_ids': _get_default_project_id
}
_order = 'sequence'
@ -190,10 +190,10 @@ class project(osv.osv):
attachment = self.pool.get('ir.attachment')
task = self.pool.get('project.task')
for id in ids:
project_attachments = attachment.search(cr, uid, [('res_model', '=', 'project.project'), ('res_id', 'in', [id])], context=context, count=True)
task_ids = task.search(cr, uid, [('project_id', 'in', [id])], context=context)
project_attachments = attachment.search(cr, uid, [('res_model', '=', 'project.project'), ('res_id', '=', id)], context=context, count=True)
task_ids = task.search(cr, uid, [('project_id', '=', id)], context=context)
task_attachments = attachment.search(cr, uid, [('res_model', '=', 'project.task'), ('res_id', 'in', task_ids)], context=context, count=True)
res[id] = project_attachments or 0 + task_attachments or 0
res[id] = (project_attachments or 0) + (task_attachments or 0)
return res
def _task_count(self, cr, uid, ids, field_name, arg, context=None):
@ -206,7 +206,7 @@ class project(osv.osv):
def _get_alias_models(self, cr, uid, context=None):
"""Overriden in project_issue to offer more options"""
return [('project.task', "Tasks")]
def attachment_tree_view(self, cr, uid, ids, context):
task_ids = self.pool.get('project.task').search(cr, uid, [('project_id', 'in', ids)])
domain = [
@ -811,25 +811,15 @@ class task(base_stage, osv.osv):
}
_order = "priority, sequence, date_start, name, id"
def set_priority(self, cr, uid, ids, priority, *args):
"""Set task priority
"""
return self.write(cr, uid, ids, {'priority' : priority})
def set_very_high_priority(self, cr, uid, ids, *args):
"""Set task priority to very high
"""
return self.set_priority(cr, uid, ids, '0')
def set_high_priority(self, cr, uid, ids, *args):
"""Set task priority to high
"""
return self.set_priority(cr, uid, ids, '1')
return self.write(cr, uid, ids, {'priority' : '0'})
def set_normal_priority(self, cr, uid, ids, *args):
"""Set task priority to normal
"""
return self.set_priority(cr, uid, ids, '2')
return self.write(cr, uid, ids, {'priority' : '2'})
def _check_recursion(self, cr, uid, ids, context=None):
for id in ids:

View File

@ -461,9 +461,8 @@
<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>
<a t-if="record.priority.raw_value == 2" type="object" string="Important" name="set_very_high_priority" class="oe_e oe_star_on">7</a>
<a t-if="record.priority.raw_value == 1 or record.priority.raw_value == 3 or record.priority.raw_value == 4" type="object" string="Normal" name="set_normal_priority" class="oe_e oe_star_off">7</a>
<a t-if="record.priority.raw_value == 0" type="object" string="Very Important" name="set_high_priority" class="oe_e oe_star_very_high_priority">7</a>
<a t-if="record.priority.raw_value > 0" type="object" string="Normal" name="set_high_priority" class="oe_e oe_star_off">7</a>
<a t-if="record.priority.raw_value == 0" type="object" string="Very Important" name="set_normal_priority" class="oe_e oe_star_on">7</a>
</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"/>
</div>
@ -551,6 +550,8 @@
<field name="arch" type="xml">
<search string="Tasks">
<field name="name" string="Tasks"/>
<field name="categ_ids"/>
<separator/>
<filter icon="terp-mail-message-new" string="Unread Messages" name="message_unread" domain="[('message_unread','=',True)]"/>
<separator/>
<filter name="draft" string="New" domain="[('state','=','draft')]" help="New Tasks" icon="terp-check"/>

View File

@ -2,21 +2,6 @@
margin: 2px;
}
.openerp .oe_kanban_view .oe_kanban_content .oe_star_very_high_priority {
color: #cccccc;
text-shadow: 0 0 2px black;
vertical-align: top;
position: relative;
top: -5px;
}
.openerp .oe_kanban_view .oe_kanban_content .oe_star_very_high_priority:hover {
text-decoration: none;
}
.openerp .oe_kanban_view .oe_kanban_content .oe_star_very_high_priority {
color: red;
}
.oe_kanban_project {
width: 220px;
min-height: 160px;