summaryrefslogtreecommitdiff
path: root/addons/project_issue
diff options
context:
space:
mode:
authorrpa (Open ERP) <rpa@tinyerp.com>2010-05-24 10:38:38 +0530
committerrpa (Open ERP) <rpa@tinyerp.com>2010-05-24 10:38:38 +0530
commite3eabf151a66016366dcedaf074f2fe4fac39c19 (patch)
treea93c932fc1b425532e5ea87e3b8b5851c2fb67b9 /addons/project_issue
parent0ff2208d77379895267a80ac42c669fad2ba9ade (diff)
parentbd50a157c9dbc895ab29e05e71bce1ef5be016c7 (diff)
[MERGE]: Merge with lp:~openerp-dev/openobject-addons/trunk-dev-addons2
bzr revid: rpa@tinyerp.com-20100524050838-x2zks9ar4xv4rruc
Diffstat (limited to 'addons/project_issue')
-rw-r--r--addons/project_issue/project_issue.py3
-rw-r--r--addons/project_issue/report/project_issue_report.py27
-rw-r--r--addons/project_issue/report/project_issue_report_view.xml105
3 files changed, 76 insertions, 59 deletions
diff --git a/addons/project_issue/project_issue.py b/addons/project_issue/project_issue.py
index 71f5b851e92..f67986526cd 100644
--- a/addons/project_issue/project_issue.py
+++ b/addons/project_issue/project_issue.py
@@ -142,9 +142,6 @@ class project_issue(osv.osv, crm.crm_case):
'email_cc': fields.text('Watchers Emails', size=252 , help="These people\
will receive a copy of the future" \
" communication between partner and users by email"),
- 'stage_id': fields.many2one('crm.case.stage', 'Stage', \
- domain="[('section_id','=',section_id),\
- ('object_id.model', '=', 'crm.phonecall')]"),
'date_open': fields.datetime('Opened', readonly=True),
# Project Issue fields
'date_closed': fields.datetime('Closed', readonly=True),
diff --git a/addons/project_issue/report/project_issue_report.py b/addons/project_issue/report/project_issue_report.py
index 6bc02be3ab2..70a08e2c7b4 100644
--- a/addons/project_issue/report/project_issue_report.py
+++ b/addons/project_issue/report/project_issue_report.py
@@ -66,23 +66,21 @@ class project_issue_report(osv.osv):
('11', 'November'), ('12', 'December')], 'Month', readonly=True),
'company_id': fields.many2one('res.company', 'Company', readonly=True),
'create_date': fields.datetime('Create Date', readonly=True),
- 'day': fields.char('Day', size=128, readonly=True),
+ 'day': fields.char('Day', size=128, readonly=True),
'categ_id': fields.many2one('crm.case.categ', 'Category', domain="[('section_id','=',section_id),('object_id.model', '=', 'project.issue')]"),
+ 'stage_id': fields.many2one ('crm.case.stage', 'Stage', domain="[('object_id.model', '=', 'project.issue')]"),
'nbr': fields.integer('# of Issues', readonly=True),
'delay_close': fields.float('Avg Closing Delay', digits=(16,2), readonly=True, group_operator="avg",
- help="Number of Days to close the project issue"),
- 'delay_open': fields.float('Avg Opening Delay', digits=(16,2), readonly=True, group_operator="avg",
- help="Number of Days to open the project issue"),
+ help="Number of Days to close the project issue"),
'company_id' : fields.many2one('res.company', 'Company'),
'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority'),
'project_id':fields.many2one('project.project', 'Project',readonly=True),
+ 'type_id': fields.many2one('crm.case.resource.type', 'Type', domain="[('object_id.model', '=', 'project.issue')]"),
'date_closed': fields.datetime('Close Date', readonly=True),
- 'date_open': fields.datetime('Opened', readonly=True),
'assigned_to' : fields.many2one('res.users', 'Assigned to',readonly=True),
'partner_id': fields.many2one('res.partner','Partner',domain="[('object_id.model', '=', 'project.issue')]"),
'canal_id': fields.many2one('res.partner.canal', 'Channel',readonly=True),
- 'task_id': fields.many2one('project.task', 'Task',domain="[('object_id.model', '=', 'project.issue')]" ),
- 'partner_address_id': fields.many2one('res.partner.address','Contact ',readonly=True),
+ 'task_id': fields.many2one('project.task', 'Task',domain="[('object_id.model', '=', 'project.issue')]" )
}
def init(self, cr):
tools.drop_view_if_exists(cr, 'project_issue_report')
@@ -97,20 +95,19 @@ class project_issue_report(osv.osv):
c.user_id,
c.section_id,
c.categ_id,
+ c.stage_id,
to_char(c.date_closed, 'YYYY/mm/dd') as date_closed,
u.company_id as company_id,
c.priority as priority,
c.project_id as project_id,
+ c.type_id as type_id,
count(*) as nbr,
c.assigned_to,
c.partner_id,
c.canal_id,
c.task_id,
- c.partner_address_id as partner_address_id,
- c.date_open as date_open,
date_trunc('day',c.create_date) as create_date,
- avg(extract('epoch' from (c.date_closed-c.create_date)))/(3600*24) as delay_close,
- avg(extract('epoch' from (c.date_open-c.create_date)))/(3600*24) as delay_open
+ avg(extract('epoch' from (c.date_closed-c.create_date)))/(3600*24) as delay_close
from
project_issue c
left join
@@ -123,17 +120,17 @@ class project_issue_report(osv.osv):
c.user_id,
c.section_id,
c.categ_id,
+ c.stage_id,
c.date_closed,
u.company_id,
c.priority,
c.project_id,
+ c.type_id,
date_trunc('day',c.create_date),
c.assigned_to,
c.partner_id,
c.canal_id,
- c.task_id,
- c.date_open,
- c.partner_address_id
+ c.task_id
)""")
@@ -141,4 +138,4 @@ project_issue_report()
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file
diff --git a/addons/project_issue/report/project_issue_report_view.xml b/addons/project_issue/report/project_issue_report_view.xml
index f15d734f2ab..5729698392f 100644
--- a/addons/project_issue/report/project_issue_report_view.xml
+++ b/addons/project_issue/report/project_issue_report_view.xml
@@ -11,22 +11,23 @@
<field name="name" invisible="1"/>
<field name="month" invisible="1"/>
<field name="project_id" invisible="1"/>
+ <field name="stage_id" invisible="1"/>
+ <field name="type_id" string="Type" invisible="1"/>
<field name="priority" invisible="1"/>
<field name="company_id" invisible="1" groups="base.group_multi_company"/>
+ <field name="delay_close" avg='Avg Closing Delay'/>
<field name="section_id" invisible="1"/>
<field name="user_id" invisible="1"/>
<field name="categ_id" invisible="1"/>
+ <field name="canal_id" invisible="1"/>
<field name="partner_id" invisible="1"/>
+ <field name="task_id" invisible="1"/>
<field name="assigned_to" invisible="1"/>
- <field name="date_open" invisible="1"/>
<field name="date_closed" invisible="1"/>
<field name="create_date" invisible="1"/>
<field name="state" invisible="1"/>
<field name="day" invisible="1"/>
- <field name="partner_address_id" string="Contact" invisible="1"/>
<field name="nbr" string="#Project Issue" sum='#Number of Project Issue'/>
- <field name="delay_open" avg='Avg Opening Delay'/>
- <field name="delay_close" avg='Avg Closing Delay'/>
</tree>
</field>
</record>
@@ -35,7 +36,7 @@
<field name="model">project.issue.report</field>
<field name="type">graph</field>
<field name="arch" type="xml">
- <graph orientation="vertical" string="Project Issue" type="bar">
+ <graph orientation="horizontal" string="Project Issue" type="bar">
<field name="state"/>
<field name="nbr" operator="+"/>
<field group="True" name="user_id"/>
@@ -50,10 +51,14 @@
<field name="arch" type="xml">
<search string="Search">
<group col="16" colspan="8">
- <filter icon="gtk-media-rewind" string="365 Days" icon="terp-hr"
+ <!-- <filter string="This Year" name="This Year" icon="terp-hr"
+ domain="[('name','=',time.localtime()[0])]"/>-->
+ <filter string="This Year" icon="terp-hr"
domain="[('create_date','&lt;=', time.strftime('%%Y-%%m-%%d')), ('create_date','&gt;',(datetime.date.today()-datetime.timedelta(days=365)).strftime('%%Y-%%m-%%d'))]"/>
- <filter icon="gtk-media-rewind" string="30 Days" icon="terp-hr" name="This Month"
+ <!-- <filter string="This Month" name="This Year" icon="terp-hr"
+ domain="[('month','=',time.strftime('%%m'))]" />-->
+ <filter string="This Month" icon="terp-hr" name="This Month"
domain="[('create_date','&lt;=', time.strftime('%%Y-%%m-%%d')), ('create_date','&gt;',(datetime.date.today()-datetime.timedelta(days=30)).strftime('%%Y-%%m-%%d'))]"/>
<filter icon="gtk-media-rewind" string="7 Days" separator="1"
@@ -104,50 +109,68 @@
<field name="project_id" widget="selection" />
<field name="priority" />
<separator orientation="vertical"/>
-<<<<<<< TREE
-=======
<field name="type_id" widget="selection" domain="[('object_id.model', '=', 'project.issue')]"/>
->>>>>>> MERGE-SOURCE
- <separator orientation="vertical"/>
- <newline/>
- <field name="categ_id" widget="selection" domain="[('object_id.model', '=', 'project.issue')]"/>
-<<<<<<< TREE
-=======
- <field name="stage_id" widget="selection" domain="[('object_id.model', '=', 'project.issue')]" />
->>>>>>> MERGE-SOURCE
+ <field name="task_id"/>
<separator orientation="vertical"/>
<field name="assigned_to" widget="selection">
<filter icon="terp-crm" help = "Project Issue Assigned To Me" domain="[('assigned_to','=',uid)]" />
<filter icon="terp-crm" help="Non Assigned Project Issue" domain="[('assigned_to','=',False)]"/>
</field>
+ <newline/>
+ <field name="categ_id" widget="selection" domain="[('object_id.model', '=', 'project.issue')]"/>
+ <field name="stage_id" widget="selection" domain="[('object_id.model', '=', 'project.issue')]" />
<separator orientation="vertical"/>
<field name="partner_id" />
- <field name="partner_address_id" />
- <newline/>
- <field name="date_open" string="Date Open"/>
+ <field name="canal_id" widget="selection"/>
+ <separator orientation="vertical"/>
<field name="date_closed" string="Date Closed"/>
</group>
- </xpath>
- <xpath expr='//search[@string="Search"]/group[@string="Group By..."]/filter[@string="Category"]' position='after'>
-<<<<<<< TREE
-=======
- <filter string="Stage" icon="terp-sale" domain="[]" context="{'group_by':'stage_id'}"/>
->>>>>>> MERGE-SOURCE
- <separator orientation="vertical"/>
- <filter string="Project" icon="terp-sale" domain="[]" context="{'group_by':'project_id'}" />
- <filter string="Priority" icon="terp-sale" domain="[]" context="{'group_by':'priority'}" />
- <separator orientation="vertical"/>
-<<<<<<< TREE
-=======
- <filter string="Type" icon="terp-sale" domain="[]" context="{'group_by':'type_id'}"/>
->>>>>>> MERGE-SOURCE
- <separator orientation="vertical"/>
- <filter string="Assigned To" icon="terp-sale" domain="[]" context="{'group_by':'assigned_to'}"/>
- <separator orientation="vertical"/>
- <filter string="Partner" icon="terp-sale" domain="[]" context="{'group_by':'partner_id'}"/>
- <filter string="Contact" icon="terp-sale" domain="[]" context="{'group_by':'partner_address_id'}"/>
- </xpath>
- </data>
+
+ </group>
+ <newline/>
+ <group expand="1" string="Group By..." colspan="4" col="8">
+ <filter string="User" name="User" icon="terp-sale"
+ domain="[]" context="{'group_by':'user_id'}" />
+
+ <filter string="Company" icon="terp-sale"
+ domain="[]"
+ context="{'group_by':'company_id'}" />
+
+ <filter string="Section" icon="terp-sale"
+ domain="[]"
+ context="{'group_by':'section_id'}" />
+
+ <separator orientation="vertical" />
+ <filter string="State" icon="terp-sale"
+ domain="[]" context="{'group_by':'state'}" />
+
+ <filter string="Category" icon="terp-sale"
+ domain="[]" context="{'group_by':'categ_id'}" />
+
+ <filter string="Stage" icon="terp-sale" domain="[]" context="{'group_by':'stage_id'}"/>
+ <separator orientation="vertical"/>
+ <filter string="Project" icon="terp-sale" domain="[]" context="{'group_by':'project_id'}" />
+ <filter string="Priority" icon="terp-sale" domain="[]" context="{'group_by':'priority'}" />
+ <separator orientation="vertical"/>
+ <filter string="Type" icon="terp-sale" domain="[]" context="{'group_by':'type_id'}"/>
+ <filter string="Task" icon="terp-sale" domain="[]" context="{'group_by':'task_id'}"/>
+ <newline/>
+ <filter string="Assigned To" icon="terp-sale" domain="[]" context="{'group_by':'assigned_to'}"/>
+ <filter string="Partner" icon="terp-sale" domain="[]" context="{'group_by':'partner_id'}"/>
+ <filter string="Channel" icon="terp-sale" domain="[]" context="{'group_by':'canal_id'}"/>
+
+ <separator orientation="vertical" />
+ <filter string="Day" icon="terp-sale"
+ domain="[]" context="{'group_by':'day'}"/>
+
+ <filter string="Month" icon="terp-sale"
+ domain="[]" context="{'group_by':'month'}" />
+
+ <filter string="Year" icon="terp-sale"
+ domain="[]" context="{'group_by':'name'}" />
+
+ </group>
+ </search>
</field>
</record>