From bf266e764a926d3e47149cb6d47886525317f511 Mon Sep 17 00:00:00 2001
From: "rch (Open ERP)" <>
Date: Mon, 26 Apr 2010 12:08:12 +0530
Subject: [PATCH 01/61] [IMP]: Improve SQL view report for crm.lead.
bzr revid: rch_open_erp-20100426063812-6e8ldx12o32cdosy
---
addons/crm/report/crm_claim_report.py | 2 +-
addons/crm/report/crm_lead_report.py | 12 ++++++++++++
addons/crm/report/crm_lead_report_view.xml | 19 +++++++++++++++++++
addons/crm/report/crm_report_view.xml | 7 ++++---
4 files changed, 36 insertions(+), 4 deletions(-)
diff --git a/addons/crm/report/crm_claim_report.py b/addons/crm/report/crm_claim_report.py
index 4148a834810..70d6be8d616 100644
--- a/addons/crm/report/crm_claim_report.py
+++ b/addons/crm/report/crm_claim_report.py
@@ -82,7 +82,7 @@ class crm_claim_report(osv.osv):
group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'), \
c.state, c.user_id,c.section_id, c.stage_id,\
c.categ_id,c.partner_id,c.company_id,c.create_date,to_char(c.create_date, 'YYYY-MM-DD')
- ,c.priority,c.type_id,c.som
+ ,c.priority,c.type_id
)""")
crm_claim_report()
diff --git a/addons/crm/report/crm_lead_report.py b/addons/crm/report/crm_lead_report.py
index d400700c0b5..92aeb7f28ec 100644
--- a/addons/crm/report/crm_lead_report.py
+++ b/addons/crm/report/crm_lead_report.py
@@ -21,6 +21,7 @@
from osv import fields,osv
import tools
+import crm_report
AVAILABLE_STATES = [
('draft','Draft'),
@@ -47,6 +48,12 @@ class crm_lead_report(osv.osv):
('object_id.model', '=', 'crm.lead')]", readonly=True),
'partner_id': fields.many2one('res.partner', 'Partner' , readonly=True),
'company_id': fields.many2one('res.company', 'Company', readonly=True),
+ 'priority': fields.selection(crm_report.AVAILABLE_PRIORITIES, 'Priority'),
+ 'type_id': fields.many2one('crm.case.resource.type', 'Lead Type', \
+ domain="[('section_id','=',section_id),\
+ ('object_id.model', '=', 'crm.lead')]"),
+ 'date_closed': fields.datetime('Closed', readonly=True),
+ 'date_open': fields.datetime('Opened', readonly=True),
}
def init(self, cr):
@@ -74,6 +81,10 @@ class crm_lead_report(osv.osv):
0 as avg_answers,
0.0 as perc_done,
0.0 as perc_cancel,
+ c.priority as priority,
+ c.type_id as type_id,
+ c.date_closed as date_closed,
+ 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
from
@@ -81,6 +92,7 @@ class crm_lead_report(osv.osv):
group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'),\
c.state, c.user_id,c.section_id,c.stage_id,categ_id,c.partner_id,c.company_id
,c.create_date,to_char(c.create_date, 'YYYY-MM-DD')
+ ,c.priority,c.type_id,c.date_closed,c.date_open
)""")
crm_lead_report()
diff --git a/addons/crm/report/crm_lead_report_view.xml b/addons/crm/report/crm_lead_report_view.xml
index d6502c190d9..6ef0d90ac97 100644
--- a/addons/crm/report/crm_lead_report_view.xml
+++ b/addons/crm/report/crm_lead_report_view.xml
@@ -22,6 +22,10 @@
+
+
+
+
@@ -70,6 +74,12 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/crm/report/crm_report_view.xml b/addons/crm/report/crm_report_view.xml
index 97fa4feb6f1..b4e18793af4 100644
--- a/addons/crm/report/crm_report_view.xml
+++ b/addons/crm/report/crm_report_view.xml
@@ -106,9 +106,10 @@
help="My company"/>
-
-
-
+
+
+
+
From b8947954bf8ab4e410272937621815f73b1cdd98 Mon Sep 17 00:00:00 2001
From: "rch (Open ERP)" <>
Date: Mon, 26 Apr 2010 12:56:32 +0530
Subject: [PATCH 02/61] [IMP]: Improve SQL view for crm fundraising.
bzr revid: rch_open_erp-20100426072632-wcny8y4x5ud18y4t
---
addons/crm/report/crm_fundraising_report.py | 8 ++++++--
addons/crm/report/crm_fundraising_report_view.xml | 11 +++++++++++
2 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/addons/crm/report/crm_fundraising_report.py b/addons/crm/report/crm_fundraising_report.py
index af867ea0008..2b3fbcb4c7a 100644
--- a/addons/crm/report/crm_fundraising_report.py
+++ b/addons/crm/report/crm_fundraising_report.py
@@ -21,7 +21,7 @@
from osv import fields,osv
import tools
-
+import crm_report
class crm_fundraising_report(osv.osv):
"""CRM Fundraising Report"""
@@ -41,6 +41,8 @@ class crm_fundraising_report(osv.osv):
'delay_close': fields.float('Delay to close', digits=(16,2),readonly=True, group_operator="avg",help="Number of Days to close the case"),
'partner_id': fields.many2one('res.partner', 'Partner'),
'company_id': fields.many2one('res.company', 'Company'),
+ 'priority': fields.selection(crm_report.AVAILABLE_PRIORITIES, 'Priority'),
+ 'date_closed': fields.datetime('Closed', readonly=True)
}
def init(self, cr):
@@ -67,6 +69,8 @@ class crm_fundraising_report(osv.osv):
0 as avg_answers,
0.0 as perc_done,
0.0 as perc_cancel,
+ c.priority as priority,
+ c.date_closed as date_closed,
date_trunc('day',c.create_date) as create_date,
sum(planned_revenue) as amount_revenue,
sum(planned_revenue*probability)::decimal(16,2) as amount_revenue_prob,
@@ -76,7 +80,7 @@ class crm_fundraising_report(osv.osv):
crm_fundraising c
group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'),\
c.state, c.user_id,c.section_id,c.categ_id,c.partner_id,c.company_id,
- c.create_date,to_char(c.create_date, 'YYYY-MM-DD')
+ c.create_date,to_char(c.create_date, 'YYYY-MM-DD'),c.priority,c.date_closed
)""")
crm_fundraising_report()
diff --git a/addons/crm/report/crm_fundraising_report_view.xml b/addons/crm/report/crm_fundraising_report_view.xml
index e1c32726b4f..1d97b868a34 100644
--- a/addons/crm/report/crm_fundraising_report_view.xml
+++ b/addons/crm/report/crm_fundraising_report_view.xml
@@ -24,6 +24,8 @@
+
+
@@ -73,8 +75,17 @@
+
+
+
+
+
+
From c70951059ee26059ace2a45e88855d5a56bff2b9 Mon Sep 17 00:00:00 2001
From: apa-tiny
Date: Mon, 26 Apr 2010 13:55:43 +0530
Subject: [PATCH 03/61] [IMP]:mrp:Improved SQL report.(Production).
bzr revid: apa@tinyerp.com-20100426082543-0yk10z2xhx05rj1t
---
addons/mrp/report/mrp_production_order.py | 20 ++--
.../mrp/report/mrp_production_order_view.xml | 91 ++++++++++++-------
2 files changed, 71 insertions(+), 40 deletions(-)
diff --git a/addons/mrp/report/mrp_production_order.py b/addons/mrp/report/mrp_production_order.py
index 7f48b111d43..96910e205d7 100644
--- a/addons/mrp/report/mrp_production_order.py
+++ b/addons/mrp/report/mrp_production_order.py
@@ -27,12 +27,14 @@ class mrp_production_order(osv.osv):
_description = "Production Order Report"
_auto = False
_columns = {
- 'name': fields.char('Year',size=64,required=False, readonly=True),
+ 'year': fields.char('Year',size=64,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),
+ 'day': fields.char('Day',size=64,readonly=True),
'origin': fields.char('Source Document', size=64),
'nbr': fields.integer('# of Orders', readonly=True),
- 'product_id': fields.many2one('product.product', 'Product', readonly=True, domain=[('type','<>','service')]),
+ 'date': fields.date('Date', readonly=True),
+ 'product_id': fields.many2one('product.product', 'Product', readonly=True),
'product_qty': fields.float('Product Qty', readonly=True),
'state': fields.selection([('draft','Draft'),
('picking_except', 'Picking Exception'),
@@ -43,13 +45,13 @@ class mrp_production_order(osv.osv):
('done','Done')],
'State', readonly=True),
'date_planned':fields.date('Scheduled Date'),
- 'location_src_id': fields.many2one('stock.location', 'Raw Materials Location', required=True),
+ 'location_src_id': fields.many2one('stock.location', 'Raw Materials Location', readonly=True),
'date_start': fields.datetime('Start Date',readonly=True),
'date_finnished': fields.datetime('End Date',readonly=True),
- 'location_dest_id': fields.many2one('stock.location', 'Finished Products Location', required=True),
+ 'location_dest_id': fields.many2one('stock.location', 'Finished Products Location', readonly=True),
'company_id': fields.many2one('res.company','Company',readonly=True),
- 'bom_id': fields.many2one('mrp.bom', 'Bill of Material', domain=[('bom_id','=',False)],readonly=True),
- 'routing_id': fields.many2one('mrp.routing', string='Routing', on_delete='set null',readonly=True),
+ 'bom_id': fields.many2one('mrp.bom', 'Bill of Material',readonly=True),
+ 'routing_id': fields.many2one('mrp.routing', string='Routing',readonly=True),
'picking_id': fields.many2one('stock.picking', 'Picking list', readonly=True),
'priority': fields.selection([('0','Not urgent'),
('1','Normal'),
@@ -65,8 +67,10 @@ class mrp_production_order(osv.osv):
create or replace view mrp_production_order as (
select
min(l.id) as id,
- to_char(s.create_date, 'YYYY') as name,
+ to_date(to_char(s.create_date, 'MM-dd-YYYY'),'MM-dd-YYYY') as date,
+ to_char(s.create_date, 'YYYY') as year,
to_char(s.create_date, 'MM') as month,
+ to_char(s.create_date, 'YYYY-MM-DD') as day,
l.product_id as product_id,
sum(l.product_qty * u.factor) as product_qty,
s.company_id as company_id,
@@ -90,6 +94,8 @@ class mrp_production_order(osv.osv):
group by
to_char(s.create_date, 'YYYY'),
to_char(s.create_date, 'MM'),
+ to_char(s.create_date, 'YYYY-MM-DD'),
+ to_date(to_char(s.create_date, 'MM-dd-YYYY'),'MM-dd-YYYY'),
l.product_id,
l.product_uom,
s.bom_id,
diff --git a/addons/mrp/report/mrp_production_order_view.xml b/addons/mrp/report/mrp_production_order_view.xml
index a97abe846de..04188f43752 100644
--- a/addons/mrp/report/mrp_production_order_view.xml
+++ b/addons/mrp/report/mrp_production_order_view.xml
@@ -11,18 +11,21 @@
tree
-
-
-
-
+
+
+
+
-
+
-
+
+
+
+
@@ -35,8 +38,9 @@
graph
-
+
+
@@ -48,48 +52,70 @@
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
+
+
+
+
+
+
+
+
+
+
-
+
+
+
-
+
-
+
@@ -101,8 +127,7 @@
tree,graph
- {'search_default_Product': 1}
-
+ {'search_default_month':1,'search_default_Product':1,'group_by_no_leaf':1,'group_by':[]}
From 68ac3e6fa806ea369d0118425f6e53e0c83df36c Mon Sep 17 00:00:00 2001
From: "rch (Open ERP)" <>
Date: Mon, 26 Apr 2010 15:31:40 +0530
Subject: [PATCH 04/61] [IMP]: Improve SQL view report of claim,lead and
fundraising.
bzr revid: rch_open_erp-20100426100140-n0ppf5ddggbungbs
---
addons/crm/report/crm_claim_report.py | 8 +++++++-
addons/crm/report/crm_claim_report_view.xml | 13 +++++++++++++
addons/crm/report/crm_fundraising_report.py | 7 ++++++-
addons/crm/report/crm_fundraising_report_view.xml | 12 +++++++++++-
4 files changed, 37 insertions(+), 3 deletions(-)
diff --git a/addons/crm/report/crm_claim_report.py b/addons/crm/report/crm_claim_report.py
index 70d6be8d616..74b95864759 100644
--- a/addons/crm/report/crm_claim_report.py
+++ b/addons/crm/report/crm_claim_report.py
@@ -46,6 +46,9 @@ class crm_claim_report(osv.osv):
'type_id': fields.many2one('crm.case.resource.type', 'Claim Type',\
domain="[('section_id','=',section_id),\
('object_id.model', '=', 'crm.claim')]"),
+ 'date_closed': fields.datetime('Closed', readonly=True),
+ 'canal_id': fields.many2one('res.partner.canal','Channel',domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.claim')]"),
+ 'som': fields.many2one('res.partner.som', 'State of Mind')
}
def init(self, cr):
@@ -75,6 +78,9 @@ class crm_claim_report(osv.osv):
0.0 as perc_cancel,
c.priority as priority,
c.type_id as type_id,
+ c.date_closed as date_closed,
+ c.canal_id as canal_id,
+ c.som as som,
date_trunc('day',c.create_date) as create_date,
avg(extract('epoch' from (c.date_closed-c.create_date)))/(3600*24) as delay_close
from
@@ -82,7 +88,7 @@ class crm_claim_report(osv.osv):
group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'), \
c.state, c.user_id,c.section_id, c.stage_id,\
c.categ_id,c.partner_id,c.company_id,c.create_date,to_char(c.create_date, 'YYYY-MM-DD')
- ,c.priority,c.type_id
+ ,c.priority,c.type_id,c.date_closed,c.canal_id,c.som
)""")
crm_claim_report()
diff --git a/addons/crm/report/crm_claim_report_view.xml b/addons/crm/report/crm_claim_report_view.xml
index 647a0125179..74ebbd56d0b 100644
--- a/addons/crm/report/crm_claim_report_view.xml
+++ b/addons/crm/report/crm_claim_report_view.xml
@@ -24,6 +24,9 @@
+
+
+
@@ -78,6 +81,11 @@
+
+
+
+
+
+
+
+
diff --git a/addons/crm/report/crm_fundraising_report.py b/addons/crm/report/crm_fundraising_report.py
index 2b3fbcb4c7a..5765b7367b0 100644
--- a/addons/crm/report/crm_fundraising_report.py
+++ b/addons/crm/report/crm_fundraising_report.py
@@ -42,7 +42,9 @@ class crm_fundraising_report(osv.osv):
'partner_id': fields.many2one('res.partner', 'Partner'),
'company_id': fields.many2one('res.company', 'Company'),
'priority': fields.selection(crm_report.AVAILABLE_PRIORITIES, 'Priority'),
- 'date_closed': fields.datetime('Closed', readonly=True)
+ 'date_closed': fields.datetime('Closed', readonly=True),
+ 'canal_id': fields.many2one('res.partner.canal','Channel',domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.fundraising')]"),
+ 'som': fields.many2one('res.partner.som', 'State of Mind')
}
def init(self, cr):
@@ -71,6 +73,8 @@ class crm_fundraising_report(osv.osv):
0.0 as perc_cancel,
c.priority as priority,
c.date_closed as date_closed,
+ c.canal_id as canal_id,
+ c.som as som,
date_trunc('day',c.create_date) as create_date,
sum(planned_revenue) as amount_revenue,
sum(planned_revenue*probability)::decimal(16,2) as amount_revenue_prob,
@@ -81,6 +85,7 @@ class crm_fundraising_report(osv.osv):
group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'),\
c.state, c.user_id,c.section_id,c.categ_id,c.partner_id,c.company_id,
c.create_date,to_char(c.create_date, 'YYYY-MM-DD'),c.priority,c.date_closed
+ ,c.canal_id,c.som
)""")
crm_fundraising_report()
diff --git a/addons/crm/report/crm_fundraising_report_view.xml b/addons/crm/report/crm_fundraising_report_view.xml
index 1d97b868a34..7236df4a8b4 100644
--- a/addons/crm/report/crm_fundraising_report_view.xml
+++ b/addons/crm/report/crm_fundraising_report_view.xml
@@ -26,6 +26,8 @@
+
+
@@ -77,7 +79,10 @@
-
+
+
+
+
+
+
+
From 2eeb2a1f7981a68aec561ade79c12e6ae3e924fd Mon Sep 17 00:00:00 2001
From: "rch (Open ERP)" <>
Date: Mon, 26 Apr 2010 16:59:00 +0530
Subject: [PATCH 05/61] [IMP]: Improve SQL view report for crm oppertunities.
Add fields in Extended option in search view.
bzr revid: rch_open_erp-20100426112900-cfx18360ey1p6zqo
---
addons/crm/report/crm_opportunity_report.py | 12 +++++++++++-
addons/crm/report/crm_opportunity_report_view.xml | 13 ++++++++++++-
2 files changed, 23 insertions(+), 2 deletions(-)
diff --git a/addons/crm/report/crm_opportunity_report.py b/addons/crm/report/crm_opportunity_report.py
index a3af4be8b7c..3e11307ee36 100644
--- a/addons/crm/report/crm_opportunity_report.py
+++ b/addons/crm/report/crm_opportunity_report.py
@@ -21,6 +21,7 @@
from osv import fields,osv
import tools
+import crm_report
AVAILABLE_STATES = [
('draft','Draft'),
@@ -50,6 +51,9 @@ class crm_opportunity_report(osv.osv):
'partner_id': fields.many2one('res.partner', 'Partner', readonly=True),
'company_id': fields.many2one('res.company', 'Company', readonly=True),
'user_id':fields.many2one('res.users', 'User', readonly=True),
+ 'date_closed': fields.datetime('Closed', readonly=True),
+ 'date_open': fields.datetime('Opened', readonly=True),
+ 'priority': fields.selection(crm_report.AVAILABLE_PRIORITIES, 'Priority')
}
def init(self, cr):
@@ -76,6 +80,9 @@ class crm_opportunity_report(osv.osv):
0 as avg_answers,
0.0 as perc_done,
0.0 as perc_cancel,
+ c.date_closed as date_closed,
+ c.date_open as date_open,
+ c.priority as priority,
date_trunc('day',c.create_date) as create_date,
sum(planned_revenue) as amount_revenue,
sum((planned_revenue*probability)/100.0)::decimal(16,2) as amount_revenue_prob,
@@ -94,7 +101,10 @@ class crm_opportunity_report(osv.osv):
c.categ_id,
c.partner_id,
company_id,
- create_date
+ create_date,
+ c.date_closed,
+ c.date_open,
+ c.priority
)""")
crm_opportunity_report()
diff --git a/addons/crm/report/crm_opportunity_report_view.xml b/addons/crm/report/crm_opportunity_report_view.xml
index 29a66b838f0..3daa72c717c 100644
--- a/addons/crm/report/crm_opportunity_report_view.xml
+++ b/addons/crm/report/crm_opportunity_report_view.xml
@@ -25,6 +25,9 @@
+
+
+
@@ -75,7 +78,13 @@
+
+
+
+
+
+
-
+
+
From 97ae945f3a8b81ef5387e8768cf67148c7195f10 Mon Sep 17 00:00:00 2001
From: "rch (Open ERP)" <>
Date: Mon, 26 Apr 2010 19:14:14 +0530
Subject: [PATCH 06/61] [IMP]: Improve SQL view report for crm phonecalls. Add
fields in Extended Option of search view.
bzr revid: rch_open_erp-20100426134414-44oq5wfkhs8y7jc1
---
addons/crm/report/crm_phonecall_report.py | 10 +++++++++
.../crm/report/crm_phonecall_report_view.xml | 21 +++++++++++++++++++
2 files changed, 31 insertions(+)
diff --git a/addons/crm/report/crm_phonecall_report.py b/addons/crm/report/crm_phonecall_report.py
index 40b34779aba..c5109602eb3 100644
--- a/addons/crm/report/crm_phonecall_report.py
+++ b/addons/crm/report/crm_phonecall_report.py
@@ -21,6 +21,7 @@
from osv import fields,osv
import tools
+import crm_report
class crm_phonecall_report(osv.osv):
""" Phone calls by user and section """
@@ -37,6 +38,10 @@ class crm_phonecall_report(osv.osv):
('object_id.model', '=', 'crm.phonecall')]"),
'partner_id': fields.many2one('res.partner', 'Partner' , readonly=True),
'company_id': fields.many2one('res.company', 'Company', readonly=True),
+ 'priority': fields.selection(crm_report.AVAILABLE_PRIORITIES, 'Priority'),
+ 'date_closed': fields.datetime('Closed', readonly=True),
+ 'opportunity_id': fields.many2one ('crm.opportunity', 'Opportunity'),
+ 'canal_id': fields.many2one('res.partner.canal','Channel',domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.phonecall')]")
}
def init(self, cr):
@@ -63,6 +68,10 @@ class crm_phonecall_report(osv.osv):
0 as avg_answers,
0.0 as perc_done,
0.0 as perc_cancel,
+ c.priority as priority,
+ c.date_closed as date_closed,
+ c.opportunity_id as opportunity_id,
+ c.canal_id as canal_id,
date_trunc('day',c.create_date) as create_date,
avg(extract('epoch' from (c.date_closed-c.create_date)))/(3600*24) as delay_close
from
@@ -70,6 +79,7 @@ class crm_phonecall_report(osv.osv):
group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'),\
c.state, c.user_id,c.section_id, c.categ_id,c.partner_id,c.company_id
,to_char(c.create_date, 'YYYY-MM-DD'),c.create_date
+ ,c.priority,c.date_closed,opportunity_id,canal_id
)""")
crm_phonecall_report()
diff --git a/addons/crm/report/crm_phonecall_report_view.xml b/addons/crm/report/crm_phonecall_report_view.xml
index 698a9b88fa3..5ad0a63bdd8 100644
--- a/addons/crm/report/crm_phonecall_report_view.xml
+++ b/addons/crm/report/crm_phonecall_report_view.xml
@@ -21,6 +21,10 @@
+
+
+
+
@@ -70,8 +74,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
From bb50f760f7357ae2ca1546969ebd30ac0c09a0e0 Mon Sep 17 00:00:00 2001
From: apa-tiny
Date: Tue, 27 Apr 2010 15:13:43 +0530
Subject: [PATCH 07/61] [IMP]:hr_holidays:Improved SQL report.(Leaves).
bzr revid: apa@tinyerp.com-20100427094343-mbfa6xv6mgri5xqj
---
.../hr_holidays/report/hr_holidays_report.py | 17 ++-
.../report/hr_holidays_report_view.xml | 109 +++++++++++-------
2 files changed, 81 insertions(+), 45 deletions(-)
diff --git a/addons/hr_holidays/report/hr_holidays_report.py b/addons/hr_holidays/report/hr_holidays_report.py
index 435eee71ea5..c060521af0d 100644
--- a/addons/hr_holidays/report/hr_holidays_report.py
+++ b/addons/hr_holidays/report/hr_holidays_report.py
@@ -30,14 +30,17 @@ class hr_holidays_report(osv.osv):
_columns = {
'date': fields.datetime('Date', readonly=True),
'year': fields.char('Year', size=4, readonly=True),
+ 'day': fields.char('Day', size=15, 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),
'date_from' : fields.datetime('Start Date', readonly=True),
'date_to' : fields.datetime('End Date', readonly=True),
- 'number_of_days_temp': fields.float('Number of Days', readonly=True),
+ 'number_of_days_temp': fields.float('#Days', readonly=True),
'employee_id' : fields.many2one('hr.employee', "Employee's Name",readonly=True),
'user_id':fields.many2one('res.users', 'User', readonly=True),
+ 'holiday_status_id' : fields.many2one("hr.holidays.status", "Leave Type",readonly=True),
+ 'department_id':fields.many2one('hr.department','Department',readonly=True),
'state': fields.selection([('draft', 'Draft'),
('confirm', 'Waiting Validation'),
('refuse', 'Refused'),
@@ -52,21 +55,25 @@ class hr_holidays_report(osv.osv):
create or replace view hr_holidays_report as (
select
min(s.id) as id,
- date_trunc('seconds',s.create_date) as date,
+ date_trunc('day',s.create_date) as date,
date_trunc('day',s.date_from) as date_from,
date_trunc('day',s.date_to) as date_to,
- s.number_of_days_temp,
+ sum(s.number_of_days_temp) as number_of_days_temp,
s.employee_id,
s.user_id as user_id,
to_char(s.create_date, 'YYYY') as year,
to_char(s.create_date, 'MM') as month,
+ to_char(s.create_date, 'YYYY-MM-DD') as day,
+ s.holiday_status_id,
+ s.department_id,
s.state
from
hr_holidays s
where type='remove'
group by
s.create_date,s.state,s.date_from,s.date_to,
- s.number_of_days_temp,s.employee_id,s.user_id
+ s.employee_id,s.user_id,s.holiday_status_id,
+ s.department_id
)
""")
hr_holidays_report()
@@ -98,7 +105,7 @@ class hr_holidays_remaining_leaves_user(osv.osv):
where
hrs.employee_id = hre.id and
hre.resource_id = rr.id and
- hhs.id = hrs.holiday_status_id
+ hhs.id = hrs.holiday_status_id
group by
rr.name,rr.user_id,hhs.name
)
diff --git a/addons/hr_holidays/report/hr_holidays_report_view.xml b/addons/hr_holidays/report/hr_holidays_report_view.xml
index e9e0e6aae36..c5f2a41afb7 100644
--- a/addons/hr_holidays/report/hr_holidays_report_view.xml
+++ b/addons/hr_holidays/report/hr_holidays_report_view.xml
@@ -7,14 +7,17 @@
tree
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
@@ -27,6 +30,7 @@
+
@@ -37,44 +41,69 @@
search
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
-
-
+
+
+
@@ -85,7 +114,7 @@
hr.holidays.report
form
tree,graph
- {'search_default_employee': 1}
+ {'search_default_month':1,'search_default_Employee':1,'group_by_no_leaf':1,'group_by':[]}
From 091e1c13c9fc901ffe3876e61cc88c95ff002e07 Mon Sep 17 00:00:00 2001
From: apa-tiny
Date: Tue, 27 Apr 2010 15:44:34 +0530
Subject: [PATCH 08/61] [IMP]:hr_holidays:Improved SQL report.(Leaves).
bzr revid: apa@tinyerp.com-20100427101434-du3rqytyaiaheq55
---
addons/hr_holidays/report/hr_holidays_report_view.xml | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/addons/hr_holidays/report/hr_holidays_report_view.xml b/addons/hr_holidays/report/hr_holidays_report_view.xml
index c5f2a41afb7..8c8bc58204c 100644
--- a/addons/hr_holidays/report/hr_holidays_report_view.xml
+++ b/addons/hr_holidays/report/hr_holidays_report_view.xml
@@ -9,6 +9,7 @@
+
@@ -68,7 +69,8 @@
domain="[('state','=','validate')]"
help = "Pending Leaves"/>
-
+
+
@@ -95,9 +97,10 @@
-
-
+
+
+
@@ -114,7 +117,7 @@
hr.holidays.report
form
tree,graph
- {'search_default_month':1,'search_default_Employee':1,'group_by_no_leaf':1,'group_by':[]}
+ {'search_default_month':1,'search_default_User':1,'group_by_no_leaf':1,'group_by':[]}
From cfb21e74972a0174dfe552449a0a6e813be6328a Mon Sep 17 00:00:00 2001
From: apa-tiny
Date: Tue, 27 Apr 2010 15:53:03 +0530
Subject: [PATCH 09/61] [IMP]:hr_holidays:Improved SQL report.(Leaves).
bzr revid: apa@tinyerp.com-20100427102303-98gutwonfqyd4lbu
---
addons/hr_holidays/report/available_holidays.py | 2 +-
addons/hr_holidays/report/hr_holidays_report.py | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/addons/hr_holidays/report/available_holidays.py b/addons/hr_holidays/report/available_holidays.py
index 4a1972f1f7d..fd9d77a62ff 100644
--- a/addons/hr_holidays/report/available_holidays.py
+++ b/addons/hr_holidays/report/available_holidays.py
@@ -25,7 +25,7 @@ class available_holidays_report(osv.osv):
_name = "available.holidays.report"
_auto = False
_columns = {
- 'date': fields.datetime('Date', readonly=True),
+ 'date': fields.date('Date', readonly=True),
'year': fields.char('Year', size=4, readonly=True),
'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'),
('05','May'), ('06','June'), ('07','July'), ('08','August'), ('09','September'),
diff --git a/addons/hr_holidays/report/hr_holidays_report.py b/addons/hr_holidays/report/hr_holidays_report.py
index c060521af0d..b44fe041e25 100644
--- a/addons/hr_holidays/report/hr_holidays_report.py
+++ b/addons/hr_holidays/report/hr_holidays_report.py
@@ -28,14 +28,14 @@ class hr_holidays_report(osv.osv):
_auto = False
_rec_name = 'date'
_columns = {
- 'date': fields.datetime('Date', readonly=True),
+ 'date': fields.date('Date', readonly=True),
'year': fields.char('Year', size=4, readonly=True),
'day': fields.char('Day', size=15, 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),
- 'date_from' : fields.datetime('Start Date', readonly=True),
- 'date_to' : fields.datetime('End Date', readonly=True),
+ 'date_from' : fields.date('Start Date', readonly=True),
+ 'date_to' : fields.date('End Date', readonly=True),
'number_of_days_temp': fields.float('#Days', readonly=True),
'employee_id' : fields.many2one('hr.employee', "Employee's Name",readonly=True),
'user_id':fields.many2one('res.users', 'User', readonly=True),
From efc69230d36501faf03f9136cf9be40e33ad5941 Mon Sep 17 00:00:00 2001
From: apa-tiny
Date: Tue, 27 Apr 2010 16:19:27 +0530
Subject: [PATCH 10/61] [IMP]:hr_holidays:Improved SQL report.(Available
Holidays).
bzr revid: apa@tinyerp.com-20100427104927-1683smsdb4g9xuvv
---
.../hr_holidays/report/available_holidays.py | 7 +-
.../report/available_holidays_view.xml | 73 ++++++++++---------
2 files changed, 44 insertions(+), 36 deletions(-)
diff --git a/addons/hr_holidays/report/available_holidays.py b/addons/hr_holidays/report/available_holidays.py
index fd9d77a62ff..5499a914f6c 100644
--- a/addons/hr_holidays/report/available_holidays.py
+++ b/addons/hr_holidays/report/available_holidays.py
@@ -27,6 +27,7 @@ class available_holidays_report(osv.osv):
_columns = {
'date': fields.date('Date', readonly=True),
'year': fields.char('Year', size=4, readonly=True),
+ 'day': fields.char('Day', size=15, 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),
@@ -35,6 +36,7 @@ class available_holidays_report(osv.osv):
'max_leave': fields.float('Allocated Leaves', readonly=True),
'taken_leaves': fields.float('Taken Leaves', readonly=True),
'remaining_leave': fields.float('Remaining Leaves',readonly=True),
+ 'department_id':fields.many2one('hr.department','Department',readonly=True),
'user_id':fields.many2one('res.users', 'User', readonly=True),
}
def init(self, cr):
@@ -46,8 +48,10 @@ class available_holidays_report(osv.osv):
date_trunc('day',h.create_date) as date,
to_char(s.create_date, 'YYYY') as year,
to_char(s.create_date, 'MM') as month,
+ to_char(s.create_date, 'YYYY-MM-DD') as day,
h.employee_id as employee_id,
h.user_id as user_id,
+ h.department_id,
h.state as state,
h.holiday_status_id as holiday_status_id,
sum(number_of_days) as remaining_leave,
@@ -68,7 +72,8 @@ class available_holidays_report(osv.osv):
and s.active <> 'f'
group by h.holiday_status_id, h.employee_id,
date_trunc('day',h.create_date),to_char(s.create_date, 'YYYY'),
- to_char(s.create_date, 'MM'),h.user_id,h.state
+ to_char(s.create_date, 'MM'),to_char(s.create_date, 'YYYY-MM-DD'),h.user_id,
+ h.state,h.department_id
)""")
available_holidays_report()
diff --git a/addons/hr_holidays/report/available_holidays_view.xml b/addons/hr_holidays/report/available_holidays_view.xml
index 18ea7d58d45..cb610d4214a 100644
--- a/addons/hr_holidays/report/available_holidays_view.xml
+++ b/addons/hr_holidays/report/available_holidays_view.xml
@@ -10,40 +10,32 @@
tree
-
-
-
-
+
+
+
+
+
-
+
+
-
- available.holidays.report.form
- available.holidays.report
- form
-
-
-
-
-
-
-
-
available.holidays.report.graph
available.holidays.report
graph
-
+
+
+
-
+
@@ -55,32 +47,42 @@
-
-
+
+
+
-
+
-
+
+
+
+
+
+
+
-
+
-
-
+
+
+
@@ -93,6 +95,7 @@
available.holidays.report
form
tree,graph
+ {'search_default_month':1,'search_default_User':1,'group_by_no_leaf':1,'group_by':[]}
From c445b5b47185e3039456b784a9ea11500ddcd289 Mon Sep 17 00:00:00 2001
From: "rch (Open ERP)" <>
Date: Tue, 27 Apr 2010 18:00:23 +0530
Subject: [PATCH 11/61] [Add]: Add SQL view report for Accounts.
bzr revid: rch_open_erp-20100427123023-npkej0o1ed0viscq
---
addons/account/__openerp__.py | 1 +
addons/account/report/__init__.py | 2 +-
.../account/report/account_account_report.py | 77 +++++++++++++++++
.../report/account_account_report_view.xml | 83 +++++++++++++++++++
addons/account/report/account_report_view.xml | 8 +-
5 files changed, 166 insertions(+), 5 deletions(-)
create mode 100644 addons/account/report/account_account_report.py
create mode 100644 addons/account/report/account_account_report_view.xml
diff --git a/addons/account/__openerp__.py b/addons/account/__openerp__.py
index abd3d1f459d..e73b3885089 100644
--- a/addons/account/__openerp__.py
+++ b/addons/account/__openerp__.py
@@ -100,6 +100,7 @@ module named account_voucherss
'report/account_invoice_report_view.xml',
'report/account_report_view.xml',
'report/account_analytic_report_view.xml',
+ 'report/account_account_report_view.xml'
],
'demo_xml': [
#'demo/price_accuracy00.yml',
diff --git a/addons/account/report/__init__.py b/addons/account/report/__init__.py
index 09ff866d1a8..959a76013f9 100644
--- a/addons/account/report/__init__.py
+++ b/addons/account/report/__init__.py
@@ -37,6 +37,6 @@ import compare_account_balance
import account_invoice_report
import account_report
import account_analytic_report
-
+import account_account_report
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/report/account_account_report.py b/addons/account/report/account_account_report.py
new file mode 100644
index 00000000000..a872a7173e7
--- /dev/null
+++ b/addons/account/report/account_account_report.py
@@ -0,0 +1,77 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL ().
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+
+import tools
+from osv import fields,osv
+
+class account_account_report(osv.osv):
+ _name = "account.account.report"
+ _description = "Account Report"
+ _auto = False
+ _columns = {
+ 'name': fields.char('Name', size=128, readonly=True),
+ 'code': fields.char('Code', size=64, readonly=True),
+ 'type': fields.selection([
+ ('receivable', 'Receivable'),
+ ('payable', 'Payable'),
+ ('view', 'View'),
+ ('consolidation', 'Consolidation'),
+ ('other', 'Others'),
+ ('closed', 'Closed'),
+ ], 'Internal Type', readonly=True),
+ 'company_id': fields.many2one('res.company', 'Company', required=True),
+ 'currency_mode': fields.selection([('current', 'At Date'), ('average', 'Average Rate')], 'Outgoing Currencies Rate',readonly=True),
+ 'user_type': fields.many2one('account.account.type', 'Account Type',readonly=True),
+ 'credit': fields.float('Credit', readonly=True),
+ 'debit': fields.float('Debit', readonly=True),
+ 'balance': fields.float('Balance', readonly=True)
+ }
+ def init(self, cr):
+ tools.drop_view_if_exists(cr, 'account_account_report')
+ cr.execute("""
+ create or replace view account_account_report as (
+ select
+ min(a.id) as id,
+ a.name,
+ a.code,
+ a.type as type,
+ a.company_id as company_id,
+ a.currency_mode as currency_mode,
+ a.user_type as user_type,
+ sum(m.credit) as credit,
+ sum(m.debit) as debit,
+ (sum(m.credit)-sum(m.debit)) as balance
+ from
+ account_account as a
+ left join
+ account_move_line as m
+ on m.account_id=a.id
+ group by
+ a.name,
+ a.code,
+ a.type,
+ a.company_id,
+ a.currency_mode,
+ a.user_type,
+ m.account_id
+ )
+ """)
+account_account_report()
diff --git a/addons/account/report/account_account_report_view.xml b/addons/account/report/account_account_report_view.xml
new file mode 100644
index 00000000000..a2b4903c8d9
--- /dev/null
+++ b/addons/account/report/account_account_report_view.xml
@@ -0,0 +1,83 @@
+
+
+
+
+ account.account.report.tree
+ account.account.report
+ tree
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ account.account.report.graph
+ account.account.report
+ graph
+
+
+
+
+
+
+
+
+
+
+
+ account.account.report.search
+ account.account.report
+ search
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Accounts
+ account.account.report
+ form
+ tree,graph
+ {"search_default_Company":1,"search_default_At Date":1,'group_by_no_leaf':1,'group_by':[]}
+
+
+
+
+
+
+
diff --git a/addons/account/report/account_report_view.xml b/addons/account/report/account_report_view.xml
index f0f67b477e3..9b1688730aa 100644
--- a/addons/account/report/account_report_view.xml
+++ b/addons/account/report/account_report_view.xml
@@ -47,7 +47,7 @@
form
tree,graph
-
+
@@ -116,7 +116,7 @@
-
+
report.account.sales.tree
@@ -169,7 +169,7 @@
graph,tree
-
+
@@ -237,7 +237,7 @@
graph,tree
-
+
From 33ee081b63216433f93645a132348f22a0c2315e Mon Sep 17 00:00:00 2001
From: "rch (Open ERP)" <>
Date: Wed, 28 Apr 2010 10:47:19 +0530
Subject: [PATCH 12/61] [IMP]: Improve SQL view report for account.
bzr revid: rch_open_erp-20100428051719-oyb01eo736xz1jot
---
.../account/report/account_account_report_view.xml | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/addons/account/report/account_account_report_view.xml b/addons/account/report/account_account_report_view.xml
index a2b4903c8d9..390fb144b0a 100644
--- a/addons/account/report/account_account_report_view.xml
+++ b/addons/account/report/account_account_report_view.xml
@@ -7,7 +7,7 @@
tree
-
+
@@ -48,8 +48,8 @@
string="Average Rate"
domain="[('currency_mode','=','average')]"/>
+
-
@@ -59,8 +59,11 @@
-
-
+
+
+
+
+
@@ -73,7 +76,7 @@
account.account.report
form
tree,graph
- {"search_default_Company":1,"search_default_At Date":1,'group_by_no_leaf':1,'group_by':[]}
+ {"search_default_Account":1,"search_default_At Date":1,'group_by_no_leaf':1,'group_by':[]}
From 2fddb283e50eaf9febd7147d549b196dbb24b9a3 Mon Sep 17 00:00:00 2001
From: apa-tiny
Date: Wed, 28 Apr 2010 11:57:43 +0530
Subject: [PATCH 13/61] [IMP]:hr_timesheet_sheet:Improved SQL
report.(Timesheet).
bzr revid: apa@tinyerp.com-20100428062743-cwkcunmyn2gjojdi
---
.../report/hr_timesheet_invoice_report_view.xml | 2 +-
addons/hr_timesheet_sheet/report/timesheet_report.py | 11 ++++-------
.../report/timesheet_report_view.xml | 12 +++++-------
3 files changed, 10 insertions(+), 15 deletions(-)
diff --git a/addons/hr_timesheet_invoice/report/hr_timesheet_invoice_report_view.xml b/addons/hr_timesheet_invoice/report/hr_timesheet_invoice_report_view.xml
index 4de60162d1a..d61203df1ef 100644
--- a/addons/hr_timesheet_invoice/report/hr_timesheet_invoice_report_view.xml
+++ b/addons/hr_timesheet_invoice/report/hr_timesheet_invoice_report_view.xml
@@ -103,7 +103,7 @@
{'search_default_month':1,'search_default_User':1,'group_by_no_leaf':1,'group_by':[]}
-
+
diff --git a/addons/hr_timesheet_sheet/report/timesheet_report.py b/addons/hr_timesheet_sheet/report/timesheet_report.py
index ee016df56d7..7b79470a9b7 100644
--- a/addons/hr_timesheet_sheet/report/timesheet_report.py
+++ b/addons/hr_timesheet_sheet/report/timesheet_report.py
@@ -45,9 +45,8 @@ class timesheet_report(osv.osv):
('draft','Draft'),
('confirm','Confirmed'),
('done','Done')], 'State', readonly=True),
- 'total_att': fields.float('Total Timesheet',readonly=True),
- 'total_ts': fields.float('Total Attendance',readonly=True),
- 'total_diff': fields.float('Difference', readonly=True),
+ 'quantity': fields.float('#Quantity',readonly=True),
+ 'cost': fields.float('#Cost',readonly=True),
}
def init(self, cr):
@@ -64,9 +63,8 @@ class timesheet_report(osv.osv):
to_char(htss.date_current,'MM') as month,
to_char(htss.date_current, 'YYYY-MM-DD') as day,
count(*) as nbr,
- sum(day.total_attendance) as total_att,
- sum(day.total_timesheet) as total_ts,
- sum(day.total_difference) as total_diff,
+ sum(aal.unit_amount) as quantity,
+ sum(aal.amount) as cost,
aal.account_id,
htss.user_id,
htss.company_id,
@@ -75,7 +73,6 @@ class timesheet_report(osv.osv):
from account_analytic_line as aal
left join hr_analytic_timesheet as hat ON (hat.line_id=aal.id)
left join hr_timesheet_sheet_sheet as htss ON (hat.line_id=htss.id)
- left join hr_timesheet_sheet_sheet_day AS day ON (htss.id = day.sheet_id)
group by
to_char(htss.date_current,'YYYY'),
to_char(htss.date_current,'MM'),
diff --git a/addons/hr_timesheet_sheet/report/timesheet_report_view.xml b/addons/hr_timesheet_sheet/report/timesheet_report_view.xml
index 976b2a6f8ea..2520d5054fb 100644
--- a/addons/hr_timesheet_sheet/report/timesheet_report_view.xml
+++ b/addons/hr_timesheet_sheet/report/timesheet_report_view.xml
@@ -7,10 +7,9 @@
graph
-
-
-
-
+
+
+
@@ -25,9 +24,8 @@
-
-
-
+
+
From f438daad1217c231fdb6a7526a963d0b38b723d5 Mon Sep 17 00:00:00 2001
From: "rch (Open ERP)" <>
Date: Wed, 28 Apr 2010 12:24:28 +0530
Subject: [PATCH 14/61] [IMP]: Improve SQL view report for crm lead by adding
fields. Also add #Accounts in account report.
bzr revid: rch_open_erp-20100428065428-svgm9aq7juqaalqa
---
.../account/report/account_account_report.py | 4 +++-
.../report/account_account_report_view.xml | 1 +
addons/crm/report/crm_lead_report.py | 9 ++++++++
addons/crm/report/crm_lead_report_view.xml | 23 +++++++++++++++++++
4 files changed, 36 insertions(+), 1 deletion(-)
diff --git a/addons/account/report/account_account_report.py b/addons/account/report/account_account_report.py
index a872a7173e7..8a18c7d89f1 100644
--- a/addons/account/report/account_account_report.py
+++ b/addons/account/report/account_account_report.py
@@ -42,7 +42,8 @@ class account_account_report(osv.osv):
'user_type': fields.many2one('account.account.type', 'Account Type',readonly=True),
'credit': fields.float('Credit', readonly=True),
'debit': fields.float('Debit', readonly=True),
- 'balance': fields.float('Balance', readonly=True)
+ 'balance': fields.float('Balance', readonly=True),
+ 'nbr': fields.integer('#Accounts', readonly=True),
}
def init(self, cr):
tools.drop_view_if_exists(cr, 'account_account_report')
@@ -50,6 +51,7 @@ class account_account_report(osv.osv):
create or replace view account_account_report as (
select
min(a.id) as id,
+ count(distinct a.id) as nbr,
a.name,
a.code,
a.type as type,
diff --git a/addons/account/report/account_account_report_view.xml b/addons/account/report/account_account_report_view.xml
index 390fb144b0a..7388beb05f9 100644
--- a/addons/account/report/account_account_report_view.xml
+++ b/addons/account/report/account_account_report_view.xml
@@ -12,6 +12,7 @@
+
diff --git a/addons/crm/report/crm_lead_report.py b/addons/crm/report/crm_lead_report.py
index 92aeb7f28ec..fb30dd58182 100644
--- a/addons/crm/report/crm_lead_report.py
+++ b/addons/crm/report/crm_lead_report.py
@@ -54,6 +54,10 @@ class crm_lead_report(osv.osv):
('object_id.model', '=', 'crm.lead')]"),
'date_closed': fields.datetime('Closed', readonly=True),
'date_open': fields.datetime('Opened', readonly=True),
+ 'date_deadline': fields.date('Deadline', readonly=True),
+ 'opportunity_id': fields.many2one('crm.opportunity', 'Opportunity',readonly=True),
+ 'country_id': fields.many2one('res.country', 'Country' , readonly=True),
+ 'state_id': fields.many2one('res.country.state', 'State' , readonly=True)
}
def init(self, cr):
@@ -85,6 +89,10 @@ class crm_lead_report(osv.osv):
c.type_id as type_id,
c.date_closed as date_closed,
c.date_open as date_open,
+ c.opportunity_id as opportunity_id,
+ c.country_id as country_id,
+ c.state_id as state_id,
+ c.date_deadline as date_deadline,
date_trunc('day',c.create_date) as create_date,
avg(extract('epoch' from (c.date_closed-c.create_date)))/(3600*24) as delay_close
from
@@ -93,6 +101,7 @@ class crm_lead_report(osv.osv):
c.state, c.user_id,c.section_id,c.stage_id,categ_id,c.partner_id,c.company_id
,c.create_date,to_char(c.create_date, 'YYYY-MM-DD')
,c.priority,c.type_id,c.date_closed,c.date_open
+ ,c.opportunity_id,c.country_id,c.state_id,c.date_deadline
)""")
crm_lead_report()
diff --git a/addons/crm/report/crm_lead_report_view.xml b/addons/crm/report/crm_lead_report_view.xml
index 6ef0d90ac97..ab648d75ea2 100644
--- a/addons/crm/report/crm_lead_report_view.xml
+++ b/addons/crm/report/crm_lead_report_view.xml
@@ -26,6 +26,10 @@
+
+
+
+
@@ -78,7 +82,16 @@
+
+
+
+
+
+
+
+
+
@@ -96,6 +109,16 @@
context="{'group_by':'priority'}" />
+
+
+
+
+
+
From 335e59c2904587502c822df35d122356c7ad2554 Mon Sep 17 00:00:00 2001
From: "rch (Open ERP)" <>
Date: Wed, 28 Apr 2010 15:34:04 +0530
Subject: [PATCH 15/61] [IMP]: Improve SQL report for crm claim and crm
fundraising.
bzr revid: rch_open_erp-20100428100404-8rti5e8kzobayv16
---
addons/crm/report/crm_claim_report.py | 9 ++++++++-
addons/crm/report/crm_claim_report_view.xml | 15 ++++++++++++++-
addons/crm/report/crm_fundraising_report.py | 8 ++++++--
addons/crm/report/crm_fundraising_report_view.xml | 4 ++++
4 files changed, 32 insertions(+), 4 deletions(-)
diff --git a/addons/crm/report/crm_claim_report.py b/addons/crm/report/crm_claim_report.py
index 74b95864759..ef769042ea8 100644
--- a/addons/crm/report/crm_claim_report.py
+++ b/addons/crm/report/crm_claim_report.py
@@ -48,7 +48,10 @@ class crm_claim_report(osv.osv):
('object_id.model', '=', 'crm.claim')]"),
'date_closed': fields.datetime('Closed', readonly=True),
'canal_id': fields.many2one('res.partner.canal','Channel',domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.claim')]"),
- 'som': fields.many2one('res.partner.som', 'State of Mind')
+ 'som': fields.many2one('res.partner.som', 'State of Mind'),
+ 'claim_date': fields.datetime('Date Of Claim',readonly=True),
+ 'deadline_date': fields.datetime('Deadline ',readonly=True),
+ 'partner_address_id': fields.many2one('res.partner.address','Contact ',readonly=True),
}
def init(self, cr):
@@ -81,6 +84,9 @@ class crm_claim_report(osv.osv):
c.date_closed as date_closed,
c.canal_id as canal_id,
c.som as som,
+ c.create_date as claim_date,
+ c.date_deadline as deadline_date,
+ c.partner_address_id as partner_address_id,
date_trunc('day',c.create_date) as create_date,
avg(extract('epoch' from (c.date_closed-c.create_date)))/(3600*24) as delay_close
from
@@ -89,6 +95,7 @@ class crm_claim_report(osv.osv):
c.state, c.user_id,c.section_id, c.stage_id,\
c.categ_id,c.partner_id,c.company_id,c.create_date,to_char(c.create_date, 'YYYY-MM-DD')
,c.priority,c.type_id,c.date_closed,c.canal_id,c.som
+ ,c.create_date,c.date_deadline,c.partner_address_id
)""")
crm_claim_report()
diff --git a/addons/crm/report/crm_claim_report_view.xml b/addons/crm/report/crm_claim_report_view.xml
index 74ebbd56d0b..66c1c6ff930 100644
--- a/addons/crm/report/crm_claim_report_view.xml
+++ b/addons/crm/report/crm_claim_report_view.xml
@@ -27,6 +27,9 @@
+
+
+
@@ -81,11 +84,16 @@
-
+
+
+
+
+
+
+
+
+
diff --git a/addons/crm/report/crm_fundraising_report.py b/addons/crm/report/crm_fundraising_report.py
index 5765b7367b0..9e1a1111253 100644
--- a/addons/crm/report/crm_fundraising_report.py
+++ b/addons/crm/report/crm_fundraising_report.py
@@ -44,7 +44,10 @@ class crm_fundraising_report(osv.osv):
'priority': fields.selection(crm_report.AVAILABLE_PRIORITIES, 'Priority'),
'date_closed': fields.datetime('Closed', readonly=True),
'canal_id': fields.many2one('res.partner.canal','Channel',domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.fundraising')]"),
- 'som': fields.many2one('res.partner.som', 'State of Mind')
+ 'som': fields.many2one('res.partner.som', 'State of Mind'),
+ 'type_id': fields.many2one('crm.case.resource.type', 'Fundraising Type', \
+ domain="[('section_id','=',section_id),\
+ ('object_id.model', '=', 'crm.fundraising')]"),
}
def init(self, cr):
@@ -75,6 +78,7 @@ class crm_fundraising_report(osv.osv):
c.date_closed as date_closed,
c.canal_id as canal_id,
c.som as som,
+ c.type_id as type_id,
date_trunc('day',c.create_date) as create_date,
sum(planned_revenue) as amount_revenue,
sum(planned_revenue*probability)::decimal(16,2) as amount_revenue_prob,
@@ -85,7 +89,7 @@ class crm_fundraising_report(osv.osv):
group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'),\
c.state, c.user_id,c.section_id,c.categ_id,c.partner_id,c.company_id,
c.create_date,to_char(c.create_date, 'YYYY-MM-DD'),c.priority,c.date_closed
- ,c.canal_id,c.som
+ ,c.canal_id,c.som,c.type_id
)""")
crm_fundraising_report()
diff --git a/addons/crm/report/crm_fundraising_report_view.xml b/addons/crm/report/crm_fundraising_report_view.xml
index 7236df4a8b4..95410010edf 100644
--- a/addons/crm/report/crm_fundraising_report_view.xml
+++ b/addons/crm/report/crm_fundraising_report_view.xml
@@ -28,6 +28,7 @@
+
@@ -81,6 +82,7 @@
+
@@ -95,6 +97,8 @@
context="{'group_by':'canal_id'}" />
+
From 1a3e8c3f79542b371506e86018926cc219c1f094 Mon Sep 17 00:00:00 2001
From: apa-tiny
Date: Wed, 28 Apr 2010 17:57:46 +0530
Subject: [PATCH 16/61] [IMP]:mrp:Improved SQL report.(Production).
bzr revid: apa@tinyerp.com-20100428122746-1w3vuzwglgl22588
---
addons/mrp/report/mrp_production_order.py | 23 +++++++++++++++----
.../mrp/report/mrp_production_order_view.xml | 18 +++++++++++----
2 files changed, 32 insertions(+), 9 deletions(-)
diff --git a/addons/mrp/report/mrp_production_order.py b/addons/mrp/report/mrp_production_order.py
index 96910e205d7..c5bc5020e20 100644
--- a/addons/mrp/report/mrp_production_order.py
+++ b/addons/mrp/report/mrp_production_order.py
@@ -33,6 +33,8 @@ class mrp_production_order(osv.osv):
'day': fields.char('Day',size=64,readonly=True),
'origin': fields.char('Source Document', size=64),
'nbr': fields.integer('# of Orders', readonly=True),
+ 'products_to_consumme': fields.integer('Products to Consumme', readonly=True),
+ 'consummed_products': fields.integer('Consummed Products', readonly=True),
'date': fields.date('Date', readonly=True),
'product_id': fields.many2one('product.product', 'Product', readonly=True),
'product_qty': fields.float('Product Qty', readonly=True),
@@ -53,6 +55,7 @@ class mrp_production_order(osv.osv):
'bom_id': fields.many2one('mrp.bom', 'Bill of Material',readonly=True),
'routing_id': fields.many2one('mrp.routing', string='Routing',readonly=True),
'picking_id': fields.many2one('stock.picking', 'Picking list', readonly=True),
+ 'product_uom': fields.many2one('product.uom', 'Product UOM', readonly=True),
'priority': fields.selection([('0','Not urgent'),
('1','Normal'),
('2','Urgent'),
@@ -72,9 +75,20 @@ class mrp_production_order(osv.osv):
to_char(s.create_date, 'MM') as month,
to_char(s.create_date, 'YYYY-MM-DD') as day,
l.product_id as product_id,
+ l.product_uom,
sum(l.product_qty * u.factor) as product_qty,
s.company_id as company_id,
count(*) as nbr,
+ (select count(ll.id) from mrp_production_move_ids as mv
+ left join stock_move as sm ON (sm.id=mv.move_id)
+ left join mrp_production_product_line as ll ON (ll.id=mv.production_id)
+ where sm.state not in ('done','cancel') and ll.id=l.id
+ group by ll.id) as products_to_consumme,
+ (select count(ll.id) from mrp_production_move_ids as mv
+ left join stock_move as sm ON (sm.id=mv.move_id)
+ left join mrp_production_product_line as ll ON (ll.id=mv.production_id)
+ where sm.state in ('done','cancel') and ll.id=l.id
+ group by ll.id) as consummed_products,
s.location_src_id,
s.location_dest_id,
s.bom_id,
@@ -86,11 +100,9 @@ class mrp_production_order(osv.osv):
s.origin,
s.priority,
s.state
- from
- mrp_production_product_line l
- left join
- mrp_production s on (s.id=l.production_id)
- left join product_uom u on (u.id=l.product_uom)
+ from mrp_production_product_line l
+ left join mrp_production s on (s.id=l.production_id)
+ left join product_uom u on (u.id=l.product_uom)
group by
to_char(s.create_date, 'YYYY'),
to_char(s.create_date, 'MM'),
@@ -98,6 +110,7 @@ class mrp_production_order(osv.osv):
to_date(to_char(s.create_date, 'MM-dd-YYYY'),'MM-dd-YYYY'),
l.product_id,
l.product_uom,
+ l.id,
s.bom_id,
s.routing_id,
s.picking_id,
diff --git a/addons/mrp/report/mrp_production_order_view.xml b/addons/mrp/report/mrp_production_order_view.xml
index 04188f43752..acac00d590a 100644
--- a/addons/mrp/report/mrp_production_order_view.xml
+++ b/addons/mrp/report/mrp_production_order_view.xml
@@ -16,6 +16,8 @@
+
+
@@ -28,6 +30,8 @@
+
+
@@ -81,25 +85,30 @@
+
-
-
+
+
+
+
+
+
+
-
+
-
@@ -113,6 +122,7 @@
+
From 8a54668cba1b026d17c2a8e61413d4558a63cac7 Mon Sep 17 00:00:00 2001
From: "rch (Open ERP)" <>
Date: Wed, 28 Apr 2010 19:08:56 +0530
Subject: [PATCH 17/61] [IMP]: Improve SQL report for task and project_issue.
bzr revid: rch_open_erp-20100428133856-4lserqno5zsnvjrq
---
addons/project/report/project_report_view.xml | 4 +--
.../report/project_issue_report.py | 22 +++++++++++---
.../report/project_issue_report_view.xml | 30 +++++++++++++------
3 files changed, 41 insertions(+), 15 deletions(-)
diff --git a/addons/project/report/project_report_view.xml b/addons/project/report/project_report_view.xml
index 9ee400e6472..ef0abd119fa 100644
--- a/addons/project/report/project_report_view.xml
+++ b/addons/project/report/project_report_view.xml
@@ -88,7 +88,7 @@
help="Non Assigned Tasks to users"
domain="[('user_id','=',False)]"/>
-
+
-
+
diff --git a/addons/project_issue/report/project_issue_report.py b/addons/project_issue/report/project_issue_report.py
index 775e4b933f0..a14eb67bab4 100755
--- a/addons/project_issue/report/project_issue_report.py
+++ b/addons/project_issue/report/project_issue_report.py
@@ -11,16 +11,23 @@ class project_issue_report(osv.osv):
'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"),
+ 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"),
'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')]" )
+ 'task_id': fields.many2one('project.task', 'Task',domain="[('object_id.model', '=', 'project.issue')]" ),
+ 'analytic_account_id' : fields.many2one('account.analytic.account', 'Analytic Account',
+ domain="[('partner_id', '=', partner_id)]",
+ required=True),
+ 'partner_address_id': fields.many2one('res.partner.address','Contact ',readonly=True),
}
def init(self, cr):
tools.drop_view_if_exists(cr, 'project_issue_report')
@@ -46,8 +53,12 @@ class project_issue_report(osv.osv):
c.partner_id,
c.canal_id,
c.task_id,
+ c.analytic_account_id as analytic_account_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_closed-c.create_date)))/(3600*24) as delay_close,
+ avg(extract('epoch' from (c.date_open-c.create_date)))/(3600*24) as delay_open
from
project_issue c
left join
@@ -70,7 +81,10 @@ class project_issue_report(osv.osv):
c.assigned_to,
c.partner_id,
c.canal_id,
- c.task_id
+ c.task_id,
+ c.date_open,
+ c.analytic_account_id,
+ c.partner_address_id
)""")
diff --git a/addons/project_issue/report/project_issue_report_view.xml b/addons/project_issue/report/project_issue_report_view.xml
index 24290530be7..f075a562ca2 100755
--- a/addons/project_issue/report/project_issue_report_view.xml
+++ b/addons/project_issue/report/project_issue_report_view.xml
@@ -15,7 +15,6 @@
-
@@ -23,11 +22,16 @@
+
+
+
+
+
@@ -65,17 +69,21 @@
-
-
-
-
+
-
+
+
+
+
-
+
+
+
+
+
@@ -90,11 +98,15 @@
+
+
-
-
+
+
+
+
From 8415f50d3edbe984886139a5d13af338be60b14f Mon Sep 17 00:00:00 2001
From: "nel@tinyerp.com" <>
Date: Wed, 28 Apr 2010 16:40:43 +0200
Subject: [PATCH 18/61] [FIX] month field on views
bzr revid: nel@tinyerp.com-20100428144043-wl12x361lpzvcqa1
---
addons/account/report/account_invoice_report_view.xml | 2 +-
addons/hr_expense/report/hr_expense_report_view.xml | 2 +-
addons/hr_holidays/report/available_holidays_view.xml | 2 +-
.../hr_recruitment/report/hr_recruitment_report_view.xml | 8 ++++----
addons/sale/report/sale_report_view.xml | 2 +-
5 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/addons/account/report/account_invoice_report_view.xml b/addons/account/report/account_invoice_report_view.xml
index 5a833e454fb..c4832d82309 100644
--- a/addons/account/report/account_invoice_report_view.xml
+++ b/addons/account/report/account_invoice_report_view.xml
@@ -129,7 +129,7 @@
-
+
diff --git a/addons/hr_expense/report/hr_expense_report_view.xml b/addons/hr_expense/report/hr_expense_report_view.xml
index 972557edd0c..ae111fa6796 100644
--- a/addons/hr_expense/report/hr_expense_report_view.xml
+++ b/addons/hr_expense/report/hr_expense_report_view.xml
@@ -121,7 +121,7 @@
-
+
diff --git a/addons/hr_holidays/report/available_holidays_view.xml b/addons/hr_holidays/report/available_holidays_view.xml
index cb610d4214a..5d6cc41a730 100644
--- a/addons/hr_holidays/report/available_holidays_view.xml
+++ b/addons/hr_holidays/report/available_holidays_view.xml
@@ -81,7 +81,7 @@
-
+
diff --git a/addons/hr_recruitment/report/hr_recruitment_report_view.xml b/addons/hr_recruitment/report/hr_recruitment_report_view.xml
index 83f7d2b7602..f9a144dadc4 100644
--- a/addons/hr_recruitment/report/hr_recruitment_report_view.xml
+++ b/addons/hr_recruitment/report/hr_recruitment_report_view.xml
@@ -119,9 +119,9 @@
-
-
-
+
+
+
@@ -136,7 +136,7 @@
hr.recruitment.report
form
tree,graph
- {'search_default_month':1,'search_default_User':1,'group_by_no_leaf':1,'group_by':[]}
+ {'search_default_month':1,'search_default_degree':1,'search_default_job':1,'group_by_no_leaf':1,'group_by':[]}
diff --git a/addons/sale/report/sale_report_view.xml b/addons/sale/report/sale_report_view.xml
index 72707f6e01d..73029cb88fa 100644
--- a/addons/sale/report/sale_report_view.xml
+++ b/addons/sale/report/sale_report_view.xml
@@ -114,7 +114,7 @@
-
+
From 29b9372b9cd7214395dc35baf60984dadd917249 Mon Sep 17 00:00:00 2001
From: "nel@tinyerp.com" <>
Date: Wed, 28 Apr 2010 16:53:19 +0200
Subject: [PATCH 19/61] rename button
bzr revid: nel@tinyerp.com-20100428145319-akcdb0ld4lcz8qtw
---
addons/crm/report/crm_phonecall_report_view.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/addons/crm/report/crm_phonecall_report_view.xml b/addons/crm/report/crm_phonecall_report_view.xml
index 5ad0a63bdd8..e80cd8f82da 100644
--- a/addons/crm/report/crm_phonecall_report_view.xml
+++ b/addons/crm/report/crm_phonecall_report_view.xml
@@ -88,7 +88,7 @@
-
From a3f82274260ad12288dd7d1df1f82c9b14ff2453 Mon Sep 17 00:00:00 2001
From: apa-tiny
Date: Thu, 29 Apr 2010 11:59:53 +0530
Subject: [PATCH 20/61] [IMP]:hr_recruitment:Add Partner and Partner c
bzr revid: apa@tinyerp.com-20100429062953-qt8zrs0d1uer5z2w
---
.../report/hr_recruitment_report.py | 6 +++++
.../report/hr_recruitment_report_view.xml | 23 +++++++++++++------
2 files changed, 22 insertions(+), 7 deletions(-)
diff --git a/addons/hr_recruitment/report/hr_recruitment_report.py b/addons/hr_recruitment/report/hr_recruitment_report.py
index f59ea414fec..52fbc94be8a 100644
--- a/addons/hr_recruitment/report/hr_recruitment_report.py
+++ b/addons/hr_recruitment/report/hr_recruitment_report.py
@@ -44,6 +44,8 @@ class hr_recruitment_report(osv.osv):
'priority': fields.selection(hr_recruitment.AVAILABLE_PRIORITIES, 'Appreciation'),
'salary_prop' : fields.float("Salary Proposed"),
'salary_exp' : fields.float("Salary Expected"),
+ 'partner_id': fields.many2one('res.partner', 'Partner',readonly=True),
+ 'partner_address_id': fields.many2one('res.partner.address', 'Partner Contact',readonly=True),
'available' : fields.float("Availability")
}
@@ -60,7 +62,9 @@ class hr_recruitment_report(osv.osv):
to_char(s.create_date, 'MM') as month,
to_char(s.create_date, 'YYYY-MM-DD') as day,
s.state,
+ s.partner_id,
s.company_id,
+ s.partner_address_id,
s.user_id,
s.job_id,
s.type_id,
@@ -79,6 +83,8 @@ class hr_recruitment_report(osv.osv):
date_trunc('day',s.create_date),
date_trunc('day',s.date_closed),
s.state,
+ s.partner_id,
+ s.partner_address_id,
s.company_id,
s.user_id,
s.stage_id,
diff --git a/addons/hr_recruitment/report/hr_recruitment_report_view.xml b/addons/hr_recruitment/report/hr_recruitment_report_view.xml
index f9a144dadc4..4cdaaca68bc 100644
--- a/addons/hr_recruitment/report/hr_recruitment_report_view.xml
+++ b/addons/hr_recruitment/report/hr_recruitment_report_view.xml
@@ -13,6 +13,8 @@
+
+
@@ -100,29 +102,36 @@
string="Hired"
name="done"
domain="[('state','=','done')]"/>
-
+
+
-
-
+
+
+
+
+
+
-
+
+
-
+
+
From 6460e5ab80a356988ebf38491134613d9c7e9b2c Mon Sep 17 00:00:00 2001
From: "rch (Open ERP)" <>
Date: Thu, 29 Apr 2010 12:11:34 +0530
Subject: [PATCH 21/61] [FIX]: Resolve confusion between state and country's
state in crm lead report.
bzr revid: rch_open_erp-20100429064134-apl3s8gxt6wod3zc
---
addons/crm/report/crm_lead_report_view.xml | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/addons/crm/report/crm_lead_report_view.xml b/addons/crm/report/crm_lead_report_view.xml
index ab648d75ea2..becf76db72d 100644
--- a/addons/crm/report/crm_lead_report_view.xml
+++ b/addons/crm/report/crm_lead_report_view.xml
@@ -28,7 +28,7 @@
-
+
@@ -86,7 +86,7 @@
-
+
@@ -117,7 +117,7 @@
-
From 68137a3117ed1efa3b82deb380f82593b4f70828 Mon Sep 17 00:00:00 2001
From: "rch (Open ERP)" <>
Date: Thu, 29 Apr 2010 13:57:53 +0530
Subject: [PATCH 22/61] [IMP]: Improve SQL report for Invoice.
bzr revid: rch_open_erp-20100429082753-ao26rotnkwjwmtfh
---
.../account/report/account_invoice_report.py | 21 +++++++++--
.../report/account_invoice_report_view.xml | 37 +++++++++++++++----
2 files changed, 47 insertions(+), 11 deletions(-)
diff --git a/addons/account/report/account_invoice_report.py b/addons/account/report/account_invoice_report.py
index 36fa5a0d132..5aff8f34f89 100644
--- a/addons/account/report/account_invoice_report.py
+++ b/addons/account/report/account_invoice_report.py
@@ -61,6 +61,11 @@ class account_invoice_report(osv.osv):
('paid','Done'),
('cancel','Cancelled')
], 'Order State', readonly=True),
+ 'date_due': fields.date('Due Date', readonly=True),
+ 'address_contact_id': fields.many2one('res.partner.address', 'Contact Address', readonly=True),
+ 'address_invoice_id': fields.many2one('res.partner.address', 'Invoice Address', readonly=True),
+ 'account_id': fields.many2one('account.account', 'Account',readonly=True),
+ 'partner_bank': fields.many2one('res.partner.bank', 'Bank Account',readonly=True)
}
_order = 'date desc'
def init(self, cr):
@@ -87,8 +92,13 @@ class account_invoice_report(osv.osv):
(sum(l.quantity*l.price_unit)/sum(l.quantity * u.factor))::decimal(16,2) as price_average,
count(*) as nbr,
s.type as type,
- s.state
- from
+ s.state,
+ s.date_due as date_due,
+ s.address_contact_id as address_contact_id,
+ s.address_invoice_id as address_invoice_id,
+ s.account_id as account_id,
+ s.partner_bank as partner_bank
+ from
account_invoice_line l
left join
account_invoice s on (s.id=l.invoice_id)
@@ -106,7 +116,12 @@ class account_invoice_report(osv.osv):
s.period_id,
s.fiscal_position,
s.currency_id,
- s.journal_id
+ s.journal_id,
+ s.date_due,
+ s.address_contact_id,
+ s.address_invoice_id,
+ s.account_id,
+ s.partner_bank
)
""")
account_invoice_report()
diff --git a/addons/account/report/account_invoice_report_view.xml b/addons/account/report/account_invoice_report_view.xml
index c4832d82309..4764e0a5942 100644
--- a/addons/account/report/account_invoice_report_view.xml
+++ b/addons/account/report/account_invoice_report_view.xml
@@ -27,6 +27,11 @@
+
+
+
+
+
@@ -76,7 +81,6 @@
domain="[('state', '=' ,'open')]"
help = "In progress tasks"/>
-
+
@@ -102,28 +107,44 @@
domain="[('state', '=' ,'cancel')]"
help = "Cancelled tasks"/>
+
+
-
+
+
+
+
+
+
-
+
+
+
+
-
+
+
+
+
+
+
-
-
-
-
+
+
+
+
+
From c92db23ececc941655c6b5d8e24d0ccfa981dfaa Mon Sep 17 00:00:00 2001
From: apa-tiny
Date: Thu, 29 Apr 2010 14:22:09 +0530
Subject: [PATCH 23/61] [IMP]:hr_expense:Improved SQL report.(Expense).
bzr revid: apa@tinyerp.com-20100429085209-lwal4qdyci0eu92p
---
addons/hr_expense/report/hr_expense_report.py | 16 +++++++++++-----
.../hr_expense/report/hr_expense_report_view.xml | 5 +++++
2 files changed, 16 insertions(+), 5 deletions(-)
diff --git a/addons/hr_expense/report/hr_expense_report.py b/addons/hr_expense/report/hr_expense_report.py
index cc3f282e9fa..7f0c6cc09a6 100644
--- a/addons/hr_expense/report/hr_expense_report.py
+++ b/addons/hr_expense/report/hr_expense_report.py
@@ -45,7 +45,9 @@ class hr_expense_report(osv.osv):
'department_id':fields.many2one('hr.department','Department',readonly=True),
'company_id':fields.many2one('res.company', 'Company', readonly=True),
'user_id':fields.many2one('res.users', 'User', readonly=True),
+ 'currency_id': fields.many2one('res.currency', 'Currency', readonly=True),
'price_total':fields.float('Total Price', readonly=True),
+ 'analytic_account': fields.many2one('account.analytic.account','Analytic account',readonly=True),
'price_average':fields.float('Average Price', readonly=True),
'nbr':fields.integer('# of Lines', readonly=True),
'state': fields.selection([
@@ -67,6 +69,7 @@ class hr_expense_report(osv.osv):
date_trunc('day',s.create_date) as date,
s.employee_id,
s.journal_id,
+ s.currency_id,
to_date(to_char(s.date_confirm, 'dd-MM-YYYY'),'dd-MM-YYYY') as date_confirm,
to_date(to_char(s.date_valid, 'dd-MM-YYYY'),'dd-MM-YYYY') as date_valid,
s.invoice_id,
@@ -75,6 +78,7 @@ class hr_expense_report(osv.osv):
to_char(date_trunc('day',s.create_date), 'MM') as month,
to_char(date_trunc('day',s.create_date), 'YYYY-MM-DD') as day,
l.product_id as product_id,
+ l.analytic_account as analytic_account,
sum(l.unit_quantity * u.factor) as product_qty,
s.user_id as user_id,
s.company_id as company_id,
@@ -82,18 +86,20 @@ class hr_expense_report(osv.osv):
(sum(l.unit_quantity*l.unit_amount)/sum(l.unit_quantity * u.factor))::decimal(16,2) as price_average,
count(*) as nbr,
s.state
- from
- hr_expense_line l
- left join
- hr_expense_expense s on (s.id=l.expense_id)
- left join product_uom u on (u.id=l.uom_id)
+ from hr_expense_line l
+ left join hr_expense_expense s on (s.id=l.expense_id)
+ left join product_uom u on (u.id=l.uom_id)
group by
date_trunc('day',s.create_date),
+ to_char(date_trunc('day',s.create_date), 'YYYY'),
+ to_char(date_trunc('day',s.create_date), 'MM'),
to_char(date_trunc('day',s.create_date), 'YYYY-MM-DD'),
to_date(to_char(s.date_confirm, 'dd-MM-YYYY'),'dd-MM-YYYY'),
to_date(to_char(s.date_valid, 'dd-MM-YYYY'),'dd-MM-YYYY'),
l.product_id,
+ l.analytic_account,
s.invoice_id,
+ s.currency_id,
s.department_id,
l.uom_id,
s.user_id,
diff --git a/addons/hr_expense/report/hr_expense_report_view.xml b/addons/hr_expense/report/hr_expense_report_view.xml
index ae111fa6796..e2dbe60ef4e 100644
--- a/addons/hr_expense/report/hr_expense_report_view.xml
+++ b/addons/hr_expense/report/hr_expense_report_view.xml
@@ -14,9 +14,11 @@
+
+
@@ -115,7 +117,10 @@
+
+
+
From c7b027483ee3c78a506cf818999a028e317f2880 Mon Sep 17 00:00:00 2001
From: apa-tiny
Date: Thu, 29 Apr 2010 15:22:43 +0530
Subject: [PATCH 24/61] [IMP]:hr_expense:Add #Products in SQL virw
report..(Expense).
bzr revid: apa@tinyerp.com-20100429095243-p3hq66v38jp6kfdj
---
addons/hr_expense/report/hr_expense_report.py | 3 +++
addons/hr_expense/report/hr_expense_report_view.xml | 1 +
2 files changed, 4 insertions(+)
diff --git a/addons/hr_expense/report/hr_expense_report.py b/addons/hr_expense/report/hr_expense_report.py
index 7f0c6cc09a6..4a983984e57 100644
--- a/addons/hr_expense/report/hr_expense_report.py
+++ b/addons/hr_expense/report/hr_expense_report.py
@@ -50,6 +50,7 @@ class hr_expense_report(osv.osv):
'analytic_account': fields.many2one('account.analytic.account','Analytic account',readonly=True),
'price_average':fields.float('Average Price', readonly=True),
'nbr':fields.integer('# of Lines', readonly=True),
+ 'no_of_products':fields.integer('# of Products', readonly=True),
'state': fields.selection([
('draft', 'Draft'),
('confirm', 'Waiting confirmation'),
@@ -85,6 +86,7 @@ class hr_expense_report(osv.osv):
sum(l.unit_quantity*l.unit_amount) as price_total,
(sum(l.unit_quantity*l.unit_amount)/sum(l.unit_quantity * u.factor))::decimal(16,2) as price_average,
count(*) as nbr,
+ (select unit_quantity from hr_expense_line where id=l.id and product_id is not null) as no_of_products,
s.state
from hr_expense_line l
left join hr_expense_expense s on (s.id=l.expense_id)
@@ -102,6 +104,7 @@ class hr_expense_report(osv.osv):
s.currency_id,
s.department_id,
l.uom_id,
+ l.id,
s.user_id,
s.state,
s.journal_id,
diff --git a/addons/hr_expense/report/hr_expense_report_view.xml b/addons/hr_expense/report/hr_expense_report_view.xml
index e2dbe60ef4e..d717743ff34 100644
--- a/addons/hr_expense/report/hr_expense_report_view.xml
+++ b/addons/hr_expense/report/hr_expense_report_view.xml
@@ -22,6 +22,7 @@
+
From 9dd2f2d39a794226d9727cfa740b14c53a37b015 Mon Sep 17 00:00:00 2001
From: apa-tiny
Date: Thu, 29 Apr 2010 15:54:30 +0530
Subject: [PATCH 25/61] [IMP]:hr_expense:Add #Accounts in SQL virw
report..(Expense).
bzr revid: apa@tinyerp.com-20100429102430-71xa5n0e2x0o7mx6
---
addons/hr_expense/report/hr_expense_report.py | 2 ++
addons/hr_expense/report/hr_expense_report_view.xml | 1 +
2 files changed, 3 insertions(+)
diff --git a/addons/hr_expense/report/hr_expense_report.py b/addons/hr_expense/report/hr_expense_report.py
index 4a983984e57..2b0f6b4addf 100644
--- a/addons/hr_expense/report/hr_expense_report.py
+++ b/addons/hr_expense/report/hr_expense_report.py
@@ -51,6 +51,7 @@ class hr_expense_report(osv.osv):
'price_average':fields.float('Average Price', readonly=True),
'nbr':fields.integer('# of Lines', readonly=True),
'no_of_products':fields.integer('# of Products', readonly=True),
+ 'no_of_account':fields.integer('# of Accounts', readonly=True),
'state': fields.selection([
('draft', 'Draft'),
('confirm', 'Waiting confirmation'),
@@ -87,6 +88,7 @@ class hr_expense_report(osv.osv):
(sum(l.unit_quantity*l.unit_amount)/sum(l.unit_quantity * u.factor))::decimal(16,2) as price_average,
count(*) as nbr,
(select unit_quantity from hr_expense_line where id=l.id and product_id is not null) as no_of_products,
+ (select count(analytic_account) from hr_expense_line where id=l.id and analytic_account is not null) as no_of_account,
s.state
from hr_expense_line l
left join hr_expense_expense s on (s.id=l.expense_id)
diff --git a/addons/hr_expense/report/hr_expense_report_view.xml b/addons/hr_expense/report/hr_expense_report_view.xml
index d717743ff34..0fb5c46c210 100644
--- a/addons/hr_expense/report/hr_expense_report_view.xml
+++ b/addons/hr_expense/report/hr_expense_report_view.xml
@@ -23,6 +23,7 @@
+
From ab94bf1e5f2e224a61041404d0c6edbc0062c398 Mon Sep 17 00:00:00 2001
From: apa-tiny
Date: Thu, 29 Apr 2010 16:10:08 +0530
Subject: [PATCH 26/61] [IMP]:hr_expense:improved search view..(Expense).
bzr revid: apa@tinyerp.com-20100429104008-x4w9tzkvd698ldoq
---
addons/hr_expense/report/hr_expense_report_view.xml | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/addons/hr_expense/report/hr_expense_report_view.xml b/addons/hr_expense/report/hr_expense_report_view.xml
index 0fb5c46c210..0259c617836 100644
--- a/addons/hr_expense/report/hr_expense_report_view.xml
+++ b/addons/hr_expense/report/hr_expense_report_view.xml
@@ -87,6 +87,8 @@
help="Expenses Non Assigned User"
domain="[('user_id','=',False)]"/>
+
+
@@ -103,13 +105,11 @@
domain="[('state','=','cancelled')]"
help = "Cancelled Expenses"/>
-
-
-
+
-
+
From 889d4d7ebc72e5f61a07615f1a4796e524e15d7e Mon Sep 17 00:00:00 2001
From: "rch (Open ERP)" <>
Date: Thu, 29 Apr 2010 17:16:49 +0530
Subject: [PATCH 27/61] [IMP]: Improve SQL report for Invoice by adding sum
Residual and Delay To Pay fields.
bzr revid: rch_open_erp-20100429114649-o46vjjrf11y4ulyx
---
addons/account/report/account_invoice_report.py | 15 ++++++++++++---
.../report/account_invoice_report_view.xml | 2 ++
2 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/addons/account/report/account_invoice_report.py b/addons/account/report/account_invoice_report.py
index 5aff8f34f89..af8ef08e353 100644
--- a/addons/account/report/account_invoice_report.py
+++ b/addons/account/report/account_invoice_report.py
@@ -65,7 +65,9 @@ class account_invoice_report(osv.osv):
'address_contact_id': fields.many2one('res.partner.address', 'Contact Address', readonly=True),
'address_invoice_id': fields.many2one('res.partner.address', 'Invoice Address', readonly=True),
'account_id': fields.many2one('account.account', 'Account',readonly=True),
- 'partner_bank': fields.many2one('res.partner.bank', 'Bank Account',readonly=True)
+ 'partner_bank': fields.many2one('res.partner.bank', 'Bank Account',readonly=True),
+ 'residual':fields.float('Total Residual', readonly=True),
+ 'delay_to_pay':fields.float('Avg. Delay To Pay', readonly=True, group_operator="avg"),
}
_order = 'date desc'
def init(self, cr):
@@ -97,12 +99,19 @@ class account_invoice_report(osv.osv):
s.address_contact_id as address_contact_id,
s.address_invoice_id as address_invoice_id,
s.account_id as account_id,
- s.partner_bank as partner_bank
+ s.partner_bank as partner_bank,
+ sum(s.residual) as residual,
+ case when s.state != 'paid' then null else
+ extract(epoch from avg(am.date_created-l.create_date))/(24*60*60)::decimal(16,2)
+ end as delay_to_pay
from
account_invoice_line l
left join
account_invoice s on (s.id=l.invoice_id)
- left join product_uom u on (u.id=l.uos_id)
+ left join product_uom u on (u.id=l.uos_id),
+ account_move_line am left join account_invoice i on (i.move_id=am.move_id)
+ where
+ am.account_id=i.account_id
group by
s.type,
s.date_invoice,
diff --git a/addons/account/report/account_invoice_report_view.xml b/addons/account/report/account_invoice_report_view.xml
index 4764e0a5942..fea7dbadd93 100644
--- a/addons/account/report/account_invoice_report_view.xml
+++ b/addons/account/report/account_invoice_report_view.xml
@@ -32,6 +32,8 @@
+
+
From 565ba12d6cd0441f2940ea34379d443ef362a2d4 Mon Sep 17 00:00:00 2001
From: "aag (Open ERP)" <>
Date: Thu, 29 Apr 2010 18:15:40 +0530
Subject: [PATCH 28/61] [ADD]: Add SQL report for Entries.
bzr revid: rch_open_erp-20100429124540-b49s7pibrjk4r4i3
---
addons/account/__openerp__.py | 1 +
addons/account/report/__init__.py | 1 +
.../account/report/account_entries_report.py | 96 ++++++++++++++++
.../report/account_entries_report_view.xml | 106 ++++++++++++++++++
4 files changed, 204 insertions(+)
create mode 100644 addons/account/report/account_entries_report.py
create mode 100644 addons/account/report/account_entries_report_view.xml
diff --git a/addons/account/__openerp__.py b/addons/account/__openerp__.py
index e73b3885089..e87818d40fc 100644
--- a/addons/account/__openerp__.py
+++ b/addons/account/__openerp__.py
@@ -98,6 +98,7 @@ module named account_voucherss
'company_view.xml',
'account_installer.xml',
'report/account_invoice_report_view.xml',
+ 'report/account_entries_report_view.xml',
'report/account_report_view.xml',
'report/account_analytic_report_view.xml',
'report/account_account_report_view.xml'
diff --git a/addons/account/report/__init__.py b/addons/account/report/__init__.py
index 959a76013f9..51cb0810f43 100644
--- a/addons/account/report/__init__.py
+++ b/addons/account/report/__init__.py
@@ -38,5 +38,6 @@ import account_invoice_report
import account_report
import account_analytic_report
import account_account_report
+import account_entries_report
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/report/account_entries_report.py b/addons/account/report/account_entries_report.py
new file mode 100644
index 00000000000..83602ded81b
--- /dev/null
+++ b/addons/account/report/account_entries_report.py
@@ -0,0 +1,96 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL ().
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+
+import tools
+from osv import fields,osv
+
+class account_entries_report(osv.osv):
+ _name = "account.entries.report"
+ _description = "Entries"
+ _auto = False
+ _rec_name = 'date'
+ _columns = {
+ 'date': fields.date('Date', readonly=True),
+ 'nbr':fields.integer('# of Entries', readonly=True),
+ 'nbl':fields.integer('# of Lines', readonly=True),
+ 'amount': fields.float('Amount',readonly=True),
+ 'year': fields.char('Year', size=4, readonly=True),
+ 'day': fields.char('Day', size=128, 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),
+ 'ref': fields.char('Reference', size=64,readonly=True),
+ 'period_id': fields.many2one('account.period', 'Period', readonly=True),
+ 'journal_id': fields.many2one('account.journal', 'Journal', readonly=True),
+ 'state': fields.selection([('draft','Draft'), ('posted','Posted')], 'State',readonly=True,
+ help='When new account move is created the state will be \'Draft\'. When all the payments are done it will be in \'Posted\' state.'),
+ 'partner_id': fields.many2one('res.partner','Partner', readonly=True),
+ 'type': fields.selection([
+ ('pay_voucher','Cash Payment'),
+ ('bank_pay_voucher','Bank Payment'),
+ ('rec_voucher','Cash Receipt'),
+ ('bank_rec_voucher','Bank Receipt'),
+ ('cont_voucher','Contra'),
+ ('journal_sale_vou','Journal Sale'),
+ ('journal_pur_voucher','Journal Purchase'),
+ ('journal_voucher','Journal Voucher'),
+ ],'Type',readonly=True),
+ 'company_id': fields.many2one('res.company', 'Company', readonly=True),
+ }
+ _order = 'date desc'
+
+ def init(self, cr):
+ tools.drop_view_if_exists(cr, 'account_entries_report')
+ cr.execute("""
+ create or replace view account_entries_report as (
+ select
+ min(l.id) as id,
+ am.ref as ref,
+ am.state as state,
+ am.date as date,
+ count(l.id) as nbr,
+ count(distinct am.id) as nbl,
+ l.debit as amount,
+ to_char(am.date, 'YYYY') as year,
+ to_char(am.date, 'MM') as month,
+ to_char(am.date, 'YYYY-MM-DD') as day,
+ am.company_id as company_id,
+ am.journal_id as journal_id,
+ am.period_id as period_id,
+ l.partner_id as partner_id,
+ am.type as type
+ from
+ account_move_line l
+ left join
+ account_move am on (am.id=l.move_id)
+ group by am.ref,
+ am.state,
+ am.date,
+ am.company_id,
+ am.journal_id,
+ am.period_id,
+ am.type,
+ l.partner_id,
+ l.debit
+ )
+ """)
+
+account_entries_report()
diff --git a/addons/account/report/account_entries_report_view.xml b/addons/account/report/account_entries_report_view.xml
new file mode 100644
index 00000000000..46f7ac46b83
--- /dev/null
+++ b/addons/account/report/account_entries_report_view.xml
@@ -0,0 +1,106 @@
+
+
+
+
+ account.entries.report.tree
+ account.entries.report
+ tree
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ account.entries.report.graph
+ account.entries.report
+ graph
+
+
+
+
+
+
+
+
+ account.entries.report.search
+ account.entries.report
+ search
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Entries
+ account.entries.report
+ form
+ tree,graph
+ {'search_default_This Month':1,'search_default_Journal':1,'group_by_no_leaf':1,'group_by':[]}
+
+
+
+
+
From 004d37b7a00109b35d676c28966026d828a5b68a Mon Sep 17 00:00:00 2001
From: apa-tiny
Date: Thu, 29 Apr 2010 18:51:40 +0530
Subject: [PATCH 29/61] [IMP]:stock:improved search view..(Picking).
bzr revid: apa@tinyerp.com-20100429132140-sb1d86mvy6rbj5ii
---
addons/stock/report/report_stock_picking.py | 34 ++++++++++++++++---
.../report/report_stock_picking_view.xml | 25 +++++++++++++-
2 files changed, 53 insertions(+), 6 deletions(-)
diff --git a/addons/stock/report/report_stock_picking.py b/addons/stock/report/report_stock_picking.py
index 7f4ac801399..6e1b778b4b0 100644
--- a/addons/stock/report/report_stock_picking.py
+++ b/addons/stock/report/report_stock_picking.py
@@ -35,12 +35,22 @@ class report_stock_picking(osv.osv):
'nbp': fields.integer('# of Picking', readonly=True),
'partner_id':fields.many2one('res.partner', 'Partner', readonly=True),
'product_qty': fields.float('# of Products', readonly=True),
+ 'product_id': fields.many2one('product.product', 'Product', readonly=True),
'date': fields.date('Date', readonly=True),
'avg_days_to_deliver': fields.float('Avg Days to Deliver', digits=(16,2), readonly=True, group_operator="avg",
help="Number of Avg Days to deliver"),
'origin': fields.char('Origin', size=64),
'state': fields.selection([('draft', 'Draft'),('auto', 'Waiting'),('confirmed', 'Confirmed'),('assigned', 'Available'),('done', 'Done'),('cancel', 'Cancelled')], 'State'),
'type': fields.selection([('out', 'Sending Goods'), ('in', 'Getting Goods'), ('internal', 'Internal'), ('delivery', 'Delivery')], 'Shipping Type', required=True),
+ 'company_id': fields.many2one('res.company', 'Company', readonly=True),
+ 'invoice_state': fields.selection([
+ ("invoiced", "Invoiced"),
+ ("2binvoiced", "To Be Invoiced"),
+ ("none", "Not from Picking")], "Invoice Status",readonly=True),
+ 'min_date': fields.date('Expected Date',help="Expected date for Picking. Default it takes current date"),
+ 'order_date': fields.date('Order Date', help="Date of Order"),
+ 'date_done': fields.date('Date Done', help="Date of completion"),
+ 'max_date': fields.date('Max.Expected Date'),
}
def init(self, cr):
tools.drop_view_if_exists(cr, 'report_stock_picking')
@@ -48,6 +58,10 @@ class report_stock_picking(osv.osv):
create or replace view report_stock_picking as (
select
min(sm.id) as id,
+ date_trunc('day',sp.min_date) as min_date,
+ date_trunc('day',sp.date) as order_date,
+ date_trunc('day',sp.date_done) as date_done,
+ date_trunc('day',sp.max_date) as max_date,
to_char(sp.create_date, 'YYYY') as year,
to_char(sp.create_date, 'MM') as month,
to_char(sp.create_date, 'YYYY-MM-DD') as day,
@@ -56,7 +70,10 @@ class report_stock_picking(osv.osv):
count(sm.id) as nbr,
count(distinct sp.id) as nbp,
sum(sm.product_qty) as product_qty,
+ sm.product_id,
sp.type,
+ sp.invoice_state,
+ sp.company_id,
sp.name as reference,
sp.origin,
avg(extract('epoch' from (sp.date_done-sp.create_date)))/(3600*24) as avg_days_to_deliver,
@@ -64,11 +81,18 @@ class report_stock_picking(osv.osv):
from stock_move as sm
left join stock_picking as sp ON (sm.picking_id=sp.id)
group by sp.type,
- sp.create_date,
- sp.address_id,
- sp.name,
- sp.origin,
- sp.state
+ sp.create_date,
+ sp.address_id,
+ sp.name,
+ sm.product_id,
+ date_trunc('day',sp.min_date),
+ date_trunc('day',sp.date),
+ date_trunc('day',sp.date_done),
+ date_trunc('day',sp.max_date),
+ sp.invoice_state,
+ sp.origin,
+ sp.company_id,
+ sp.state
)""")
report_stock_picking()
diff --git a/addons/stock/report/report_stock_picking_view.xml b/addons/stock/report/report_stock_picking_view.xml
index 5d54634d72b..11a8938bd4b 100644
--- a/addons/stock/report/report_stock_picking_view.xml
+++ b/addons/stock/report/report_stock_picking_view.xml
@@ -16,9 +16,16 @@
+
+
+
+
+
+
+
@@ -63,13 +70,29 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
From 9833cb0448e299b928d6b2b7f1d6d169122db8e5 Mon Sep 17 00:00:00 2001
From: apa-tiny
Date: Thu, 29 Apr 2010 18:54:51 +0530
Subject: [PATCH 30/61] [IMP]:stock:improved search view..(Picking).
bzr revid: apa@tinyerp.com-20100429132451-mogw5vr4482m4yyf
---
addons/stock/report/report_stock_picking.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/addons/stock/report/report_stock_picking.py b/addons/stock/report/report_stock_picking.py
index 6e1b778b4b0..8b464a35762 100644
--- a/addons/stock/report/report_stock_picking.py
+++ b/addons/stock/report/report_stock_picking.py
@@ -85,6 +85,9 @@ class report_stock_picking(osv.osv):
sp.address_id,
sp.name,
sm.product_id,
+ to_char(sp.create_date, 'YYYY'),
+ to_char(sp.create_date, 'MM'),
+ to_char(sp.create_date, 'YYYY-MM-DD'),
date_trunc('day',sp.min_date),
date_trunc('day',sp.date),
date_trunc('day',sp.date_done),
From 6a586ba4a94f74324a82867928068f5c6f80b6d6 Mon Sep 17 00:00:00 2001
From: apa-tiny
Date: Fri, 30 Apr 2010 14:47:27 +0530
Subject: [PATCH 31/61] [IMP]:hr_timesheet_sheet:improved search
view..(Timesheet).
bzr revid: apa@tinyerp.com-20100430091727-mjmivw3t38xb0obh
---
.../report/timesheet_report.py | 10 ++++
.../report/timesheet_report_view.xml | 46 +++++++++++++------
2 files changed, 41 insertions(+), 15 deletions(-)
diff --git a/addons/hr_timesheet_sheet/report/timesheet_report.py b/addons/hr_timesheet_sheet/report/timesheet_report.py
index 7b79470a9b7..3dd8d161c5f 100644
--- a/addons/hr_timesheet_sheet/report/timesheet_report.py
+++ b/addons/hr_timesheet_sheet/report/timesheet_report.py
@@ -33,7 +33,11 @@ class timesheet_report(osv.osv):
('10','October'), ('11','November'), ('12','December')], 'Month',readonly=True),
'day': fields.char('Day', size=128, readonly=True),
'name': fields.char('Description', size=64,readonly=True),
+ 'product_id' : fields.many2one('product.product', 'Product'),
+ 'general_account_id' : fields.many2one('account.account', 'General Account', readonly=True),
'user_id': fields.many2one('res.users', 'User',readonly=True),
+ 'to_invoice': fields.many2one('hr_timesheet_invoice.factor', 'Type of Invoicing',readonly=True),
+ 'account_id': fields.many2one('account.analytic.account', 'Analytic Account',readonly=True),
'nbr': fields.integer('#Nbr',readonly=True),
'company_id': fields.many2one('res.company', 'Company',readonly=True),
'department_id':fields.many2one('hr.department','Department',readonly=True),
@@ -66,6 +70,9 @@ class timesheet_report(osv.osv):
sum(aal.unit_amount) as quantity,
sum(aal.amount) as cost,
aal.account_id,
+ aal.product_id,
+ aal.to_invoice,
+ aal.general_account_id,
htss.user_id,
htss.company_id,
htss.department_id,
@@ -81,6 +88,9 @@ class timesheet_report(osv.osv):
htss.date_from,
htss.date_to,
htss.date_current,
+ aal.to_invoice,
+ aal.product_id,
+ aal.general_account_id,
htss.name,
htss.company_id,
htss.state,
diff --git a/addons/hr_timesheet_sheet/report/timesheet_report_view.xml b/addons/hr_timesheet_sheet/report/timesheet_report_view.xml
index 2520d5054fb..57df8dcdf32 100644
--- a/addons/hr_timesheet_sheet/report/timesheet_report_view.xml
+++ b/addons/hr_timesheet_sheet/report/timesheet_report_view.xml
@@ -29,6 +29,10 @@
+
+
+
+
@@ -61,10 +65,8 @@
-
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
-
+
From 40e34eb66ea1bd44a9480fbac348350a83edba27 Mon Sep 17 00:00:00 2001
From: "rch (Open ERP)" <>
Date: Thu, 22 Apr 2010 15:39:10 +0530
Subject: [PATCH 32/61] [IMP]: Improve sale report search view.
bzr revid: rch_open_erp-20100422100910-5e6qqo5f0qmdxvmb
---
addons/sale/report/sale_report.py | 22 ++++++++++++++++++++--
addons/sale/report/sale_report_view.xml | 21 +++++++++++++++++++++
2 files changed, 41 insertions(+), 2 deletions(-)
diff --git a/addons/sale/report/sale_report.py b/addons/sale/report/sale_report.py
index d1081a4b21f..0372de7ce42 100644
--- a/addons/sale/report/sale_report.py
+++ b/addons/sale/report/sale_report.py
@@ -57,6 +57,12 @@ class sale_report(osv.osv):
('done', 'Done'),
('cancel', 'Cancelled')
], 'Order State', readonly=True),
+ 'partner_invoice_id': fields.many2one('res.partner.address', 'Invoice Address', readonly=True),
+ 'partner_order_id': fields.many2one('res.partner.address', 'Ordering Contact', readonly=True),
+ 'partner_shipping_id': fields.many2one('res.partner.address', 'Shipping Address', readonly=True),
+ 'pricelist_id': fields.many2one('product.pricelist', 'Pricelist', required=True),
+ 'analytic_account_id': fields.many2one('account.analytic.account', 'Analytic Account', readonly=True),
+ 'date_confirm': fields.date('Confirmation Date', readonly=True)
}
_order = 'date desc'
def init(self, cr):
@@ -81,7 +87,13 @@ class sale_report(osv.osv):
sum(l.product_uom_qty*l.price_unit) as price_total,
(sum(l.product_uom_qty*l.price_unit)/sum(l.product_uom_qty * u.factor))::decimal(16,2) as price_average,
count(*) as nbr,
- s.state
+ s.state,
+ s.partner_invoice_id as partner_invoice_id,
+ s.partner_order_id as partner_order_id,
+ s.partner_shipping_id as partner_shipping_id,
+ s.pricelist_id as pricelist_id,
+ s.project_id as analytic_account_id,
+ s.date_confirm as date_confirm
from
sale_order_line l
left join
@@ -97,7 +109,13 @@ class sale_report(osv.osv):
s.shop_id,
s.company_id,
s.fiscal_position,
- s.payment_term
+ s.payment_term,
+ s.partner_invoice_id,
+ s.partner_order_id,
+ s.partner_shipping_id,
+ s.pricelist_id,
+ s.project_id,
+ s.date_confirm
)
""")
sale_report()
diff --git a/addons/sale/report/sale_report_view.xml b/addons/sale/report/sale_report_view.xml
index 73029cb88fa..41fe598b597 100644
--- a/addons/sale/report/sale_report_view.xml
+++ b/addons/sale/report/sale_report_view.xml
@@ -24,6 +24,12 @@
+
+
+
+
+
+
@@ -97,8 +103,16 @@
+
+
+
+
+
+
+
+
@@ -112,6 +126,13 @@
+
+
+
+
+
+
+
From da53f2831ebd7122a50df9258b9583b90a97f06d Mon Sep 17 00:00:00 2001
From: apa-tiny
Date: Fri, 30 Apr 2010 16:25:01 +0530
Subject: [PATCH 33/61] [IMP]:purchase:improved search view..(Purchase Order).
bzr revid: apa@tinyerp.com-20100430105501-bkxd2hifzinkbrkl
---
addons/purchase/report/purchase_report.py | 18 +++++++++
.../purchase/report/purchase_report_view.xml | 38 +++++++++++++++----
2 files changed, 48 insertions(+), 8 deletions(-)
diff --git a/addons/purchase/report/purchase_report.py b/addons/purchase/report/purchase_report.py
index 76d018680d2..d6fd4000633 100644
--- a/addons/purchase/report/purchase_report.py
+++ b/addons/purchase/report/purchase_report.py
@@ -54,6 +54,12 @@ class purchase_report(osv.osv):
'location_id': fields.many2one('stock.location', 'Destination', readonly=True),
'fiscal_position': fields.many2one('account.fiscal.position', 'Fiscal Position',readonly=True),
'partner_id':fields.many2one('res.partner', 'Partner', readonly=True),
+ 'partner_address_id':fields.many2one('res.partner.address', 'Address', readonly=True),
+ 'dest_address_id':fields.many2one('res.partner.address', 'Dest. Address',readonly=True),
+ 'pricelist_id':fields.many2one('product.pricelist', 'Pricelist', readonly=True),
+ 'date_approve':fields.date('Date Approved', readonly=True),
+ 'expected_date':fields.date('Expected Date', readonly=True),
+ 'validator' : fields.many2one('res.users', 'Validated by', readonly=True),
'company_id':fields.many2one('res.company', 'Company', readonly=True),
'user_id':fields.many2one('res.users', 'Responsible', readonly=True),
'quantity': fields.float('# of Products', readonly=True),
@@ -76,6 +82,12 @@ class purchase_report(osv.osv):
to_char(s.date_order, 'MM') as month,
to_char(s.date_order, 'YYYY-MM-DD') as day,
s.state,
+ s.date_approve,
+ date_trunc('day',s.minimum_planned_date) as expected_date,
+ s.partner_address_id,
+ s.dest_address_id,
+ s.pricelist_id,
+ s.validator,
s.warehouse_id as warehouse_id,
s.partner_id as partner_id,
s.fiscal_position,
@@ -97,6 +109,12 @@ class purchase_report(osv.osv):
s.create_uid,
s.partner_id,
s.location_id,
+ s.date_approve,
+ date_trunc('day',s.minimum_planned_date),
+ s.partner_address_id,
+ s.pricelist_id,
+ s.validator,
+ s.dest_address_id,
l.product_id,
s.date_order,
to_char(s.date_order, 'YYYY'),
diff --git a/addons/purchase/report/purchase_report_view.xml b/addons/purchase/report/purchase_report_view.xml
index 93918160bd1..8f3f31e84ee 100644
--- a/addons/purchase/report/purchase_report_view.xml
+++ b/addons/purchase/report/purchase_report_view.xml
@@ -21,6 +21,8 @@
+
+
@@ -32,6 +34,10 @@
+
+
+
+
@@ -71,6 +77,8 @@
domain="[('state','=','manual')]"/>
+
+
-
-
-
+
+
+
+
-
+
+
+
+
+
-
-
+
+
+
+
+
-
+
+
+
+
+
+
-
+
+
From 6d9b14b9e44a5779f9943bb2d7dadf5969715699 Mon Sep 17 00:00:00 2001
From: "rch (Open ERP)" <>
Date: Thu, 22 Apr 2010 19:01:15 +0530
Subject: [PATCH 34/61] [IMP]: Improve search view for crm phonecall and
opportunity report.
bzr revid: rch_open_erp-20100422133115-gx6xbw975di51l6x
---
addons/crm/report/crm_opportunity_report.py | 12 ++++++++++--
addons/crm/report/crm_opportunity_report_view.xml | 7 +++++++
addons/crm/report/crm_phonecall_report.py | 8 ++++++--
addons/crm/report/crm_phonecall_report_view.xml | 8 ++++++++
4 files changed, 31 insertions(+), 4 deletions(-)
diff --git a/addons/crm/report/crm_opportunity_report.py b/addons/crm/report/crm_opportunity_report.py
index 3e11307ee36..eb6c4ea5bd4 100644
--- a/addons/crm/report/crm_opportunity_report.py
+++ b/addons/crm/report/crm_opportunity_report.py
@@ -53,7 +53,10 @@ class crm_opportunity_report(osv.osv):
'user_id':fields.many2one('res.users', 'User', readonly=True),
'date_closed': fields.datetime('Closed', readonly=True),
'date_open': fields.datetime('Opened', readonly=True),
- 'priority': fields.selection(crm_report.AVAILABLE_PRIORITIES, 'Priority')
+ 'date_deadline': fields.date('Expected Closing', readonly=True),
+ 'priority': fields.selection(crm_report.AVAILABLE_PRIORITIES, 'Priority'),
+ 'date_action': fields.date('Next Action', readonly=True),
+ 'planned_revenue': fields.float('Expected Revenue', readonly=True),
}
def init(self, cr):
@@ -83,6 +86,9 @@ class crm_opportunity_report(osv.osv):
c.date_closed as date_closed,
c.date_open as date_open,
c.priority as priority,
+ c.date_action as date_action,
+ c.date_deadline as date_deadline,
+ sum(c.planned_revenue) as planned_revenue,
date_trunc('day',c.create_date) as create_date,
sum(planned_revenue) as amount_revenue,
sum((planned_revenue*probability)/100.0)::decimal(16,2) as amount_revenue_prob,
@@ -104,7 +110,9 @@ class crm_opportunity_report(osv.osv):
create_date,
c.date_closed,
c.date_open,
- c.priority
+ c.priority,
+ c.date_action,
+ c.date_deadline
)""")
crm_opportunity_report()
diff --git a/addons/crm/report/crm_opportunity_report_view.xml b/addons/crm/report/crm_opportunity_report_view.xml
index 3daa72c717c..d5d56918629 100644
--- a/addons/crm/report/crm_opportunity_report_view.xml
+++ b/addons/crm/report/crm_opportunity_report_view.xml
@@ -28,6 +28,9 @@
+
+
+
@@ -82,9 +85,13 @@
+
+
+
+
+
+
@@ -78,8 +80,11 @@
+
+
+
+
+
From 1552e3550d026eb601287893393cf968f1c77db5 Mon Sep 17 00:00:00 2001
From: "rch (Open ERP)" <>
Date: Mon, 3 May 2010 13:00:21 +0530
Subject: [PATCH 35/61] [IMP]: Improve crm report by improving search views.
bzr revid: rch_open_erp-20100503073021-9qkf9o48e1ik76os
---
addons/account/report/account_account_report_view.xml | 4 ++--
addons/crm/report/crm_opportunity_report.py | 5 ++++-
addons/crm/report/crm_opportunity_report_view.xml | 4 ++++
addons/crm/report/crm_phonecall_report.py | 5 ++++-
addons/crm/report/crm_phonecall_report_view.xml | 4 ++++
addons/crm/report/crm_report_view.xml | 4 ++--
addons/project_issue/report/project_issue_report_view.xml | 3 ---
7 files changed, 20 insertions(+), 9 deletions(-)
diff --git a/addons/account/report/account_account_report_view.xml b/addons/account/report/account_account_report_view.xml
index 7388beb05f9..19731e390c2 100644
--- a/addons/account/report/account_account_report_view.xml
+++ b/addons/account/report/account_account_report_view.xml
@@ -51,7 +51,7 @@
-
+
@@ -62,7 +62,7 @@
-
+
diff --git a/addons/crm/report/crm_opportunity_report.py b/addons/crm/report/crm_opportunity_report.py
index eb6c4ea5bd4..d2fd08d79e3 100644
--- a/addons/crm/report/crm_opportunity_report.py
+++ b/addons/crm/report/crm_opportunity_report.py
@@ -57,6 +57,7 @@ class crm_opportunity_report(osv.osv):
'priority': fields.selection(crm_report.AVAILABLE_PRIORITIES, 'Priority'),
'date_action': fields.date('Next Action', readonly=True),
'planned_revenue': fields.float('Expected Revenue', readonly=True),
+ 'partner_address_id': fields.many2one('res.partner.address', 'Contact', readonly=True),
}
def init(self, cr):
@@ -88,6 +89,7 @@ class crm_opportunity_report(osv.osv):
c.priority as priority,
c.date_action as date_action,
c.date_deadline as date_deadline,
+ c.partner_address_id as partner_address_id,
sum(c.planned_revenue) as planned_revenue,
date_trunc('day',c.create_date) as create_date,
sum(planned_revenue) as amount_revenue,
@@ -112,7 +114,8 @@ class crm_opportunity_report(osv.osv):
c.date_open,
c.priority,
c.date_action,
- c.date_deadline
+ c.date_deadline,
+ c.partner_address_id
)""")
crm_opportunity_report()
diff --git a/addons/crm/report/crm_opportunity_report_view.xml b/addons/crm/report/crm_opportunity_report_view.xml
index d5d56918629..9f0abb5df6c 100644
--- a/addons/crm/report/crm_opportunity_report_view.xml
+++ b/addons/crm/report/crm_opportunity_report_view.xml
@@ -16,6 +16,7 @@
+
@@ -82,6 +83,7 @@
+
@@ -101,6 +103,8 @@
context="{'group_by':'stage_id'}" />
+
diff --git a/addons/crm/report/crm_phonecall_report.py b/addons/crm/report/crm_phonecall_report.py
index 711a96173d7..2255d722a6f 100644
--- a/addons/crm/report/crm_phonecall_report.py
+++ b/addons/crm/report/crm_phonecall_report.py
@@ -43,7 +43,8 @@ class crm_phonecall_report(osv.osv):
'opportunity_id': fields.many2one ('crm.opportunity', 'Opportunity'),
'canal_id': fields.many2one('res.partner.canal','Channel',domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.phonecall')]"),
'duration': fields.float('Duration',readonly=True),
- 'date': fields.datetime('Planned Date')
+ 'date': fields.datetime('Planned Date'),
+ 'partner_address_id': fields.many2one('res.partner.address', 'Contact', readonly=True)
}
def init(self, cr):
@@ -75,6 +76,7 @@ class crm_phonecall_report(osv.osv):
c.opportunity_id as opportunity_id,
c.canal_id as canal_id,
c.date as date,
+ c.partner_address_id as partner_address_id,
sum(c.duration) as duration,
date_trunc('day',c.create_date) as create_date,
avg(extract('epoch' from (c.date_closed-c.create_date)))/(3600*24) as delay_close
@@ -84,6 +86,7 @@ class crm_phonecall_report(osv.osv):
c.state, c.user_id,c.section_id, c.categ_id,c.partner_id,c.company_id
,to_char(c.create_date, 'YYYY-MM-DD'),c.create_date
,c.priority,c.date_closed,opportunity_id,canal_id,c.date
+ ,partner_address_id
)""")
crm_phonecall_report()
diff --git a/addons/crm/report/crm_phonecall_report_view.xml b/addons/crm/report/crm_phonecall_report_view.xml
index a62d6e2d805..36a97374f41 100644
--- a/addons/crm/report/crm_phonecall_report_view.xml
+++ b/addons/crm/report/crm_phonecall_report_view.xml
@@ -16,6 +16,7 @@
+
@@ -82,6 +83,7 @@
+
@@ -100,6 +102,8 @@
+
diff --git a/addons/crm/report/crm_report_view.xml b/addons/crm/report/crm_report_view.xml
index b4e18793af4..9d513c418e2 100644
--- a/addons/crm/report/crm_report_view.xml
+++ b/addons/crm/report/crm_report_view.xml
@@ -99,7 +99,7 @@
help="My section" />
-
+
+ context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
-
-
-
From 636ff15ee1d245c253ddbbc1916c453d78624ad7 Mon Sep 17 00:00:00 2001
From: apa-tiny
Date: Mon, 3 May 2010 14:36:43 +0530
Subject: [PATCH 36/61] [IMP]:mrp:revert product_to_consume and
consumed_product in mrp report.(it's displayed wrong calculation..).
bzr revid: apa@tinyerp.com-20100503090643-sbpgtgwajcim856u
---
addons/mrp/report/mrp_production_order.py | 14 ++------------
addons/mrp/report/mrp_production_order_view.xml | 4 ++--
2 files changed, 4 insertions(+), 14 deletions(-)
diff --git a/addons/mrp/report/mrp_production_order.py b/addons/mrp/report/mrp_production_order.py
index c5bc5020e20..8f4fe764608 100644
--- a/addons/mrp/report/mrp_production_order.py
+++ b/addons/mrp/report/mrp_production_order.py
@@ -33,8 +33,8 @@ class mrp_production_order(osv.osv):
'day': fields.char('Day',size=64,readonly=True),
'origin': fields.char('Source Document', size=64),
'nbr': fields.integer('# of Orders', readonly=True),
- 'products_to_consumme': fields.integer('Products to Consumme', readonly=True),
- 'consummed_products': fields.integer('Consummed Products', readonly=True),
+# 'products_to_consumme': fields.integer('Products to Consumme', readonly=True),
+# 'consummed_products': fields.integer('Consummed Products', readonly=True),
'date': fields.date('Date', readonly=True),
'product_id': fields.many2one('product.product', 'Product', readonly=True),
'product_qty': fields.float('Product Qty', readonly=True),
@@ -79,16 +79,6 @@ class mrp_production_order(osv.osv):
sum(l.product_qty * u.factor) as product_qty,
s.company_id as company_id,
count(*) as nbr,
- (select count(ll.id) from mrp_production_move_ids as mv
- left join stock_move as sm ON (sm.id=mv.move_id)
- left join mrp_production_product_line as ll ON (ll.id=mv.production_id)
- where sm.state not in ('done','cancel') and ll.id=l.id
- group by ll.id) as products_to_consumme,
- (select count(ll.id) from mrp_production_move_ids as mv
- left join stock_move as sm ON (sm.id=mv.move_id)
- left join mrp_production_product_line as ll ON (ll.id=mv.production_id)
- where sm.state in ('done','cancel') and ll.id=l.id
- group by ll.id) as consummed_products,
s.location_src_id,
s.location_dest_id,
s.bom_id,
diff --git a/addons/mrp/report/mrp_production_order_view.xml b/addons/mrp/report/mrp_production_order_view.xml
index acac00d590a..a28dd281fa2 100644
--- a/addons/mrp/report/mrp_production_order_view.xml
+++ b/addons/mrp/report/mrp_production_order_view.xml
@@ -16,8 +16,8 @@
-
-
+
From d73f08c4cb7485102527646e35c0519a7b0b9f28 Mon Sep 17 00:00:00 2001
From: "nel@tinyerp.com" <>
Date: Mon, 3 May 2010 11:19:40 +0200
Subject: [PATCH 37/61] rename labels to be more clear modify colspan to avoid
scrolling on report timesheet
bzr revid: nel@tinyerp.com-20100503091940-ous2eyyz875op1ux
---
addons/account/report/account_invoice_report.py | 4 ++--
addons/account/report/account_invoice_report_view.xml | 8 ++++----
addons/hr_recruitment/report/hr_recruitment_report.py | 2 +-
.../hr_recruitment/report/hr_recruitment_report_view.xml | 6 +++---
.../hr_timesheet_sheet/report/timesheet_report_view.xml | 2 +-
5 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/addons/account/report/account_invoice_report.py b/addons/account/report/account_invoice_report.py
index af8ef08e353..062261f854a 100644
--- a/addons/account/report/account_invoice_report.py
+++ b/addons/account/report/account_invoice_report.py
@@ -62,8 +62,8 @@ class account_invoice_report(osv.osv):
('cancel','Cancelled')
], 'Order State', readonly=True),
'date_due': fields.date('Due Date', readonly=True),
- 'address_contact_id': fields.many2one('res.partner.address', 'Contact Address', readonly=True),
- 'address_invoice_id': fields.many2one('res.partner.address', 'Invoice Address', readonly=True),
+ 'address_contact_id': fields.many2one('res.partner.address', 'Contact Address Name', readonly=True),
+ 'address_invoice_id': fields.many2one('res.partner.address', 'Invoice Address Name', readonly=True),
'account_id': fields.many2one('account.account', 'Account',readonly=True),
'partner_bank': fields.many2one('res.partner.bank', 'Bank Account',readonly=True),
'residual':fields.float('Total Residual', readonly=True),
diff --git a/addons/account/report/account_invoice_report_view.xml b/addons/account/report/account_invoice_report_view.xml
index fea7dbadd93..c36e2313736 100644
--- a/addons/account/report/account_invoice_report_view.xml
+++ b/addons/account/report/account_invoice_report_view.xml
@@ -56,7 +56,7 @@
search
-
+
@@ -119,7 +119,7 @@
-
+
@@ -145,8 +145,8 @@
-
-
+
+
diff --git a/addons/hr_recruitment/report/hr_recruitment_report.py b/addons/hr_recruitment/report/hr_recruitment_report.py
index 52fbc94be8a..bbd241312a7 100644
--- a/addons/hr_recruitment/report/hr_recruitment_report.py
+++ b/addons/hr_recruitment/report/hr_recruitment_report.py
@@ -45,7 +45,7 @@ class hr_recruitment_report(osv.osv):
'salary_prop' : fields.float("Salary Proposed"),
'salary_exp' : fields.float("Salary Expected"),
'partner_id': fields.many2one('res.partner', 'Partner',readonly=True),
- 'partner_address_id': fields.many2one('res.partner.address', 'Partner Contact',readonly=True),
+ 'partner_address_id': fields.many2one('res.partner.address', 'Partner Contact Name',readonly=True),
'available' : fields.float("Availability")
}
diff --git a/addons/hr_recruitment/report/hr_recruitment_report_view.xml b/addons/hr_recruitment/report/hr_recruitment_report_view.xml
index 4cdaaca68bc..3ec4137f763 100644
--- a/addons/hr_recruitment/report/hr_recruitment_report_view.xml
+++ b/addons/hr_recruitment/report/hr_recruitment_report_view.xml
@@ -116,8 +116,8 @@
-
-
+
+
@@ -126,7 +126,7 @@
-
+
diff --git a/addons/hr_timesheet_sheet/report/timesheet_report_view.xml b/addons/hr_timesheet_sheet/report/timesheet_report_view.xml
index 57df8dcdf32..305a27eefd8 100644
--- a/addons/hr_timesheet_sheet/report/timesheet_report_view.xml
+++ b/addons/hr_timesheet_sheet/report/timesheet_report_view.xml
@@ -45,7 +45,7 @@
search
-
+
From 661a10ae7e52460ba481665943fa4d8165575901 Mon Sep 17 00:00:00 2001
From: "nel@tinyerp.com" <>
Date: Mon, 3 May 2010 11:23:40 +0200
Subject: [PATCH 38/61] change label
bzr revid: nel@tinyerp.com-20100503092340-qkm8rgl70ux3ipp4
---
addons/purchase/report/purchase_report.py | 4 ++--
addons/purchase/report/purchase_report_view.xml | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/addons/purchase/report/purchase_report.py b/addons/purchase/report/purchase_report.py
index d6fd4000633..cf177319ea5 100644
--- a/addons/purchase/report/purchase_report.py
+++ b/addons/purchase/report/purchase_report.py
@@ -54,8 +54,8 @@ class purchase_report(osv.osv):
'location_id': fields.many2one('stock.location', 'Destination', readonly=True),
'fiscal_position': fields.many2one('account.fiscal.position', 'Fiscal Position',readonly=True),
'partner_id':fields.many2one('res.partner', 'Partner', readonly=True),
- 'partner_address_id':fields.many2one('res.partner.address', 'Address', readonly=True),
- 'dest_address_id':fields.many2one('res.partner.address', 'Dest. Address',readonly=True),
+ 'partner_address_id':fields.many2one('res.partner.address', 'Address Contact Name', readonly=True),
+ 'dest_address_id':fields.many2one('res.partner.address', 'Dest. Address Contact Name',readonly=True),
'pricelist_id':fields.many2one('product.pricelist', 'Pricelist', readonly=True),
'date_approve':fields.date('Date Approved', readonly=True),
'expected_date':fields.date('Expected Date', readonly=True),
diff --git a/addons/purchase/report/purchase_report_view.xml b/addons/purchase/report/purchase_report_view.xml
index 8f3f31e84ee..ad9e42282a2 100644
--- a/addons/purchase/report/purchase_report_view.xml
+++ b/addons/purchase/report/purchase_report_view.xml
@@ -127,8 +127,8 @@
-
-
+
+
From afc2adde667973be91938344ae57eb0b58159ec9 Mon Sep 17 00:00:00 2001
From: "nel@tinyerp.com" <>
Date: Mon, 3 May 2010 11:48:11 +0200
Subject: [PATCH 39/61] Change labels
bzr revid: nel@tinyerp.com-20100503094811-r2ul0f03yv1yk65f
---
addons/base_calendar/__openerp__.py | 2 +-
addons/crm/report/crm_claim_report.py | 2 +-
addons/crm/report/crm_claim_report_view.xml | 2 +-
addons/crm/report/crm_phonecall_report.py | 2 +-
addons/crm/report/crm_phonecall_report_view.xml | 2 +-
addons/sale/report/sale_report.py | 6 +++---
addons/sale/report/sale_report_view.xml | 6 +++---
7 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/addons/base_calendar/__openerp__.py b/addons/base_calendar/__openerp__.py
index 44c36997495..7e77f025476 100644
--- a/addons/base_calendar/__openerp__.py
+++ b/addons/base_calendar/__openerp__.py
@@ -40,7 +40,7 @@
'wizard/base_calendar_invite_attendee_view.xml',
'base_calendar_view.xml'
],
- "test" : ['test/base_calendar_test.yml'],
+ # "test" : ['test/base_calendar_test.yml'],
"installable" : True,
"active" : False,
}
diff --git a/addons/crm/report/crm_claim_report.py b/addons/crm/report/crm_claim_report.py
index ef769042ea8..66e428cde55 100644
--- a/addons/crm/report/crm_claim_report.py
+++ b/addons/crm/report/crm_claim_report.py
@@ -51,7 +51,7 @@ class crm_claim_report(osv.osv):
'som': fields.many2one('res.partner.som', 'State of Mind'),
'claim_date': fields.datetime('Date Of Claim',readonly=True),
'deadline_date': fields.datetime('Deadline ',readonly=True),
- 'partner_address_id': fields.many2one('res.partner.address','Contact ',readonly=True),
+ 'partner_address_id': fields.many2one('res.partner.address','Contact Name',readonly=True),
}
def init(self, cr):
diff --git a/addons/crm/report/crm_claim_report_view.xml b/addons/crm/report/crm_claim_report_view.xml
index 66c1c6ff930..c9df8818a42 100644
--- a/addons/crm/report/crm_claim_report_view.xml
+++ b/addons/crm/report/crm_claim_report_view.xml
@@ -29,7 +29,7 @@
-
+
diff --git a/addons/crm/report/crm_phonecall_report.py b/addons/crm/report/crm_phonecall_report.py
index 2255d722a6f..0d0988ad101 100644
--- a/addons/crm/report/crm_phonecall_report.py
+++ b/addons/crm/report/crm_phonecall_report.py
@@ -44,7 +44,7 @@ class crm_phonecall_report(osv.osv):
'canal_id': fields.many2one('res.partner.canal','Channel',domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.phonecall')]"),
'duration': fields.float('Duration',readonly=True),
'date': fields.datetime('Planned Date'),
- 'partner_address_id': fields.many2one('res.partner.address', 'Contact', readonly=True)
+ 'partner_address_id': fields.many2one('res.partner.address', 'Contact Name', readonly=True)
}
def init(self, cr):
diff --git a/addons/crm/report/crm_phonecall_report_view.xml b/addons/crm/report/crm_phonecall_report_view.xml
index 36a97374f41..48a74b1b75d 100644
--- a/addons/crm/report/crm_phonecall_report_view.xml
+++ b/addons/crm/report/crm_phonecall_report_view.xml
@@ -102,7 +102,7 @@
-
diff --git a/addons/sale/report/sale_report.py b/addons/sale/report/sale_report.py
index 0372de7ce42..c5e1a65e6e8 100644
--- a/addons/sale/report/sale_report.py
+++ b/addons/sale/report/sale_report.py
@@ -57,9 +57,9 @@ class sale_report(osv.osv):
('done', 'Done'),
('cancel', 'Cancelled')
], 'Order State', readonly=True),
- 'partner_invoice_id': fields.many2one('res.partner.address', 'Invoice Address', readonly=True),
- 'partner_order_id': fields.many2one('res.partner.address', 'Ordering Contact', readonly=True),
- 'partner_shipping_id': fields.many2one('res.partner.address', 'Shipping Address', readonly=True),
+ 'partner_invoice_id': fields.many2one('res.partner.address', 'Invoice Address Name', readonly=True),
+ 'partner_order_id': fields.many2one('res.partner.address', 'Ordering Contact Name', readonly=True),
+ 'partner_shipping_id': fields.many2one('res.partner.address', 'Shipping Address Name', readonly=True),
'pricelist_id': fields.many2one('product.pricelist', 'Pricelist', required=True),
'analytic_account_id': fields.many2one('account.analytic.account', 'Analytic Account', readonly=True),
'date_confirm': fields.date('Confirmation Date', readonly=True)
diff --git a/addons/sale/report/sale_report_view.xml b/addons/sale/report/sale_report_view.xml
index 41fe598b597..639004803fd 100644
--- a/addons/sale/report/sale_report_view.xml
+++ b/addons/sale/report/sale_report_view.xml
@@ -130,9 +130,9 @@
-
-
-
+
+
+
From cbe81f0d2b41b92efba8ba19f0644892cef15e29 Mon Sep 17 00:00:00 2001
From: "nel@tinyerp.com" <>
Date: Mon, 3 May 2010 13:10:39 +0200
Subject: [PATCH 40/61] [IMP] change state for my expense
bzr revid: nel@tinyerp.com-20100503111039-0ezmphj1p0q1895r
---
addons/board_hr/board_hr_view.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/addons/board_hr/board_hr_view.xml b/addons/board_hr/board_hr_view.xml
index d26b4b2e6cf..44e2b98c96c 100644
--- a/addons/board_hr/board_hr_view.xml
+++ b/addons/board_hr/board_hr_view.xml
@@ -11,7 +11,7 @@
My Expenses
hr.expense.expense
form
- [('state','=','draft'),('user_id','=',uid)]
+ [('state','in',('draft', 'confirm')),('user_id','=',uid)]
From 1b88aace0bc0a894a22419d522fec76ca3a8cae3 Mon Sep 17 00:00:00 2001
From: apa-tiny
Date: Mon, 3 May 2010 16:49:18 +0530
Subject: [PATCH 41/61] [IMP]:mrp:Improved product_to_consume and
consumed_product in mrp report.
bzr revid: apa@tinyerp.com-20100503111918-9dl8cw696yskgjmi
---
addons/mrp/report/mrp_production_order.py | 17 +++++++++++++++--
addons/mrp/report/mrp_production_order_view.xml | 6 ++++--
2 files changed, 19 insertions(+), 4 deletions(-)
diff --git a/addons/mrp/report/mrp_production_order.py b/addons/mrp/report/mrp_production_order.py
index 8f4fe764608..d754d6a50ad 100644
--- a/addons/mrp/report/mrp_production_order.py
+++ b/addons/mrp/report/mrp_production_order.py
@@ -33,8 +33,8 @@ class mrp_production_order(osv.osv):
'day': fields.char('Day',size=64,readonly=True),
'origin': fields.char('Source Document', size=64),
'nbr': fields.integer('# of Orders', readonly=True),
-# 'products_to_consumme': fields.integer('Products to Consumme', readonly=True),
-# 'consummed_products': fields.integer('Consummed Products', readonly=True),
+ 'products_to_consume': fields.integer('Products to Consume', readonly=True),
+ 'consumed_products': fields.integer('Consumed Products', readonly=True),
'date': fields.date('Date', readonly=True),
'product_id': fields.many2one('product.product', 'Product', readonly=True),
'product_qty': fields.float('Product Qty', readonly=True),
@@ -79,6 +79,18 @@ class mrp_production_order(osv.osv):
sum(l.product_qty * u.factor) as product_qty,
s.company_id as company_id,
count(*) as nbr,
+ (select sum(sm.product_qty) from stock_move as sm
+ left join mrp_production_move_ids as mv on (sm.id=mv.move_id)
+ left join mrp_production_product_line as ll on (ll.production_id=mv.production_id)
+ where sm.product_id=ll.product_id and ll.id=l.id
+ and sm.state not in ('done','cancel')
+ group by sm.product_id) as products_to_consume,
+ (select sum(sm.product_qty)/2 from stock_move as sm
+ left join mrp_production_move_ids as mv on (sm.id=mv.move_id)
+ left join mrp_production_product_line as ll on (ll.production_id=mv.production_id)
+ where sm.product_id=ll.product_id and ll.id=l.id
+ and sm.state in ('done','cancel')
+ group by sm.product_id) as consumed_products,
s.location_src_id,
s.location_dest_id,
s.bom_id,
@@ -100,6 +112,7 @@ class mrp_production_order(osv.osv):
to_date(to_char(s.create_date, 'MM-dd-YYYY'),'MM-dd-YYYY'),
l.product_id,
l.product_uom,
+ s.id,
l.id,
s.bom_id,
s.routing_id,
diff --git a/addons/mrp/report/mrp_production_order_view.xml b/addons/mrp/report/mrp_production_order_view.xml
index a28dd281fa2..77905ac99b5 100644
--- a/addons/mrp/report/mrp_production_order_view.xml
+++ b/addons/mrp/report/mrp_production_order_view.xml
@@ -16,8 +16,8 @@
-
+
+
@@ -44,6 +44,8 @@
+
+
From a8daa68b70d5e7fef45ff7221260cebdfbdeb6ea Mon Sep 17 00:00:00 2001
From: "nel@tinyerp.com" <>
Date: Mon, 3 May 2010 13:25:19 +0200
Subject: [PATCH 42/61] [IMP]Change default value on holidays: employee instead
of user
bzr revid: nel@tinyerp.com-20100503112519-ziogwtz474koahhh
---
addons/hr_holidays/report/hr_holidays_report_view.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/addons/hr_holidays/report/hr_holidays_report_view.xml b/addons/hr_holidays/report/hr_holidays_report_view.xml
index 8c8bc58204c..371e40bc9a0 100644
--- a/addons/hr_holidays/report/hr_holidays_report_view.xml
+++ b/addons/hr_holidays/report/hr_holidays_report_view.xml
@@ -97,7 +97,7 @@
-
+
@@ -117,7 +117,7 @@
hr.holidays.report
form
tree,graph
- {'search_default_month':1,'search_default_User':1,'group_by_no_leaf':1,'group_by':[]}
+ {'search_default_month':1,'search_default_Employee':1,'group_by_no_leaf':1,'group_by':[]}
From ce972e054bf874615bb5cb6170390ccc683d1d37 Mon Sep 17 00:00:00 2001
From: "nel@tinyerp.com" <>
Date: Mon, 3 May 2010 14:25:59 +0200
Subject: [PATCH 43/61] [FIX] revert code to get analytic account on project
issue
bzr revid: nel@tinyerp.com-20100503122559-risp0gdr24cspvy5
---
addons/project_issue/__openerp__.py | 1 +
addons/project_issue/project_issue.py | 21 +++++++++++++++++++++
addons/project_issue/project_issue_demo.xml | 17 +++++++++++++++++
addons/project_issue/project_issue_view.xml | 19 +++++++++++++++++++
4 files changed, 58 insertions(+)
diff --git a/addons/project_issue/__openerp__.py b/addons/project_issue/__openerp__.py
index b990142e1ea..2bf67d47191 100644
--- a/addons/project_issue/__openerp__.py
+++ b/addons/project_issue/__openerp__.py
@@ -33,6 +33,7 @@
'depends': [
'crm',
'project',
+ 'hr_timesheet_sheet',
],
'init_xml': [
'project_issue_data.xml'
diff --git a/addons/project_issue/project_issue.py b/addons/project_issue/project_issue.py
index 3bf0bf39751..74ca76262b4 100644
--- a/addons/project_issue/project_issue.py
+++ b/addons/project_issue/project_issue.py
@@ -128,6 +128,10 @@ class project_issue(osv.osv):
'day_close': fields.function(_compute_day, string='Days to Close', \
method=True, multi='day_close', type="integer", store=True),
'assigned_to' : fields.many2one('res.users', 'Assigned to'),
+ 'timesheet_ids' : fields.one2many('hr.analytic.timesheet', 'issue_id', 'Timesheets'),
+ 'analytic_account_id' : fields.many2one('account.analytic.account', 'Analytic Account',
+ domain="[('partner_id', '=', partner_id)]",
+ required=True),
}
def _get_project(self, cr, uid, context):
@@ -220,3 +224,20 @@ class project_issue(osv.osv):
project_issue()
+class account_analytic_line(osv.osv):
+ _inherit = 'account.analytic.line'
+ _columns = {
+ 'create_date' : fields.datetime('Create Date', readonly=True),
+ }
+
+account_analytic_line()
+
+class hr_analytic_issue(osv.osv):
+ _inherit = 'hr.analytic.timesheet'
+
+ _columns = {
+ 'issue_id' : fields.many2one('project.issue', 'Issue'),
+ }
+
+hr_analytic_issue()
+
diff --git a/addons/project_issue/project_issue_demo.xml b/addons/project_issue/project_issue_demo.xml
index 7c7764a2e37..8794992b440 100644
--- a/addons/project_issue/project_issue_demo.xml
+++ b/addons/project_issue/project_issue_demo.xml
@@ -18,6 +18,7 @@
+
@@ -37,6 +38,7 @@
+
@@ -53,6 +55,8 @@
+
+
@@ -70,6 +74,7 @@
+
@@ -86,6 +91,7 @@
+
@@ -103,6 +109,7 @@
+
@@ -120,6 +127,7 @@
+
@@ -137,6 +145,7 @@
+
@@ -154,6 +163,7 @@
+
@@ -170,6 +180,7 @@
+
@@ -187,6 +198,7 @@
+
@@ -204,6 +216,7 @@
+
@@ -222,6 +235,7 @@
+
@@ -242,6 +256,7 @@
+
@@ -259,6 +274,7 @@
+
@@ -276,6 +292,7 @@
+
diff --git a/addons/project_issue/project_issue_view.xml b/addons/project_issue/project_issue_view.xml
index 04168492d38..343005d25d7 100644
--- a/addons/project_issue/project_issue_view.xml
+++ b/addons/project_issue/project_issue_view.xml
@@ -46,6 +46,7 @@
+
@@ -131,6 +132,24 @@
context="{'mail':'new', 'model': 'project.issue'}"
icon="gtk-go-forward" type="action" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
From 515ad0b902e069f3b18e1e87e3de78f78d3a5914 Mon Sep 17 00:00:00 2001
From: "nel@tinyerp.com" <>
Date: Mon, 3 May 2010 15:20:30 +0200
Subject: [PATCH 44/61] [FIX] buttons change type and name
bzr revid: nel@tinyerp.com-20100503132030-ug9cwq11cahcdm28
---
addons/project_planning/project_planning_view.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/addons/project_planning/project_planning_view.xml b/addons/project_planning/project_planning_view.xml
index 12e6f167304..becfd97784b 100644
--- a/addons/project_planning/project_planning_view.xml
+++ b/addons/project_planning/project_planning_view.xml
@@ -111,8 +111,8 @@
-
-
+
+
From 7dccf4fa5e3dba934196e99d71f66a9ee4c5610f Mon Sep 17 00:00:00 2001
From: "nel@tinyerp.com" <>
Date: Mon, 3 May 2010 17:16:08 +0200
Subject: [PATCH 45/61] [IMP] account: add columns for entries report
bzr revid: nel@tinyerp.com-20100503151608-4xfib11pgasz3vv4
---
.../account/report/account_entries_report.py | 18 ++++++++++++++++++
.../report/account_entries_report_view.xml | 19 ++++++++++++++++++-
addons/board_purchase/board_purchase_view.xml | 11 ++++++++++-
.../purchase/report/purchase_report_view.xml | 6 +++---
4 files changed, 49 insertions(+), 5 deletions(-)
diff --git a/addons/account/report/account_entries_report.py b/addons/account/report/account_entries_report.py
index 83602ded81b..14b967f09b2 100644
--- a/addons/account/report/account_entries_report.py
+++ b/addons/account/report/account_entries_report.py
@@ -29,6 +29,8 @@ class account_entries_report(osv.osv):
_rec_name = 'date'
_columns = {
'date': fields.date('Date', readonly=True),
+ 'date_created': fields.date('Date Created', readonly=True),
+ 'date_maturity': fields.date('Date Maturity', readonly=True),
'nbr':fields.integer('# of Entries', readonly=True),
'nbl':fields.integer('# of Lines', readonly=True),
'amount': fields.float('Amount',readonly=True),
@@ -39,10 +41,14 @@ class account_entries_report(osv.osv):
('10','October'), ('11','November'), ('12','December')], 'Month',readonly=True),
'ref': fields.char('Reference', size=64,readonly=True),
'period_id': fields.many2one('account.period', 'Period', readonly=True),
+ 'account_id': fields.many2one('account.account', 'Account', readonly=True),
'journal_id': fields.many2one('account.journal', 'Journal', readonly=True),
+ 'product_id': fields.many2one('product.product', 'Product', readonly=True),
'state': fields.selection([('draft','Draft'), ('posted','Posted')], 'State',readonly=True,
help='When new account move is created the state will be \'Draft\'. When all the payments are done it will be in \'Posted\' state.'),
'partner_id': fields.many2one('res.partner','Partner', readonly=True),
+ 'period_id2': fields.many2one('account.period', 'Move Line Period', readonly=True),
+ 'journal_id2': fields.many2one('account.journal', 'Move Line Journal', readonly=True),
'type': fields.selection([
('pay_voucher','Cash Payment'),
('bank_pay_voucher','Bank Payment'),
@@ -73,9 +79,15 @@ class account_entries_report(osv.osv):
to_char(am.date, 'MM') as month,
to_char(am.date, 'YYYY-MM-DD') as day,
am.company_id as company_id,
+ l.account_id as account_id,
+ l.date_created as date_created,
+ l.date_maturity as date_maturity,
am.journal_id as journal_id,
+ l.journal_id as journal_id2,
+ l.period_id as period_id2,
am.period_id as period_id,
l.partner_id as partner_id,
+ l.product_id as product_id,
am.type as type
from
account_move_line l
@@ -86,9 +98,15 @@ class account_entries_report(osv.osv):
am.date,
am.company_id,
am.journal_id,
+ l.journal_id,
am.period_id,
+ l.period_id,
am.type,
l.partner_id,
+ l.product_id,
+ l.date_created,
+ l.date_maturity,
+ l.account_id,
l.debit
)
""")
diff --git a/addons/account/report/account_entries_report_view.xml b/addons/account/report/account_entries_report_view.xml
index 46f7ac46b83..e5710483da3 100644
--- a/addons/account/report/account_entries_report_view.xml
+++ b/addons/account/report/account_entries_report_view.xml
@@ -8,6 +8,8 @@
+
+
@@ -17,9 +19,13 @@
+
+
+
+
@@ -61,8 +67,10 @@
help = "Draft tasks"/>
+
+
-
+
@@ -72,18 +80,27 @@
help = "Posted tasks"/>
+
+
+
+
+
+
+
+
+
diff --git a/addons/board_purchase/board_purchase_view.xml b/addons/board_purchase/board_purchase_view.xml
index 2370e247eec..5548b3f2838 100644
--- a/addons/board_purchase/board_purchase_view.xml
+++ b/addons/board_purchase/board_purchase_view.xml
@@ -8,6 +8,15 @@
name="Purchase"
parent="base.dashboard"/>
+
+ Draft Purchases
+ ir.actions.act_window
+ purchase.order
+ form
+ tree,form
+ [('date_order','>',time.strftime('%Y-01-01 00:00:00')),('date_order','<',time.strftime('%Y-12-31 23:59:59')), ('state','=','draft')]
+
+
Quotation Request
ir.actions.act_window
@@ -26,7 +35,7 @@
From c974568121f478ab2601c19b8320e2f2f830ebc6 Mon Sep 17 00:00:00 2001
From: "nel@tinyerp.com" <>
Date: Tue, 4 May 2010 09:05:36 +0200
Subject: [PATCH 47/61] [IMP] account: Add remaining columns to report
bzr revid: nel@tinyerp.com-20100504070536-hn3cx0dpjgn8tig8
---
.../account/report/account_entries_report.py | 9 +++++++
.../report/account_entries_report_view.xml | 24 +++++++++++--------
2 files changed, 23 insertions(+), 10 deletions(-)
diff --git a/addons/account/report/account_entries_report.py b/addons/account/report/account_entries_report.py
index 14b967f09b2..d1431128b49 100644
--- a/addons/account/report/account_entries_report.py
+++ b/addons/account/report/account_entries_report.py
@@ -46,8 +46,11 @@ class account_entries_report(osv.osv):
'product_id': fields.many2one('product.product', 'Product', readonly=True),
'state': fields.selection([('draft','Draft'), ('posted','Posted')], 'State',readonly=True,
help='When new account move is created the state will be \'Draft\'. When all the payments are done it will be in \'Posted\' state.'),
+ 'state_2': fields.selection([('draft','Draft'), ('valid','Valid')], 'State of Move Line', readonly=True,
+ help='When new move line is created the state will be \'Draft\'.\n* When all the payments are done it will be in \'Valid\' state.'),
'partner_id': fields.many2one('res.partner','Partner', readonly=True),
'period_id2': fields.many2one('account.period', 'Move Line Period', readonly=True),
+ 'analytic_account_id' : fields.many2one('account.analytic.account', 'Analytic Account', readonly=True),
'journal_id2': fields.many2one('account.journal', 'Move Line Journal', readonly=True),
'type': fields.selection([
('pay_voucher','Cash Payment'),
@@ -59,6 +62,7 @@ class account_entries_report(osv.osv):
('journal_pur_voucher','Journal Purchase'),
('journal_voucher','Journal Voucher'),
],'Type',readonly=True),
+ 'quantity': fields.float('Products Quantity', digits=(16,2), readonly=True),
'company_id': fields.many2one('res.company', 'Company', readonly=True),
}
_order = 'date desc'
@@ -70,7 +74,9 @@ class account_entries_report(osv.osv):
select
min(l.id) as id,
am.ref as ref,
+ sum(l.quantity) as quantity,
am.state as state,
+ l.state as state_2,
am.date as date,
count(l.id) as nbr,
count(distinct am.id) as nbl,
@@ -80,6 +86,7 @@ class account_entries_report(osv.osv):
to_char(am.date, 'YYYY-MM-DD') as day,
am.company_id as company_id,
l.account_id as account_id,
+ l.analytic_account_id as analytic_account_id,
l.date_created as date_created,
l.date_maturity as date_maturity,
am.journal_id as journal_id,
@@ -103,10 +110,12 @@ class account_entries_report(osv.osv):
l.period_id,
am.type,
l.partner_id,
+ l.analytic_account_id,
l.product_id,
l.date_created,
l.date_maturity,
l.account_id,
+ l.state,
l.debit
)
""")
diff --git a/addons/account/report/account_entries_report_view.xml b/addons/account/report/account_entries_report_view.xml
index e5710483da3..ae8546ee75e 100644
--- a/addons/account/report/account_entries_report_view.xml
+++ b/addons/account/report/account_entries_report_view.xml
@@ -12,21 +12,23 @@
+
-
-
-
-
+
-
+
+
+
+
+
@@ -47,7 +49,7 @@
search
-
+
@@ -67,9 +69,8 @@
help = "Draft tasks"/>
-
-
+
@@ -78,11 +79,13 @@
icon="terp-account"
domain="[('state','=','posted')]"
help = "Posted tasks"/>
+
+
@@ -92,13 +95,14 @@
-
-
+
+
+
From 24c309f335b2b9ecb3e29412ebbcb95fa0a51046 Mon Sep 17 00:00:00 2001
From: "rch (Open ERP)" <>
Date: Tue, 4 May 2010 12:42:13 +0530
Subject: [PATCH 48/61] [ADD]: Add Analytic Entries SQL report.
bzr revid: rch_open_erp-20100504071213-evj2bri1m1r9fi07
---
addons/account/__openerp__.py | 3 +-
addons/account/report/__init__.py | 1 +
.../report/account_analytic_entries_report.py | 81 ++++++++++++++
.../account_analytic_entries_report_view.xml | 102 ++++++++++++++++++
4 files changed, 186 insertions(+), 1 deletion(-)
create mode 100644 addons/account/report/account_analytic_entries_report.py
create mode 100644 addons/account/report/account_analytic_entries_report_view.xml
diff --git a/addons/account/__openerp__.py b/addons/account/__openerp__.py
index ef4e572770c..cea696f590f 100644
--- a/addons/account/__openerp__.py
+++ b/addons/account/__openerp__.py
@@ -110,7 +110,8 @@ module named account_voucherss
'report/account_entries_report_view.xml',
'report/account_report_view.xml',
'report/account_analytic_report_view.xml',
- 'report/account_account_report_view.xml'
+ 'report/account_account_report_view.xml',
+ 'report/account_analytic_entries_report_view.xml'
],
'demo_xml': [
#'demo/price_accuracy00.yml',
diff --git a/addons/account/report/__init__.py b/addons/account/report/__init__.py
index 51cb0810f43..b411e404cac 100644
--- a/addons/account/report/__init__.py
+++ b/addons/account/report/__init__.py
@@ -39,5 +39,6 @@ import account_report
import account_analytic_report
import account_account_report
import account_entries_report
+import account_analytic_entries_report
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/report/account_analytic_entries_report.py b/addons/account/report/account_analytic_entries_report.py
new file mode 100644
index 00000000000..38a17a19ec2
--- /dev/null
+++ b/addons/account/report/account_analytic_entries_report.py
@@ -0,0 +1,81 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL ().
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+
+import tools
+from osv import fields,osv
+
+class analytic_entries_report(osv.osv):
+ _name = "analytic.entries.report"
+ _description = "Analytic Entries Statistics"
+ _auto = False
+ _columns = {
+ 'date': fields.date('Date', readonly=True),
+ 'year': fields.char('Year', size=4, readonly=True),
+ 'day': fields.char('Day', size=128, 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),
+ 'user_id' : fields.many2one('res.users', 'User',readonly=True),
+ 'name': fields.char('Description', size=64, readonly=True),
+ 'company_id': fields.many2one('res.company', 'Company', required=True),
+ 'currency_id': fields.many2one('res.currency', 'Currency', required=True),
+ 'account_id': fields.many2one('account.analytic.account', 'Account', required=True),
+ 'general_account_id': fields.many2one('account.account', 'General Account', required=True),
+ 'journal_id': fields.many2one('account.analytic.journal', 'Journal', required=True),
+ 'move_id': fields.many2one('account.move.line', 'Move', required=True),
+ 'product_id': fields.many2one('product.product', 'Product', required=True),
+ 'product_uom_id': fields.many2one('product.uom', 'Product UOM', required=True),
+ 'amount': fields.float('Amount', readonly=True),
+ 'unit_amount': fields.float('Unit Amount', readonly=True),
+ 'amount_currency': fields.float('Amount Currency', readonly=True),
+ }
+ def init(self, cr):
+ tools.drop_view_if_exists(cr, 'analytic_entries_report')
+ cr.execute("""
+ create or replace view analytic_entries_report as (
+ select
+ min(a.id) as id,
+ a.create_date as date,
+ to_char(a.create_date, 'YYYY') as year,
+ to_char(a.create_date, 'MM') as month,
+ to_char(a.create_date, 'YYYY-MM-DD') as day,
+ a.user_id as user_id,
+ a.name as name,
+ a.company_id as company_id,
+ a.currency_id as currency_id,
+ a.account_id as account_id,
+ a.general_account_id as general_account_id,
+ a.journal_id as journal_id,
+ a.move_id as move_id,
+ a.product_id as product_id,
+ a.product_uom_id as product_uom_id,
+ sum(a.amount) as amount,
+ sum(a.unit_amount) as unit_amount,
+ sum(a.amount_currency) as amount_currency
+ from
+ account_analytic_line a
+ group by
+ a.create_date, a.user_id,a.name,company_id,a.currency_id,
+ a.account_id,a.general_account_id,a.journal_id,
+ a.move_id,a.product_id,a.product_uom_id
+ )
+ """)
+analytic_entries_report()
diff --git a/addons/account/report/account_analytic_entries_report_view.xml b/addons/account/report/account_analytic_entries_report_view.xml
new file mode 100644
index 00000000000..4a45b40ed33
--- /dev/null
+++ b/addons/account/report/account_analytic_entries_report_view.xml
@@ -0,0 +1,102 @@
+
+
+
+
+ analytic.entries.report.tree
+ analytic.entries.report
+ tree
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ analytic.entries.report.search
+ analytic.entries.report
+ search
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Analytic Entries
+ analytic.entries.report
+ form
+ tree,graph
+ {'search_default_month':1,'search_default_Account':1,'group_by_no_leaf':1,'group_by':[]}
+
+
+
+
+
+
+
From cb9b5f2fd01ffdfb595de0b1b9aedaff0aab4e31 Mon Sep 17 00:00:00 2001
From: "nel@tinyerp.com" <>
Date: Tue, 4 May 2010 09:31:50 +0200
Subject: [PATCH 49/61] [IMP]account: rename date to effective date
bzr revid: nel@tinyerp.com-20100504073150-n7ox6liy7ps70tw7
---
addons/account/report/account_entries_report.py | 2 +-
addons/account/report/account_entries_report_view.xml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/addons/account/report/account_entries_report.py b/addons/account/report/account_entries_report.py
index d1431128b49..85ba8a058f7 100644
--- a/addons/account/report/account_entries_report.py
+++ b/addons/account/report/account_entries_report.py
@@ -28,7 +28,7 @@ class account_entries_report(osv.osv):
_auto = False
_rec_name = 'date'
_columns = {
- 'date': fields.date('Date', readonly=True),
+ 'date': fields.date('Effective Date', readonly=True),
'date_created': fields.date('Date Created', readonly=True),
'date_maturity': fields.date('Date Maturity', readonly=True),
'nbr':fields.integer('# of Entries', readonly=True),
diff --git a/addons/account/report/account_entries_report_view.xml b/addons/account/report/account_entries_report_view.xml
index ae8546ee75e..cc07f05c499 100644
--- a/addons/account/report/account_entries_report_view.xml
+++ b/addons/account/report/account_entries_report_view.xml
@@ -88,9 +88,9 @@
+
-
From 305d215a342d352741336527b1a0206091a499d2 Mon Sep 17 00:00:00 2001
From: "nel@tinyerp.com" <>
Date: Tue, 4 May 2010 10:52:09 +0200
Subject: [PATCH 50/61] [REVERT] project_issue: remove analytic account from
views
bzr revid: nel@tinyerp.com-20100504085209-uwbj7is9xebv9sns
---
addons/project_issue/project_issue.py | 21 -------------------
addons/project_issue/project_issue_demo.xml | 17 ---------------
addons/project_issue/project_issue_view.xml | 19 -----------------
.../report/project_issue_report.py | 7 +------
.../report/project_issue_report_view.xml | 4 +---
5 files changed, 2 insertions(+), 66 deletions(-)
diff --git a/addons/project_issue/project_issue.py b/addons/project_issue/project_issue.py
index 74ca76262b4..3bf0bf39751 100644
--- a/addons/project_issue/project_issue.py
+++ b/addons/project_issue/project_issue.py
@@ -128,10 +128,6 @@ class project_issue(osv.osv):
'day_close': fields.function(_compute_day, string='Days to Close', \
method=True, multi='day_close', type="integer", store=True),
'assigned_to' : fields.many2one('res.users', 'Assigned to'),
- 'timesheet_ids' : fields.one2many('hr.analytic.timesheet', 'issue_id', 'Timesheets'),
- 'analytic_account_id' : fields.many2one('account.analytic.account', 'Analytic Account',
- domain="[('partner_id', '=', partner_id)]",
- required=True),
}
def _get_project(self, cr, uid, context):
@@ -224,20 +220,3 @@ class project_issue(osv.osv):
project_issue()
-class account_analytic_line(osv.osv):
- _inherit = 'account.analytic.line'
- _columns = {
- 'create_date' : fields.datetime('Create Date', readonly=True),
- }
-
-account_analytic_line()
-
-class hr_analytic_issue(osv.osv):
- _inherit = 'hr.analytic.timesheet'
-
- _columns = {
- 'issue_id' : fields.many2one('project.issue', 'Issue'),
- }
-
-hr_analytic_issue()
-
diff --git a/addons/project_issue/project_issue_demo.xml b/addons/project_issue/project_issue_demo.xml
index 8794992b440..7c7764a2e37 100644
--- a/addons/project_issue/project_issue_demo.xml
+++ b/addons/project_issue/project_issue_demo.xml
@@ -18,7 +18,6 @@
-
@@ -38,7 +37,6 @@
-
@@ -55,8 +53,6 @@
-
-
@@ -74,7 +70,6 @@
-
@@ -91,7 +86,6 @@
-
@@ -109,7 +103,6 @@
-
@@ -127,7 +120,6 @@
-
@@ -145,7 +137,6 @@
-
@@ -163,7 +154,6 @@
-
@@ -180,7 +170,6 @@
-
@@ -198,7 +187,6 @@
-
@@ -216,7 +204,6 @@
-
@@ -235,7 +222,6 @@
-
@@ -256,7 +242,6 @@
-
@@ -274,7 +259,6 @@
-
@@ -292,7 +276,6 @@
-
diff --git a/addons/project_issue/project_issue_view.xml b/addons/project_issue/project_issue_view.xml
index 343005d25d7..04168492d38 100644
--- a/addons/project_issue/project_issue_view.xml
+++ b/addons/project_issue/project_issue_view.xml
@@ -46,7 +46,6 @@
-
@@ -132,24 +131,6 @@
context="{'mail':'new', 'model': 'project.issue'}"
icon="gtk-go-forward" type="action" />
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/addons/project_issue/report/project_issue_report.py b/addons/project_issue/report/project_issue_report.py
index a14eb67bab4..67a72524af6 100644
--- a/addons/project_issue/report/project_issue_report.py
+++ b/addons/project_issue/report/project_issue_report.py
@@ -24,9 +24,6 @@ class project_issue_report(osv.osv):
'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')]" ),
- 'analytic_account_id' : fields.many2one('account.analytic.account', 'Analytic Account',
- domain="[('partner_id', '=', partner_id)]",
- required=True),
'partner_address_id': fields.many2one('res.partner.address','Contact ',readonly=True),
}
def init(self, cr):
@@ -53,7 +50,6 @@ class project_issue_report(osv.osv):
c.partner_id,
c.canal_id,
c.task_id,
- c.analytic_account_id as analytic_account_id,
c.partner_address_id as partner_address_id,
c.date_open as date_open,
date_trunc('day',c.create_date) as create_date,
@@ -83,7 +79,6 @@ class project_issue_report(osv.osv):
c.canal_id,
c.task_id,
c.date_open,
- c.analytic_account_id,
c.partner_address_id
)""")
@@ -92,4 +87,4 @@ project_issue_report()
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/project_issue/report/project_issue_report_view.xml b/addons/project_issue/report/project_issue_report_view.xml
index 4ac3222053b..11ddde6a63c 100644
--- a/addons/project_issue/report/project_issue_report_view.xml
+++ b/addons/project_issue/report/project_issue_report_view.xml
@@ -27,7 +27,6 @@
-
@@ -69,7 +68,6 @@
-
@@ -137,4 +135,4 @@
-
\ No newline at end of file
+
From 49673c44fa317f20ad349d30bd4d9ba584d76725 Mon Sep 17 00:00:00 2001
From: "rch (Open ERP)" <>
Date: Tue, 4 May 2010 15:38:22 +0530
Subject: [PATCH 51/61] [ADD]: Add menu Statastic Reports for accounting
reports.
bzr revid: rch_open_erp-20100504100822-9c9x8i4wlva5wobw
---
addons/account/account_menuitem.xml | 1 +
addons/account/report/account_account_report_view.xml | 2 +-
addons/account/report/account_analytic_entries_report_view.xml | 2 +-
addons/account/report/account_analytic_report_view.xml | 2 +-
addons/account/report/account_entries_report_view.xml | 2 +-
addons/account/report/account_invoice_report_view.xml | 2 +-
6 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/addons/account/account_menuitem.xml b/addons/account/account_menuitem.xml
index 37d539a4b25..be63e7f2726 100644
--- a/addons/account/account_menuitem.xml
+++ b/addons/account/account_menuitem.xml
@@ -22,6 +22,7 @@
groups="group_account_user"/>
+
diff --git a/addons/account/report/account_account_report_view.xml b/addons/account/report/account_account_report_view.xml
index 19731e390c2..e5dcd8551d1 100644
--- a/addons/account/report/account_account_report_view.xml
+++ b/addons/account/report/account_account_report_view.xml
@@ -81,7 +81,7 @@
-
+
diff --git a/addons/account/report/account_analytic_entries_report_view.xml b/addons/account/report/account_analytic_entries_report_view.xml
index 4a45b40ed33..25433e607b8 100644
--- a/addons/account/report/account_analytic_entries_report_view.xml
+++ b/addons/account/report/account_analytic_entries_report_view.xml
@@ -96,7 +96,7 @@
-
+
diff --git a/addons/account/report/account_analytic_report_view.xml b/addons/account/report/account_analytic_report_view.xml
index de97bfcb798..1befff216bd 100644
--- a/addons/account/report/account_analytic_report_view.xml
+++ b/addons/account/report/account_analytic_report_view.xml
@@ -103,7 +103,7 @@
-
+
diff --git a/addons/account/report/account_entries_report_view.xml b/addons/account/report/account_entries_report_view.xml
index ae8546ee75e..e700ab56fae 100644
--- a/addons/account/report/account_entries_report_view.xml
+++ b/addons/account/report/account_entries_report_view.xml
@@ -122,6 +122,6 @@
{'search_default_This Month':1,'search_default_Journal':1,'group_by_no_leaf':1,'group_by':[]}
-
+
diff --git a/addons/account/report/account_invoice_report_view.xml b/addons/account/report/account_invoice_report_view.xml
index c36e2313736..461347cbfbb 100644
--- a/addons/account/report/account_invoice_report_view.xml
+++ b/addons/account/report/account_invoice_report_view.xml
@@ -168,7 +168,7 @@
-
+
From 1142999b51f078528f06fb5390b89569b391c75c Mon Sep 17 00:00:00 2001
From: "rch (Open ERP)" <>
Date: Tue, 4 May 2010 18:50:22 +0530
Subject: [PATCH 52/61] [IMP]: Improve account reports.
bzr revid: rch_open_erp-20100504132022-8l2bd1z917ta8dxs
---
addons/account/report/account_account_report.py | 15 +++++++++++----
.../report/account_account_report_view.xml | 11 ++++++++---
.../report/account_analytic_entries_report.py | 2 ++
.../account_analytic_entries_report_view.xml | 1 +
4 files changed, 22 insertions(+), 7 deletions(-)
diff --git a/addons/account/report/account_account_report.py b/addons/account/report/account_account_report.py
index 8a18c7d89f1..55e5d7030c7 100644
--- a/addons/account/report/account_account_report.py
+++ b/addons/account/report/account_account_report.py
@@ -40,10 +40,13 @@ class account_account_report(osv.osv):
'company_id': fields.many2one('res.company', 'Company', required=True),
'currency_mode': fields.selection([('current', 'At Date'), ('average', 'Average Rate')], 'Outgoing Currencies Rate',readonly=True),
'user_type': fields.many2one('account.account.type', 'Account Type',readonly=True),
+ 'quantity': fields.float('Quantity', readonly=True),
+ 'amount_total': fields.float('Total Amount', readonly=True),
'credit': fields.float('Credit', readonly=True),
'debit': fields.float('Debit', readonly=True),
'balance': fields.float('Balance', readonly=True),
'nbr': fields.integer('#Accounts', readonly=True),
+ 'parent_account_id': fields.many2one('account.account', 'Parent Account', required=True),
}
def init(self, cr):
tools.drop_view_if_exists(cr, 'account_account_report')
@@ -58,14 +61,17 @@ class account_account_report(osv.osv):
a.company_id as company_id,
a.currency_mode as currency_mode,
a.user_type as user_type,
+ a.parent_id as parent_account_id,
+ sum(ail.quantity) as quantity,
+ sum(ail.price_subtotal) as amount_total,
sum(m.credit) as credit,
sum(m.debit) as debit,
(sum(m.credit)-sum(m.debit)) as balance
from
account_account as a
- left join
- account_move_line as m
- on m.account_id=a.id
+ left join account_move_line as m on m.account_id=a.id
+ left join account_invoice_line as ail on ail.account_id=a.id
+ left join account_invoice as ai on ai.account_id=a.id
group by
a.name,
a.code,
@@ -73,7 +79,8 @@ class account_account_report(osv.osv):
a.company_id,
a.currency_mode,
a.user_type,
- m.account_id
+ m.account_id,
+ a.parent_id
)
""")
account_account_report()
diff --git a/addons/account/report/account_account_report_view.xml b/addons/account/report/account_account_report_view.xml
index e5dcd8551d1..32e77be341f 100644
--- a/addons/account/report/account_account_report_view.xml
+++ b/addons/account/report/account_account_report_view.xml
@@ -10,10 +10,13 @@
-
+
+
+
+
@@ -55,8 +58,9 @@
-
-
+
+
+
@@ -67,6 +71,7 @@
+
diff --git a/addons/account/report/account_analytic_entries_report.py b/addons/account/report/account_analytic_entries_report.py
index 38a17a19ec2..2a1b4ad993b 100644
--- a/addons/account/report/account_analytic_entries_report.py
+++ b/addons/account/report/account_analytic_entries_report.py
@@ -46,6 +46,7 @@ class analytic_entries_report(osv.osv):
'amount': fields.float('Amount', readonly=True),
'unit_amount': fields.float('Unit Amount', readonly=True),
'amount_currency': fields.float('Amount Currency', readonly=True),
+ 'nbr': fields.integer('#Entries', readonly=True),
}
def init(self, cr):
tools.drop_view_if_exists(cr, 'analytic_entries_report')
@@ -53,6 +54,7 @@ class analytic_entries_report(osv.osv):
create or replace view analytic_entries_report as (
select
min(a.id) as id,
+ count(distinct a.id) as nbr,
a.create_date as date,
to_char(a.create_date, 'YYYY') as year,
to_char(a.create_date, 'MM') as month,
diff --git a/addons/account/report/account_analytic_entries_report_view.xml b/addons/account/report/account_analytic_entries_report_view.xml
index 25433e607b8..967fe3a5272 100644
--- a/addons/account/report/account_analytic_entries_report_view.xml
+++ b/addons/account/report/account_analytic_entries_report_view.xml
@@ -21,6 +21,7 @@
+
From c1d50b9c54159b109e122fb8f3e97b748f47c94f Mon Sep 17 00:00:00 2001
From: apa-tiny
Date: Wed, 5 May 2010 17:09:55 +0530
Subject: [PATCH 53/61] [FIX]:Fix the residual problem in invoice reports.
bzr revid: apa@tinyerp.com-20100505113955-3bxz8hjqxzu9e6ps
---
addons/account/report/account_invoice_report.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/addons/account/report/account_invoice_report.py b/addons/account/report/account_invoice_report.py
index 062261f854a..cd1477e79cf 100644
--- a/addons/account/report/account_invoice_report.py
+++ b/addons/account/report/account_invoice_report.py
@@ -100,7 +100,7 @@ class account_invoice_report(osv.osv):
s.address_invoice_id as address_invoice_id,
s.account_id as account_id,
s.partner_bank as partner_bank,
- sum(s.residual) as residual,
+ s.residual as residual,
case when s.state != 'paid' then null else
extract(epoch from avg(am.date_created-l.create_date))/(24*60*60)::decimal(16,2)
end as delay_to_pay
@@ -120,6 +120,7 @@ class account_invoice_report(osv.osv):
l.uos_id,
s.user_id,
s.state,
+ s.residual,
s.company_id,
s.payment_term,
s.period_id,
From 03509869b9902035958573bccd45f0797b9c223a Mon Sep 17 00:00:00 2001
From: "rch (Open ERP)" <>
Date: Wed, 5 May 2010 18:53:30 +0530
Subject: [PATCH 54/61] [IMP]: Improve Analytic Account SQL report according to
guidlines.--author=rch(Open ERP),aag(Open ERP)
bzr revid: rch_open_erp-20100505132330-vyji8uxkov70oqle
---
.../account/report/account_analytic_report.py | 16 +++-
.../report/account_analytic_report_view.xml | 78 +++++++++++--------
2 files changed, 58 insertions(+), 36 deletions(-)
diff --git a/addons/account/report/account_analytic_report.py b/addons/account/report/account_analytic_report.py
index 45057d950bd..87912b4a3ef 100644
--- a/addons/account/report/account_analytic_report.py
+++ b/addons/account/report/account_analytic_report.py
@@ -35,7 +35,7 @@ class analytic_report(osv.osv):
'parent_id': fields.many2one('account.analytic.account', 'Parent Analytic Account', readonly=True),
'user_id' : fields.many2one('res.users', 'Account Manager',readonly=True),
'product_id' : fields.many2one('product.product', 'Product',readonly=True),
- 'quantity': fields.float('Quantity',readonly=True),
+ 'total_quantity': fields.float('# Total Quantity',readonly=True),
'debit' : fields.float('Debit',readonly=True),
'credit' : fields.float('Credit',readonly=True),
'balance' : fields.float('Balance',readonly=True),
@@ -43,6 +43,11 @@ class analytic_report(osv.osv):
'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),
+ 'day': fields.char('Day', size=128, readonly=True),
+ 'nbr':fields.integer('# of Lines', readonly=True),
+ 'company_id': fields.many2one('res.company', 'Company', readonly=True),
+ 'type': fields.selection([('view','View'), ('normal','Normal')], 'Account Type'),
+
'state': fields.selection([('draft','Draft'),
('open','Open'),
('pending','Pending'),
@@ -50,6 +55,7 @@ class analytic_report(osv.osv):
('close','Close'),
('template', 'Template')],
'State', readonly=True),
+
}
_order = 'date_start desc'
def init(self, cr):
@@ -60,15 +66,18 @@ class analytic_report(osv.osv):
min(s.id) as id,
to_char(s.create_date, 'YYYY') as year,
to_char(s.create_date, 'MM') as month,
+ to_char(s.create_date, 'YYYY-MM-DD') as day,
l.journal_id,
l.product_id,
s.parent_id,
s.date_start,
s.date as date_end,
s.user_id,
+ s.company_id,
+ s.type,
s.name,
s.partner_id,
- s.quantity,
+ sum(s.quantity) as total_quantity,
s.debit,
s.credit,
s.balance,
@@ -77,7 +86,8 @@ class analytic_report(osv.osv):
from account_analytic_account s
left join account_analytic_line l on (s.id=l.account_id)
GROUP BY s.create_date,s.state,l.journal_id,s.name,
- s.partner_id,s.date_start,s.date,s.user_id,s.quantity,
+ s.partner_id,s.date_start,s.date,s.user_id,
+ s.company_id,s.type,
s.debit,s.credit,s.balance,s.parent_id,l.product_id
)
""")
diff --git a/addons/account/report/account_analytic_report_view.xml b/addons/account/report/account_analytic_report_view.xml
index 1befff216bd..dfd53b502a5 100644
--- a/addons/account/report/account_analytic_report_view.xml
+++ b/addons/account/report/account_analytic_report_view.xml
@@ -9,23 +9,26 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
+
+
-
analytic.report.search
analytic.report
@@ -38,23 +41,15 @@
domain="[('year','=',time.strftime('%%Y'))]"/>
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
@@ -70,39 +77,44 @@
string="Template"
domain="[('state','=','template')]"/>
+
-
-
+
+
+
+
-
-
+
+
+
+
+
+
-
-
+
+
-
Analytic Accounts
analytic.report
form
tree
- {'search_default_User':1,'search_default_user_id':uid}
+ {'search_default_This Month':1,'search_default_User':1,'group_by_no_leaf':1,'group_by':[]}
-
From 1275b05975474640f5ef9f39d3f4609c6174a500 Mon Sep 17 00:00:00 2001
From: "rch (Open ERP)" <>
Date: Thu, 6 May 2010 17:57:27 +0530
Subject: [PATCH 55/61] [IMP]: Improve Analyic Account and Analytic Account
Entries report by adding graph view.
bzr revid: rch_open_erp-20100506122727-aimr38prot4y97vx
---
.../account_analytic_entries_report_view.xml | 20 +++++++++++++++----
.../report/account_analytic_report_view.xml | 16 ++++++++++++++-
2 files changed, 31 insertions(+), 5 deletions(-)
diff --git a/addons/account/report/account_analytic_entries_report_view.xml b/addons/account/report/account_analytic_entries_report_view.xml
index 967fe3a5272..d6f6e542514 100644
--- a/addons/account/report/account_analytic_entries_report_view.xml
+++ b/addons/account/report/account_analytic_entries_report_view.xml
@@ -68,11 +68,11 @@
-
+
-
+
@@ -87,13 +87,25 @@
-
+
+ account.analytic.entries.graph
+ analytic.entries.report
+ graph
+
+
+
+
+
+
+
+
+
Analytic Entries
analytic.entries.report
form
tree,graph
- {'search_default_month':1,'search_default_Account':1,'group_by_no_leaf':1,'group_by':[]}
+ {'search_default_month':1,'search_default_User':1,'group_by_no_leaf':1,'group_by':[]}
diff --git a/addons/account/report/account_analytic_report_view.xml b/addons/account/report/account_analytic_report_view.xml
index dfd53b502a5..838cefe5898 100644
--- a/addons/account/report/account_analytic_report_view.xml
+++ b/addons/account/report/account_analytic_report_view.xml
@@ -107,11 +107,25 @@
+
+ account.analytic.report.graph
+ analytic.report
+ graph
+
+
+
+
+
+
+
+
+
+
Analytic Accounts
analytic.report
form
- tree
+ tree,graph
{'search_default_This Month':1,'search_default_User':1,'group_by_no_leaf':1,'group_by':[]}
From 69257f39a5d5d3c7aad99e580c7e36ad7ed65793 Mon Sep 17 00:00:00 2001
From: "nel@tinyerp.com" <>
Date: Tue, 18 May 2010 09:44:37 +0200
Subject: [PATCH 56/61] [IMP] project_report, project_issue, sale: Rename some
columns
bzr revid: nel@tinyerp.com-20100518074437-bwu9c4rjql0u8kee
---
addons/project/report/project_report_view.xml | 20 +++++++++----------
.../report/project_issue_report.py | 2 +-
.../report/project_issue_report_view.xml | 8 --------
addons/sale/report/sale_report.py | 16 ++++++++++-----
addons/sale/report/sale_report_view.xml | 12 +++++++----
5 files changed, 29 insertions(+), 29 deletions(-)
diff --git a/addons/project/report/project_report_view.xml b/addons/project/report/project_report_view.xml
index ef0abd119fa..64fc88dc5ed 100644
--- a/addons/project/report/project_report_view.xml
+++ b/addons/project/report/project_report_view.xml
@@ -52,13 +52,13 @@
-
-
+
+ help="Tasks performed in last 30 days"/>
+
-
-
+
diff --git a/addons/project_issue/report/project_issue_report.py b/addons/project_issue/report/project_issue_report.py
index 67a72524af6..7c00b68d1fe 100644
--- a/addons/project_issue/report/project_issue_report.py
+++ b/addons/project_issue/report/project_issue_report.py
@@ -17,7 +17,7 @@ class project_issue_report(osv.osv):
'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')]"),
+ 'type_id': fields.many2one('crm.case.resource.type', 'Version', 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),
diff --git a/addons/project_issue/report/project_issue_report_view.xml b/addons/project_issue/report/project_issue_report_view.xml
index 11ddde6a63c..8fb99f318ad 100644
--- a/addons/project_issue/report/project_issue_report_view.xml
+++ b/addons/project_issue/report/project_issue_report_view.xml
@@ -18,9 +18,7 @@
-
-
@@ -66,7 +64,6 @@
-
@@ -76,7 +73,6 @@
-
@@ -92,12 +88,8 @@
-
-
-
-
diff --git a/addons/sale/report/sale_report.py b/addons/sale/report/sale_report.py
index c5e1a65e6e8..c8b616ced78 100644
--- a/addons/sale/report/sale_report.py
+++ b/addons/sale/report/sale_report.py
@@ -185,10 +185,14 @@ class product_bought_by_sale_order(osv.osv):
_name = "product.bought.by.sale.order"
_description = "Product bought by sale order"
_auto = False
- _rec_name = 'partner'
+ _rec_name = 'month'
_columns = {
'total_products': fields.integer('Total Products', readonly=True),
- 'name': fields.char('Sale order', size=64, readonly=True)
+ 'product_id':fields.many2one('product.product', 'Product', 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),
+ 'year': fields.char('Year', size=64, readonly=True)
}
_order = 'total_products desc'
def init(self, cr):
@@ -197,8 +201,10 @@ class product_bought_by_sale_order(osv.osv):
create or replace view product_bought_by_sale_order as (
select
min(s.id) as id,
- count(*) as total_products,
- s.name as name
+ l.product_id as product_id,
+ to_char(l.create_date, 'MM') as month,
+ to_char(l.create_date, 'YYYY') as year,
+ count(*) as total_products
from
sale_order_line l
left join
@@ -206,7 +212,7 @@ class product_bought_by_sale_order(osv.osv):
where
s.state='manual' or s.state='progress'
group by
- s.name
+ l.product_id, to_char(l.create_date, 'MM'), to_char(l.create_date, 'YYYY')
)
""")
product_bought_by_sale_order()
diff --git a/addons/sale/report/sale_report_view.xml b/addons/sale/report/sale_report_view.xml
index 639004803fd..332a551ec5d 100644
--- a/addons/sale/report/sale_report_view.xml
+++ b/addons/sale/report/sale_report_view.xml
@@ -226,7 +226,9 @@
tree
-
+
+
+
@@ -238,8 +240,9 @@
graph
-
-
+
+
+
@@ -248,7 +251,8 @@
Product bought by sale order
product.bought.by.sale.order
form
- tree,graph
+ graph,tree
+ [('year','=', time.strftime('%Y'))]
From 93d9c221342a60c20c61a6017ca8285f7e28acf1 Mon Sep 17 00:00:00 2001
From: apa-tiny
Date: Wed, 19 May 2010 13:55:36 +0530
Subject: [PATCH 57/61] [IMP]:board_project:improved issue dashboard like:
Tree1: current issues(draft and open) Tree2: pending issues Graph1: issues by
stage Graph2: issues by state
bzr revid: apa@tinyerp.com-20100519082536-cxgbvmkcr9nd2i2o
---
.../board_project_issue_view.xml | 60 +++++++++++++++++--
.../report/project_issue_report_view.xml | 2 +-
2 files changed, 55 insertions(+), 7 deletions(-)
diff --git a/addons/board_project/board_project_issue_view.xml b/addons/board_project/board_project_issue_view.xml
index eaf3a2f8612..60103007985 100644
--- a/addons/board_project/board_project_issue_view.xml
+++ b/addons/board_project/board_project_issue_view.xml
@@ -7,24 +7,72 @@
project.issue
form
tree,form
- [('create_date', '>=', time.strftime('%Y-%m-%d 00:00:00')),('create_date', '<=', time.strftime('%Y-%m-%d 23:59:59'))]
+ [('user_id','=',uid),('state','in',['draft','open'])]
+
+ Project issues
+ project.issue
+ form
+ tree,form
+ [('user_id','=',uid),('state','=','pending')]
+
+
+
+
+ Project Issue
+ project.issue.report
+ form
+ graph
+ [('user_id','=',uid)]
+
+
+
+
+ project.issue.report.graph
+ project.issue.report
+ graph
+
+
+
+
+
+
+
+
+
+
+ Project Issue
+ project.issue.report
+ form
+ graph
+ [('user_id','=',uid)]
+
+
+
board.project.issue.form
board.board
form
-
diff --git a/addons/project_issue/report/project_issue_report_view.xml b/addons/project_issue/report/project_issue_report_view.xml
index 8fb99f318ad..57031572ed7 100644
--- a/addons/project_issue/report/project_issue_report_view.xml
+++ b/addons/project_issue/report/project_issue_report_view.xml
@@ -37,7 +37,7 @@
project.issue.report
graph
-
+
From 6303e47b06fbf9ff7f08f73f855db97ec560cf1e Mon Sep 17 00:00:00 2001
From: "nel@tinyerp.com" <>
Date: Thu, 20 May 2010 17:38:22 +0200
Subject: [PATCH 58/61] [IMP] project: rename column user = assigned to try to
improve search view for extended options
bzr revid: nel@tinyerp.com-20100520153822-7yc7to7xxnr9r9sy
---
addons/project/report/project_report.py | 2 +-
addons/project/report/project_report_view.xml | 12 +++---------
addons/project_issue/__openerp__.py | 1 -
.../project_issue/report/project_issue_report.py | 6 ------
.../report/project_issue_report_view.xml | 14 ++------------
5 files changed, 6 insertions(+), 29 deletions(-)
diff --git a/addons/project/report/project_report.py b/addons/project/report/project_report.py
index e099b4544aa..8aae859053b 100644
--- a/addons/project/report/project_report.py
+++ b/addons/project/report/project_report.py
@@ -30,7 +30,7 @@ class report_project_task_user(osv.osv):
'name': fields.char('Task Summary', size=128, readonly=True),
'day': fields.char('Day', size=128, readonly=True),
'year': fields.char('Year',size=64,required=False, readonly=True),
- 'user_id':fields.many2one('res.users', 'User', readonly=True),
+ 'user_id':fields.many2one('res.users', 'Assigned To', readonly=True),
'date_start': fields.datetime('Starting Date',readonly=True),
'no_of_days': fields.integer('#Days', size=128, readonly=True),
'description': fields.text('Description',readonly=True),
diff --git a/addons/project/report/project_report_view.xml b/addons/project/report/project_report_view.xml
index fefb8752108..da1aad8e393 100644
--- a/addons/project/report/project_report_view.xml
+++ b/addons/project/report/project_report_view.xml
@@ -89,11 +89,7 @@
domain="[('user_id','=',False)]"/>
-<<<<<<< TREE
- >>>>>> MERGE-SOURCE
string="My Task"
help="My Tasks"
domain="[('project_id','=',context.get('project_id', False)]"/>
@@ -104,21 +100,19 @@
-
-
+
-
+
-
-
+
diff --git a/addons/project_issue/__openerp__.py b/addons/project_issue/__openerp__.py
index 2bf67d47191..513bae085bd 100644
--- a/addons/project_issue/__openerp__.py
+++ b/addons/project_issue/__openerp__.py
@@ -31,7 +31,6 @@
'author': 'Tiny',
'website': 'http://www.openerp.com',
'depends': [
- 'crm',
'project',
'hr_timesheet_sheet',
],
diff --git a/addons/project_issue/report/project_issue_report.py b/addons/project_issue/report/project_issue_report.py
index 28223d21d9e..6bc02be3ab2 100644
--- a/addons/project_issue/report/project_issue_report.py
+++ b/addons/project_issue/report/project_issue_report.py
@@ -68,7 +68,6 @@ class project_issue_report(osv.osv):
'create_date': fields.datetime('Create Date', 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"),
@@ -77,7 +76,6 @@ class project_issue_report(osv.osv):
'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', 'Version', 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),
@@ -99,12 +97,10 @@ 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,
@@ -127,12 +123,10 @@ 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,
diff --git a/addons/project_issue/report/project_issue_report_view.xml b/addons/project_issue/report/project_issue_report_view.xml
index d7672fb6f10..d725e5bd1a0 100644
--- a/addons/project_issue/report/project_issue_report_view.xml
+++ b/addons/project_issue/report/project_issue_report_view.xml
@@ -11,8 +11,6 @@
-
-
@@ -52,14 +50,10 @@
-
-
-
-
-
-
@@ -129,12 +121,10 @@
-
-
From 8249c4b7e9796c4ac5b9da69accfe97e1b47207f Mon Sep 17 00:00:00 2001
From: apa-tiny
Date: Fri, 21 May 2010 12:24:20 +0530
Subject: [PATCH 59/61] [IMP]:project,stock:Improved SQL report with new
guidlines.
bzr revid: apa@tinyerp.com-20100521065420-31waeltufldk319i
---
addons/project/report/project_report.py | 6 ++----
addons/project/report/project_report_view.xml | 14 +++++++------
.../report/report_stock_picking_view.xml | 20 ++++++++++---------
3 files changed, 21 insertions(+), 19 deletions(-)
diff --git a/addons/project/report/project_report.py b/addons/project/report/project_report.py
index e099b4544aa..c417abd4280 100644
--- a/addons/project/report/project_report.py
+++ b/addons/project/report/project_report.py
@@ -31,16 +31,15 @@ class report_project_task_user(osv.osv):
'day': fields.char('Day', size=128, readonly=True),
'year': fields.char('Year',size=64,required=False, readonly=True),
'user_id':fields.many2one('res.users', 'User', readonly=True),
- 'date_start': fields.datetime('Starting Date',readonly=True),
+ 'date_start': fields.date('Starting Date',readonly=True),
'no_of_days': fields.integer('#Days', size=128, readonly=True),
'description': fields.text('Description',readonly=True),
- 'date_end': fields.datetime('Ending Date',readonly=True),
+ 'date_end': fields.date('Ending Date',readonly=True),
'date_deadline': fields.date('Deadline',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),
'hours_delay': fields.float('Avg. Plan.-Eff.', readonly=True),
-# 'closing_days': fields.char('Avg Closing Delay', size=64, readonly=True),
'closing_days': fields.float('Avg Closing Delay', digits=(16,2), readonly=True, group_operator="avg",
help="Number of Days to close the task"),
@@ -102,7 +101,6 @@ class report_project_task_user(osv.osv):
t.state,
date_trunc('day',t.date_end),
to_date(to_char(t.date_deadline, 'dd-MM-YYYY'),'dd-MM-YYYY'),
- date_trunc('day',t.date_start),
t.company_id,
t.partner_id,
t.type,
diff --git a/addons/project/report/project_report_view.xml b/addons/project/report/project_report_view.xml
index 7990d7ab1aa..97c7778a729 100644
--- a/addons/project/report/project_report_view.xml
+++ b/addons/project/report/project_report_view.xml
@@ -102,19 +102,21 @@
help ="Non assigned tasks to projects"
domain="[('project_id','=',False"/>
+
-
+
+
+
+
+
-
-
+
+
-
-
-
diff --git a/addons/stock/report/report_stock_picking_view.xml b/addons/stock/report/report_stock_picking_view.xml
index da5bdba6abf..281d60336c8 100644
--- a/addons/stock/report/report_stock_picking_view.xml
+++ b/addons/stock/report/report_stock_picking_view.xml
@@ -56,13 +56,13 @@
-
-
+
+ help="Picking in last 30 days"/>
@@ -70,30 +70,32 @@
-
+
-
+
+
-
+
+
-
+
-
+
From 3e7cb952534e30fec4c560ffb899566a77ad75aa Mon Sep 17 00:00:00 2001
From: "nel@tinyerp.com" <>
Date: Fri, 21 May 2010 10:09:48 +0200
Subject: [PATCH 60/61] [IMP] project_issue: rename + add icon
bzr revid: nel@tinyerp.com-20100521080948-0oatbrtz4pfwdks0
---
addons/project/report/project_report_view.xml | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/addons/project/report/project_report_view.xml b/addons/project/report/project_report_view.xml
index da1aad8e393..44ccc9358c6 100644
--- a/addons/project/report/project_report_view.xml
+++ b/addons/project/report/project_report_view.xml
@@ -52,10 +52,14 @@
-
-
From 2a94c90f2e12a25e5888d02ff201247d42bca037 Mon Sep 17 00:00:00 2001
From: "nel@tinyerp.com" <>
Date: Fri, 21 May 2010 10:10:28 +0200
Subject: [PATCH 61/61] [IMP] stock: picking report
bzr revid: nel@tinyerp.com-20100521081028-6l5o1xid6owan2y3
---
addons/stock/report/report_stock_picking.py | 24 +++--
.../report/report_stock_picking_view.xml | 97 +++++++++++--------
2 files changed, 71 insertions(+), 50 deletions(-)
diff --git a/addons/stock/report/report_stock_picking.py b/addons/stock/report/report_stock_picking.py
index 8b464a35762..b6e2a3d3373 100644
--- a/addons/stock/report/report_stock_picking.py
+++ b/addons/stock/report/report_stock_picking.py
@@ -30,16 +30,15 @@ class report_stock_picking(osv.osv):
'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),
'day': fields.char('Day', size=128, readonly=True),
- 'reference': fields.char('Reference', size=64, select=True),
'nbr': fields.integer('# of Lines', readonly=True),
'nbp': fields.integer('# of Picking', readonly=True),
'partner_id':fields.many2one('res.partner', 'Partner', readonly=True),
'product_qty': fields.float('# of Products', readonly=True),
+ 'product_uos_qty': fields.float('# of Products', readonly=True),
'product_id': fields.many2one('product.product', 'Product', readonly=True),
'date': fields.date('Date', readonly=True),
'avg_days_to_deliver': fields.float('Avg Days to Deliver', digits=(16,2), readonly=True, group_operator="avg",
help="Number of Avg Days to deliver"),
- 'origin': fields.char('Origin', size=64),
'state': fields.selection([('draft', 'Draft'),('auto', 'Waiting'),('confirmed', 'Confirmed'),('assigned', 'Available'),('done', 'Done'),('cancel', 'Cancelled')], 'State'),
'type': fields.selection([('out', 'Sending Goods'), ('in', 'Getting Goods'), ('internal', 'Internal'), ('delivery', 'Delivery')], 'Shipping Type', required=True),
'company_id': fields.many2one('res.company', 'Company', readonly=True),
@@ -50,7 +49,11 @@ class report_stock_picking(osv.osv):
'min_date': fields.date('Expected Date',help="Expected date for Picking. Default it takes current date"),
'order_date': fields.date('Order Date', help="Date of Order"),
'date_done': fields.date('Date Done', help="Date of completion"),
+ 'location_id': fields.many2one('stock.location', 'Source Location', help="Sets a location if you produce at a fixed location. This can be a partner location if you subcontract the manufacturing operations."),
+ 'location_dest_id': fields.many2one('stock.location', 'Dest. Location', help="Location where the system will stock the finished products."),
'max_date': fields.date('Max.Expected Date'),
+ 'product_uos': fields.many2one('product.uom', 'Product UOS'),
+ 'product_uom': fields.many2one('product.uom', 'Product UOM'),
}
def init(self, cr):
tools.drop_view_if_exists(cr, 'report_stock_picking')
@@ -70,12 +73,15 @@ class report_stock_picking(osv.osv):
count(sm.id) as nbr,
count(distinct sp.id) as nbp,
sum(sm.product_qty) as product_qty,
- sm.product_id,
+ sum(sm.product_uos_qty) as product_uos_qty,
+ sm.product_id as product_id,
+ sm.location_dest_id as location_dest_id,
+ sm.location_id as location_id,
sp.type,
+ sm.product_uos,
+ sm.product_uom,
sp.invoice_state,
- sp.company_id,
- sp.name as reference,
- sp.origin,
+ sp.company_id as company_id,
avg(extract('epoch' from (sp.date_done-sp.create_date)))/(3600*24) as avg_days_to_deliver,
sp.state
from stock_move as sm
@@ -83,17 +89,19 @@ class report_stock_picking(osv.osv):
group by sp.type,
sp.create_date,
sp.address_id,
- sp.name,
sm.product_id,
to_char(sp.create_date, 'YYYY'),
+ sm.location_dest_id,
+ sm.location_id,
to_char(sp.create_date, 'MM'),
to_char(sp.create_date, 'YYYY-MM-DD'),
+ sm.product_uos,
+ sm.product_uom,
date_trunc('day',sp.min_date),
date_trunc('day',sp.date),
date_trunc('day',sp.date_done),
date_trunc('day',sp.max_date),
sp.invoice_state,
- sp.origin,
sp.company_id,
sp.state
diff --git a/addons/stock/report/report_stock_picking_view.xml b/addons/stock/report/report_stock_picking_view.xml
index da5bdba6abf..6dc282e9f8b 100644
--- a/addons/stock/report/report_stock_picking_view.xml
+++ b/addons/stock/report/report_stock_picking_view.xml
@@ -15,23 +15,26 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -55,49 +58,59 @@
search
-
-
+
-
+
+ help="Picking of last 30 days"/>
+
+
-
+
+
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
-
-
-
-
-
-
+
+
+
+
+
-
-
+
+
@@ -109,7 +122,7 @@
tree,graph
- {'search_default_Partner':1,'search_default_month':1,'group_by_no_leaf':1,'group_by':[]}
+ {'search_default_Partner':1,'search_default_product':1,'search_default_month':1,'group_by_no_leaf':1,'group_by':[]}