[FIX] project: fixed various report views + some filters.
bzr revid: tde@openerp.com-20130626142242-aztr40zazsl20eif
This commit is contained in:
parent
8fbfc997ae
commit
9e17dd58d8
|
@ -1301,7 +1301,7 @@ class project_task_history(osv.osv):
|
|||
def _get_date(self, cr, uid, ids, name, arg, context=None):
|
||||
result = {}
|
||||
for history in self.browse(cr, uid, ids, context=context):
|
||||
if history.state in ('done','cancelled'):
|
||||
if history.type_id and history.type_id.fold:
|
||||
result[history.id] = history.date
|
||||
continue
|
||||
cr.execute('''select
|
||||
|
@ -1335,14 +1335,13 @@ class project_task_history(osv.osv):
|
|||
_columns = {
|
||||
'task_id': fields.many2one('project.task', 'Task', ondelete='cascade', required=True, select=True),
|
||||
'type_id': fields.many2one('project.task.type', 'Stage'),
|
||||
'state': fields.selection([('draft', 'New'), ('cancelled', 'Cancelled'),('open', 'In Progress'),('pending', 'Pending'), ('done', 'Done')], 'Status'),
|
||||
'kanban_state': fields.selection([('normal', 'Normal'),('blocked', 'Blocked'),('done', 'Ready for next stage')], 'Kanban State', required=False),
|
||||
'kanban_state': fields.selection([('normal', 'Normal'), ('blocked', 'Blocked'), ('done', 'Ready for next stage')], 'Kanban State', required=False),
|
||||
'date': fields.date('Date', select=True),
|
||||
'end_date': fields.function(_get_date, string='End Date', type="date", store={
|
||||
'project.task.history': (_get_related_date, None, 20)
|
||||
}),
|
||||
'remaining_hours': fields.float('Remaining Time', digits=(16,2)),
|
||||
'planned_hours': fields.float('Planned Time', digits=(16,2)),
|
||||
'remaining_hours': fields.float('Remaining Time', digits=(16, 2)),
|
||||
'planned_hours': fields.float('Planned Time', digits=(16, 2)),
|
||||
'user_id': fields.many2one('res.users', 'Responsible'),
|
||||
}
|
||||
_defaults = {
|
||||
|
@ -1372,7 +1371,7 @@ class project_task_history_cumulative(osv.osv):
|
|||
SELECT
|
||||
h.id AS history_id,
|
||||
h.date+generate_series(0, CAST((coalesce(h.end_date, DATE 'tomorrow')::date - h.date) AS integer)-1) AS date,
|
||||
h.task_id, h.type_id, h.user_id, h.kanban_state, h.state,
|
||||
h.task_id, h.type_id, h.user_id, h.kanban_state,
|
||||
greatest(h.remaining_hours, 1) AS remaining_hours, greatest(h.planned_hours, 1) AS planned_hours,
|
||||
t.project_id
|
||||
FROM
|
||||
|
|
|
@ -36,8 +36,9 @@
|
|||
<filter string="Users" name="group_user_id" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
|
||||
<filter string="Project" name="group_project_id" icon="terp-folder-violet" domain="[]" context="{'group_by':'project_id'}"/>
|
||||
<filter string="Stage" name="group_stage_id" icon="terp-stage" domain="[]" context="{'group_by':'stage_id'}"/>
|
||||
<filter string="Last Action" icon="terp-go-month" domain="[]" context="{'group_by':'date_last_stage_update'}"/>
|
||||
<filter string="Deadline" icon="terp-gnome-cpu-frequency-applet+" domain="[]" context="{'group_by':'date_deadline'}"/>
|
||||
<filter string="Start Date" icon="terp-go-month" domain="[]" context="{'group_by':'date_start'}" groups="base.group_no_one"/>
|
||||
<filter string="Start Date" icon="terp-go-month" domain="[]" context="{'group_by':'date_start'}"/>
|
||||
<filter string="End Date" icon="terp-go-month" domain="[]" context="{'group_by':'date_end'}" groups="base.group_no_one"/>
|
||||
</group>
|
||||
</search>
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
<field name="user_id"/>
|
||||
<field name="remaining_hours"/>
|
||||
<field name="kanban_state"/>
|
||||
<field name="state" groups="base.group_no_one"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
@ -40,8 +39,7 @@
|
|||
<field name="date"/>
|
||||
<field name="project_id"/>
|
||||
<field name="user_id"/>
|
||||
<filter name="open" string="In Progress Tasks" domain="[('state','in',('open','draft'))]"/>
|
||||
<filter string="Pending Tasks" domain="[('state','=','pending')]" context="{'show_delegated':False}"/>
|
||||
<filter name="new" string="New" domain="[('type_id.sequence', '=', 1)]"/>
|
||||
<separator/>
|
||||
<filter name="kanban_blocked" string="Blocked" domain="[('kanban_state','=','blocked')]"/>
|
||||
<filter name="kanban_ready" string="Ready" domain="[('kanban_state','=','done')]"/>
|
||||
|
|
|
@ -19,9 +19,11 @@
|
|||
#
|
||||
##############################################################################
|
||||
|
||||
from openerp.tools.misc import MONTHS
|
||||
from openerp.osv import fields, osv
|
||||
from openerp import tools
|
||||
|
||||
|
||||
class report_project_task_user(osv.osv):
|
||||
_name = "report.project.task.user"
|
||||
_description = "Tasks by user and project"
|
||||
|
@ -36,7 +38,7 @@ class report_project_task_user(osv.osv):
|
|||
'date_end': fields.date('Ending Date', readonly=True),
|
||||
'date_deadline': fields.date('Deadline', readonly=True),
|
||||
'date_last_stage_update': fields.date('Last Stage Update', readonly=True),
|
||||
'month_last_stage_update': fields.date('Month of Last Stage Update', readonly=True),
|
||||
'month_last_stage_update': fields.selection(MONTHS, 'Month of Last Stage Update', readonly=True),
|
||||
'project_id': fields.many2one('project.project', 'Project', readonly=True),
|
||||
'hours_planned': fields.float('Planned Hours', readonly=True),
|
||||
'hours_effective': fields.float('Effective Hours', readonly=True),
|
||||
|
@ -52,7 +54,7 @@ class report_project_task_user(osv.osv):
|
|||
'nbr': fields.integer('# of tasks', readonly=True),
|
||||
'priority': fields.selection([('4', 'Very Low'), ('3', 'Low'), ('2', 'Medium'), ('1', 'Urgent'), ('0', 'Very urgent')],
|
||||
string='Priority', readonly=True),
|
||||
'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'), ('05','May'), ('06','June'), ('07','July'), ('08','August'), ('09','September'), ('10','October'), ('11','November'), ('12','December')], 'Month', readonly=True),
|
||||
'month':fields.selection(MONTHS, 'Month', readonly=True),
|
||||
'state': fields.selection([('draft', 'Draft'), ('open', 'In Progress'), ('pending', 'Pending'), ('cancelled', 'Cancelled'), ('done', 'Done')],'Status', readonly=True),
|
||||
'company_id': fields.many2one('res.company', 'Company', readonly=True),
|
||||
'partner_id': fields.many2one('res.partner', 'Contact', readonly=True),
|
||||
|
|
|
@ -11,19 +11,6 @@
|
|||
<field name="model">report.project.task.user</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Tasks Analysis" create="false">
|
||||
<field name="name" invisible="1"/>
|
||||
<field name="project_id" invisible="1"/>
|
||||
<field name="user_id" invisible="1"/>
|
||||
<field name="date_deadline" invisible="1"/>
|
||||
<field name="date_start" invisible="1"/>
|
||||
<field name="date_end" invisible="1"/>
|
||||
<field name="date_last_stage_update" invisible="1"/>
|
||||
<field name="month_last_stage_update" invisible="1"/>
|
||||
<field name="company_id" invisible="1" groups="base.group_multi_company"/>
|
||||
<field name="partner_id" invisible="1"/>
|
||||
<field name="day" invisible="1"/>
|
||||
<field name="month" invisible="1"/>
|
||||
<field name="year" invisible="1"/>
|
||||
<field name="nbr" sum='# of tasks'/>
|
||||
<field name="no_of_days" sum="# of Days"/>
|
||||
<field name="total_hours" sum='Total Hours'/>
|
||||
|
@ -35,6 +22,21 @@
|
|||
<field name="closing_days" sum='Days to Close'/>
|
||||
<field name="delay_endings_days" sum='OverPass delay'/>
|
||||
<field name="progress" sum='Progress' widget='progressbar'/>
|
||||
|
||||
<field name="name" invisible="1"/>
|
||||
<field name="project_id" invisible="1"/>
|
||||
<field name="stage_id" invisible="1"/>
|
||||
<field name="user_id" invisible="1"/>
|
||||
<field name="date_deadline" invisible="1"/>
|
||||
<field name="date_start" invisible="1"/>
|
||||
<field name="date_end" invisible="1"/>
|
||||
<field name="date_last_stage_update" invisible="1"/>
|
||||
<field name="month_last_stage_update" invisible="1"/>
|
||||
<field name="company_id" invisible="1" groups="base.group_multi_company"/>
|
||||
<field name="partner_id" invisible="1"/>
|
||||
<field name="day" invisible="1"/>
|
||||
<field name="month" invisible="1"/>
|
||||
<field name="year" invisible="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
@ -63,6 +65,7 @@
|
|||
<field name="project_id"/>
|
||||
<field name="user_id"/>
|
||||
<field name="partner_id" filter_domain="[('partner_id', 'child_of', self)]"/>
|
||||
<field name="stage_id"/>
|
||||
<filter string="Unassigned" name="unassigned" domain="[('user_id','=',False)]"/>
|
||||
<filter string="New" name="new" domain="[('stage_id.sequence', '=', 1)]"/>
|
||||
<filter string="Done" name="done" domain="[('stage_id.fold', '=', True)]"
|
||||
|
|
Loading…
Reference in New Issue