From 958cf4bbbeccc458c0b56f40b0960cb24e632a8b Mon Sep 17 00:00:00 2001
From: "nel@tinyerp.com" <>
Date: Fri, 4 Jun 2010 19:54:17 +0200
Subject: [PATCH 01/14] [IMP] project_issue, purchase, sale reports
bzr revid: nel@tinyerp.com-20100604175417-4u3jzricew1j7i96
---
addons/mrp/report/mrp_production_order.py | 9 +-
.../mrp/report/mrp_production_order_view.xml | 27 +--
addons/project/report/project_report.py | 69 +++---
addons/project/report/project_report_view.xml | 33 ++-
.../report/project_issue_report.py | 43 ++--
.../report/project_issue_report_view.xml | 107 ++++-----
addons/purchase/report/purchase_report.py | 13 +-
.../purchase/report/purchase_report_view.xml | 220 ------------------
addons/sale/report/sale_report.py | 5 +-
addons/sale/report/sale_report_view.xml | 17 +-
10 files changed, 164 insertions(+), 379 deletions(-)
delete mode 100644 addons/purchase/report/purchase_report_view.xml
diff --git a/addons/mrp/report/mrp_production_order.py b/addons/mrp/report/mrp_production_order.py
index d754d6a50ad..4fffbdf1689 100644
--- a/addons/mrp/report/mrp_production_order.py
+++ b/addons/mrp/report/mrp_production_order.py
@@ -32,11 +32,12 @@ class mrp_production_order(osv.osv):
('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),
+ 'nbr': fields.integer('# of Lines', 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_id2': fields.many2one('product.product', 'Product Consumed', readonly=True),
'product_qty': fields.float('Product Qty', readonly=True),
'state': fields.selection([('draft','Draft'),
('picking_except', 'Picking Exception'),
@@ -74,11 +75,12 @@ class mrp_production_order(osv.osv):
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,
+ s.product_id as product_id,
+ l.product_id as product_id2,
l.product_uom,
sum(l.product_qty * u.factor) as product_qty,
s.company_id as company_id,
- count(*) as nbr,
+ (select 1) 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)
@@ -111,6 +113,7 @@ class mrp_production_order(osv.osv):
to_char(s.create_date, 'YYYY-MM-DD'),
to_date(to_char(s.create_date, 'MM-dd-YYYY'),'MM-dd-YYYY'),
l.product_id,
+ s.product_id,
l.product_uom,
s.id,
l.id,
diff --git a/addons/mrp/report/mrp_production_order_view.xml b/addons/mrp/report/mrp_production_order_view.xml
index 55957619e31..c182e524ba8 100644
--- a/addons/mrp/report/mrp_production_order_view.xml
+++ b/addons/mrp/report/mrp_production_order_view.xml
@@ -11,19 +11,20 @@
tree
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/project/report/project_report.py b/addons/project/report/project_report.py
index 1cd452d736e..b115b576859 100644
--- a/addons/project/report/project_report.py
+++ b/addons/project/report/project_report.py
@@ -31,7 +31,6 @@ 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', 'Assigned To', readonly=True),
- 'done_by':fields.many2one('res.users', 'Done By', readonly=True),
'date_start': fields.date('Starting Date',readonly=True),
'no_of_days': fields.integer('# of Days', size=128, readonly=True),
'description': fields.text('Description',readonly=True),
@@ -48,7 +47,7 @@ class report_project_task_user(osv.osv):
help="Number of Days to close the task"),
'opening_days': fields.float('Days to Open', digits=(16,2), readonly=True, group_operator="avg",
help="Number of Days to Open the task"),
- 'delay_endings_days': fields.float('Overpass Delay', digits=(16,2), readonly=True, group_operator="avg"),
+ 'delay_endings_days': fields.float('Overpassed Deadline', digits=(16,2), readonly=True),
'nbr': fields.integer('# of tasks', readonly=True),
'priority' : fields.selection([('4','Very Low'),
('3','Low'),
@@ -74,53 +73,61 @@ class report_project_task_user(osv.osv):
def init(self, cr):
tools.sql.drop_view_if_exists(cr, 'report_project_task_user')
cr.execute("""
- create or replace view report_project_task_user as (
- select
- min(t.id) as id,
+ create view report_project_task_user as
+ select
+ (select 1 ) AS nbr,
+ t.id as id,
to_char(date_start, 'YYYY') as year,
to_char(date_start, 'MM') as month,
to_char(date_start, 'YYYY-MM-DD') as day,
- count(distinct t.id) as nbr,
date_trunc('day',t.date_start) as date_start,
date_trunc('day',t.date_end) as date_end,
to_date(to_char(t.date_deadline, 'dd-MM-YYYY'),'dd-MM-YYYY') as date_deadline,
- sum(cast(to_char(date_trunc('day',t.date_end) - date_trunc('day',t.date_start),'DD') as int)) as no_of_days,
+-- sum(cast(to_char(date_trunc('day',t.date_end) - date_trunc('day',t.date_start),'DD') as int)) as no_of_days,
+ (extract('epoch' from (t.date_end-t.date_start)))/(3600*24) as no_of_days,
t.user_id,
- sum(progress) as progress,
+ progress as progress,
t.project_id,
t.state,
+ t.effective_hours as hours_effective,
t.priority,
t.name as name,
t.company_id,
t.partner_id,
t.type,
- w.user_id as done_by,
- sum(remaining_hours) as remaining_hours,
- sum(total_hours) as total_hours,
- sum(planned_hours) as hours_planned,
- avg(extract('epoch' from (t.date_end-t.create_date)))/(3600*24) as closing_days,
- avg(extract('epoch' from (t.date_start-t.create_date)))/(3600*24) as opening_days,
- avg(extract('epoch' from (t.date_deadline-t.date_end)))/(3600*24) as delay_endings_days,
- sum(w.hours) as hours_effective,
- ((sum(planned_hours)-sum(w.hours))/count(distinct t.id))::decimal(16,2) as hours_delay
- from project_task t
- left join project_task_work w on (t.id=w.task_id)
- group by
- to_char(date_start, 'YYYY'),
- to_char(date_start, 'MM'),
- t.priority,
+ remaining_hours as remaining_hours,
+ total_hours as total_hours,
+ t.delay_hours as hours_delay,
+ planned_hours as hours_planned,
+ (extract('epoch' from (t.date_end-t.create_date)))/(3600*24) as closing_days,
+ (extract('epoch' from (t.date_start-t.create_date)))/(3600*24) as opening_days,
+ (extract('epoch' from (t.date_deadline-t.date_end)))/(3600*24) as delay_endings_days
+ from project_task t
+
+ group by
+ t.id,
+ remaining_hours,
+ t.effective_hours,
+ progress,
+ total_hours,
+ planned_hours,
+ hours_delay,
+ year,
+ month,
+ day,
+ create_date,
+ date_start,
+ date_end,
+ date_deadline,
t.user_id,
- w.user_id,
+ t.project_id,
t.state,
- date_trunc('day',t.date_end),
- to_date(to_char(t.date_deadline, 'dd-MM-YYYY'),'dd-MM-YYYY'),
+ t.priority,
+ name,
t.company_id,
t.partner_id,
- t.type,
- t.name,
- t.project_id,
- t.date_start
- )
+ t.type
+
""")
report_project_task_user()
diff --git a/addons/project/report/project_report_view.xml b/addons/project/report/project_report_view.xml
index 26488eae254..9b685001664 100644
--- a/addons/project/report/project_report_view.xml
+++ b/addons/project/report/project_report_view.xml
@@ -12,7 +12,6 @@
-
@@ -31,8 +30,8 @@
-
+
@@ -87,9 +86,14 @@
icon="terp-dialog-close"
name="done"
domain="[('state','=','done')]"/>
-
-
-
+
+
+
+
+
-
-
-
-
+
+
-
-
-
+
+
+
-
@@ -126,7 +124,6 @@
-
@@ -145,7 +142,7 @@
form
tree,graph
- {'search_default_month':1,'search_default_User':1,'search_default_user_id':uid,'group_by_no_leaf':1,'group_by':[]}
+ {'search_default_month':1,'search_default_project':1,'group_by_no_leaf':1,'group_by':[]}
diff --git a/addons/project_issue/report/project_issue_report.py b/addons/project_issue/report/project_issue_report.py
index 70a08e2c7b4..26ae5252dc8 100644
--- a/addons/project_issue/report/project_issue_report.py
+++ b/addons/project_issue/report/project_issue_report.py
@@ -9,7 +9,6 @@ AVAILABLE_STATES = [
('done', 'Closed'),
('pending','Pending')
]
-
class project_issue_report(osv.osv):
_name = "project.issue.report"
_auto = False
@@ -51,9 +50,8 @@ class project_issue_report(osv.osv):
_columns = {
'name': fields.char('Year', size=64, required=False, readonly=True),
- 'user_id':fields.many2one('res.users', 'User', readonly=True),
+ 'user_id':fields.many2one('res.users', 'Responsible', readonly=True),
'section_id':fields.many2one('crm.case.section', 'Section', readonly=True),
- 'nbr': fields.integer('# of Cases', readonly=True),
'state': fields.selection(AVAILABLE_STATES, 'State', size=16, readonly=True),
'avg_answers': fields.function(_get_data, string='Avg. Answers', method=True, type="integer"),
'perc_done': fields.function(_get_data, string='%Done', method=True, type="float"),
@@ -65,23 +63,29 @@ class project_issue_report(osv.osv):
('09', 'September'), ('10', 'October'),\
('11', 'November'), ('12', 'December')], 'Month', readonly=True),
'company_id': fields.many2one('res.company', 'Company', readonly=True),
- 'create_date': fields.datetime('Create Date', readonly=True),
'day': fields.char('Day', size=128, readonly=True),
+ 'opening_date': fields.date('Opening Date', readonly=True),
+ 'creation_date': fields.date('Creation Date', 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),
+ 'working_hours_open': fields.float('# Working Open Hours', readonly=True),
+ 'working_hours_close': fields.float('# Working Closing Hours', readonly=True),
+ 'delay_open': fields.float('Avg opening Delay', digits=(16,2), readonly=True, group_operator="avg",
+ help="Number of Days to close the project issue"),
'delay_close': fields.float('Avg Closing Delay', digits=(16,2), readonly=True, group_operator="avg",
help="Number of Days to close the project issue"),
'company_id' : fields.many2one('res.company', 'Company'),
'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority'),
'project_id':fields.many2one('project.project', 'Project',readonly=True),
'type_id': fields.many2one('crm.case.resource.type', 'Type', domain="[('object_id.model', '=', 'project.issue')]"),
- 'date_closed': fields.datetime('Close Date', readonly=True),
+ 'date_closed': fields.date('Close Date', 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')]" )
}
+
def init(self, cr):
tools.drop_view_if_exists(cr, 'project_issue_report')
cr.execute("""
@@ -91,51 +95,60 @@ class project_issue_report(osv.osv):
to_char(c.create_date, 'YYYY') as name,
to_char(c.create_date, 'MM') as month,
to_char(c.create_date, 'YYYY-MM-DD') as day,
+ to_char(c.date_open, 'YYYY-MM-DD') as opening_date,
+ to_char(c.create_date, 'YYYY-MM-DD') as creation_date,
c.state,
c.user_id,
+ c.working_hours_open,
+ c.working_hours_close,
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,
+ to_char(c.date_closed, 'YYYY-mm-dd') as date_closed,
+ c.company_id as company_id,
c.priority as priority,
c.project_id as project_id,
c.type_id as type_id,
- count(*) as nbr,
+ (select 1) as nbr,
c.assigned_to,
c.partner_id,
c.canal_id,
c.task_id,
date_trunc('day',c.create_date) as create_date,
+ avg(extract('epoch' from (c.date_open-c.create_date)))/(3600*24) as delay_open,
avg(extract('epoch' from (c.date_closed-c.create_date)))/(3600*24) as delay_close
from
project_issue c
- left join
- res_users u on (c.id = u.id)
+ where c.categ_id in (select res_id from ir_model_data where name='bug_categ')
group by
to_char(c.create_date, 'YYYY'),
to_char(c.create_date, 'MM'),
to_char(c.create_date, 'YYYY-MM-DD'),
c.state,
+ to_char(c.date_open, 'YYYY-MM-DD'),
+ to_char(c.date_closed, 'YYYY-mm-dd'),
c.user_id,
c.section_id,
c.categ_id,
c.stage_id,
- c.date_closed,
- u.company_id,
+ c.company_id,
c.priority,
+ c.working_hours_open,
+ c.working_hours_close,
c.project_id,
+ to_char(c.date_closed, 'YYYY-MM-DD'),
c.type_id,
+ c.working_hours_open,
+ c.working_hours_close,
date_trunc('day',c.create_date),
c.assigned_to,
c.partner_id,
c.canal_id,
c.task_id
- )""")
-
+ )""")
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 adc1b3c662f..396a892e38c 100644
--- a/addons/project_issue/report/project_issue_report_view.xml
+++ b/addons/project_issue/report/project_issue_report_view.xml
@@ -15,7 +15,6 @@
-
@@ -24,10 +23,13 @@
-
+
+
+
+
@@ -51,29 +53,25 @@
-
-
-
-
-
-
-
+
+
-
-
-
+
-
-
-
-
-
+
+
+
+
+
+
+
-
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
-
-
@@ -179,7 +152,7 @@
project.issue.report
form
graph,tree
- {"search_default_This Month":1,"search_default_User":1,"search_default_user_id":uid,'group_by_no_leaf':1,'group_by':[]}
+ {'search_default_This Month':1,'search_default_project_id':1,'group_by_no_leaf':1,'group_by':[]}
diff --git a/addons/purchase/report/purchase_report.py b/addons/purchase/report/purchase_report.py
index cf177319ea5..71f2638d628 100644
--- a/addons/purchase/report/purchase_report.py
+++ b/addons/purchase/report/purchase_report.py
@@ -31,7 +31,7 @@ class purchase_report(osv.osv):
_description = "Purchases Orders"
_auto = False
_columns = {
- 'date': fields.date('Date', readonly=True),
+ 'date': fields.date('Date order', readonly=True),
'name': fields.char('Year',size=64,required=False, readonly=True),
'day': fields.char('Day', size=128, readonly=True),
'state': fields.selection([
@@ -61,7 +61,11 @@ class purchase_report(osv.osv):
'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),
+ 'shipped_qty':fields.integer('Received Qty', readonly=True),
+ 'invoiced_qty':fields.integer('Invoiced Qty', readonly=True),
'user_id':fields.many2one('res.users', 'Responsible', readonly=True),
+ 'delay':fields.float('Days to Close', digits=(16,2), readonly=True),
+ 'delay_pass':fields.float('Overpassed expected', digits=(16,2), readonly=True),
'quantity': fields.float('# of Products', readonly=True),
'price_total': fields.float('Total Price', readonly=True),
'price_average': fields.float('Average Price', readonly=True),
@@ -94,9 +98,13 @@ class purchase_report(osv.osv):
s.create_uid as user_id,
s.company_id as company_id,
s.invoice_method,
+ s.shipped::integer as shipped_qty,
+ l.invoiced::integer as invoiced_qty,
l.product_id,
s.location_id as location_id,
sum(l.product_qty*u.factor) as quantity,
+ extract(epoch from age(s.date_approve,s.date_order))/(24*60*60)::decimal(16,2) as delay,
+ extract(epoch from age(s.minimum_planned_date,s.date_order))/(24*60*60)::decimal(16,2) as delay_pass,
count(*) as nbr,
sum(l.product_qty*l.price_unit) as price_total,
(sum(l.product_qty*l.price_unit)/sum(l.product_qty*u.factor))::decimal(16,2) as price_average
@@ -107,9 +115,12 @@ class purchase_report(osv.osv):
group by
s.company_id,
s.create_uid,
+ s.shipped,
+ l.invoiced,
s.partner_id,
s.location_id,
s.date_approve,
+ s.minimum_planned_date,
date_trunc('day',s.minimum_planned_date),
s.partner_address_id,
s.pricelist_id,
diff --git a/addons/purchase/report/purchase_report_view.xml b/addons/purchase/report/purchase_report_view.xml
deleted file mode 100644
index 8fb7836468d..00000000000
--- a/addons/purchase/report/purchase_report_view.xml
+++ /dev/null
@@ -1,220 +0,0 @@
-
-
-
-
- product.month.graph
- purchase.report
- graph
-
-
-
-
-
-
-
-
-
-
- purchase.order.tree
- purchase.report
- tree
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- report.purchase.order.search
- purchase.report
- search
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Purchase Orders
- purchase.report
- form
- tree,graph
-
- {'search_default_month':1,'search_default_Responsible':1,'group_by_no_leaf':1,'group_by':[]}
-
-
-
-
-
-
- purchase.order.qty.amount.graph
- purchase.order.qty.amount
- graph
-
-
-
-
-
-
-
-
-
-
- purchase.order.qty.amount.tree
- purchase.order.qty.amount
- tree
-
-
-
-
-
-
-
-
-
-
- Total Qty and Amount by month
- purchase.order.qty.amount
- form
- graph,tree
-
-
-
- purchase.order.by.user.graph
- purchase.order.by.user
- graph
-
-
-
-
-
-
-
-
-
-
- purchase.order.by.user.tree
- purchase.order.by.user
- tree
-
-
-
-
-
-
-
-
-
-
- Total Orders by User per month
- purchase.order.by.user
- form
- graph,tree
-
-
-
diff --git a/addons/sale/report/sale_report.py b/addons/sale/report/sale_report.py
index d9be5f49274..68f50068ec0 100644
--- a/addons/sale/report/sale_report.py
+++ b/addons/sale/report/sale_report.py
@@ -71,7 +71,8 @@ class sale_report(osv.osv):
cr.execute("""
create or replace view sale_report as (
select el.*,
- (select count(1) from sale_order_line where order_id = s.id) as nbr,
+ -- (select count(1) from sale_order_line where order_id = s.id) as nbr,
+ (select 1) as nbr,
s.date_order as date,
s.date_confirm as date_confirm,
to_char(s.date_order, 'YYYY') as year,
@@ -101,7 +102,7 @@ class sale_report(osv.osv):
sale_order_line l
left join product_uom u on (u.id=l.product_uom)
left join product_template pt on (pt.id=l.product_id)
- group by l.id, l.order_id, l.product_id, u.name, pt.categ_id) el
+ group by l.id, l.order_id, l.product_id, u.name, pt.categ_id) el
where s.id = el.order_id
)
""")
diff --git a/addons/sale/report/sale_report_view.xml b/addons/sale/report/sale_report_view.xml
index 75dd9d55642..f6090638891 100644
--- a/addons/sale/report/sale_report_view.xml
+++ b/addons/sale/report/sale_report_view.xml
@@ -19,7 +19,7 @@
-
+
@@ -85,19 +85,19 @@
-
+
-
-
+
-
+
+
+
-
-
-
+
+
@@ -109,7 +109,6 @@
-
From 2743b46caca754acd3acf7262764cc17cecb527a Mon Sep 17 00:00:00 2001
From: "nel@tinyerp.com" <>
Date: Sat, 5 Jun 2010 18:17:49 +0200
Subject: [PATCH 02/14] [IMP] lead report views
bzr revid: nel@tinyerp.com-20100605161749-vx0meubea86bqtq7
---
addons/crm/report/crm_lead_report.py | 7 ++-
addons/crm/report/crm_lead_report_view.xml | 71 +++++++++++-----------
2 files changed, 41 insertions(+), 37 deletions(-)
diff --git a/addons/crm/report/crm_lead_report.py b/addons/crm/report/crm_lead_report.py
index 39806c50803..cf8097fee5b 100644
--- a/addons/crm/report/crm_lead_report.py
+++ b/addons/crm/report/crm_lead_report.py
@@ -91,7 +91,7 @@ class crm_lead_report(osv.osv):
'create_date': fields.datetime('Create Date', readonly=True),
'day': fields.char('Day', size=128, readonly=True),
'email': fields.integer('# of Emails', size=128, readonly=True),
- 'expected_closing_days': fields.integer('# of Expected Closing Days', size=128, readonly=True),
+ 'expected_closing_days': fields.integer('Avg Expected Closing Days', size=128, readonly=True),
'delay_open': fields.float('Delay to open',digits=(16,2),readonly=True, group_operator="avg",help="Number of Days to open the case"),
'delay_close': fields.float('Delay to close',digits=(16,2),readonly=True, group_operator="avg",help="Number of Days to close the case"),
'categ_id': fields.many2one('crm.case.categ', 'Category',\
@@ -130,17 +130,18 @@ class crm_lead_report(osv.osv):
c.section_id,
c.categ_id,
c.partner_id,
- count(*) as nbr,
+ (select 1) as nbr,
0 as avg_answers,
0.0 as perc_done,
0.0 as perc_cancel,
(select count(id) from mailgate_message where thread_id=c.id) as email,
date_trunc('day',c.create_date) as create_date,
- sum(cast(to_char(date_trunc('day',c.date_open) - date_trunc('day',c.date_deadline),'DD') as int)) as expected_closing_days,
+ avg(cast(to_char(date_trunc('day',c.date_open) - date_trunc('day',c.date_deadline),'DD') as int)) as expected_closing_days,
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
crm_lead c
+ where c.type='lead' or c.type is null
group by
to_char(c.create_date, 'YYYY'),
to_char(c.create_date, 'MM'),
diff --git a/addons/crm/report/crm_lead_report_view.xml b/addons/crm/report/crm_lead_report_view.xml
index 770d9292b6f..3419849165a 100644
--- a/addons/crm/report/crm_lead_report_view.xml
+++ b/addons/crm/report/crm_lead_report_view.xml
@@ -10,19 +10,22 @@
tree
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
@@ -79,11 +82,8 @@
domain="[('create_date','<=', time.strftime('%%Y-%%m-%%d')), ('create_date','>',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"/>
-
+ string="Current"
+ domain="[('state','in',('draft','open')]"/>
@@ -105,19 +105,20 @@
-
-
-
+
+
+
+
@@ -129,6 +130,7 @@
+
@@ -144,23 +146,24 @@
crm.lead.report
tree
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
From 3cc2a168ec13ca1051c62a01647093f31c2f19eb Mon Sep 17 00:00:00 2001
From: "nel@tinyerp.com" <>
Date: Sun, 6 Jun 2010 00:38:07 +0200
Subject: [PATCH 03/14] [IMP] phonecall,lead reports
bzr revid: nel@tinyerp.com-20100605223807-xrgpp2hnofvv5qyo
---
addons/crm/report/crm_lead_report.py | 18 +++-
addons/crm/report/crm_lead_report_view.xml | 37 ++++---
addons/crm/report/crm_phonecall_report.py | 55 ++++++++---
.../crm/report/crm_phonecall_report_view.xml | 99 +++++++++----------
4 files changed, 126 insertions(+), 83 deletions(-)
diff --git a/addons/crm/report/crm_lead_report.py b/addons/crm/report/crm_lead_report.py
index cf8097fee5b..17ddf5d3024 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
+from crm import crm
AVAILABLE_STATES = [
('draft','Draft'),
@@ -91,7 +92,6 @@ class crm_lead_report(osv.osv):
'create_date': fields.datetime('Create Date', readonly=True),
'day': fields.char('Day', size=128, readonly=True),
'email': fields.integer('# of Emails', size=128, readonly=True),
- 'expected_closing_days': fields.integer('Avg Expected Closing Days', size=128, readonly=True),
'delay_open': fields.float('Delay to open',digits=(16,2),readonly=True, group_operator="avg",help="Number of Days to open the case"),
'delay_close': fields.float('Delay to close',digits=(16,2),readonly=True, group_operator="avg",help="Number of Days to close the case"),
'categ_id': fields.many2one('crm.case.categ', 'Category',\
@@ -101,7 +101,12 @@ class crm_lead_report(osv.osv):
domain="[('section_id','=',section_id),\
('object_id.model', '=', 'crm.lead')]", readonly=True),
'partner_id': fields.many2one('res.partner', 'Partner' , readonly=True),
+ 'opening_date': fields.date('Opening Date', readonly=True),
+ 'creation_date': fields.date('Creation Date', readonly=True),
+ 'date_closed': fields.date('Close Date', readonly=True),
'company_id': fields.many2one('res.company', 'Company', readonly=True),
+ 'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority'),
+
'type':fields.selection([
('lead','Lead'),
('opportunity','Opportunity'),
@@ -122,11 +127,15 @@ class crm_lead_report(osv.osv):
to_char(c.create_date, 'YYYY') as name,
to_char(c.create_date, 'MM') as month,
to_char(c.create_date, 'YYYY-MM-DD') as day,
+ to_char(c.create_date, 'YYYY-MM-DD') as creation_date,
+ to_char(c.date_open, 'YYYY-MM-DD') as opening_date,
+ to_char(c.date_closed, 'YYYY-mm-dd') as date_closed,
c.state as state,
c.user_id,
c.stage_id,
c.type as type,
c.company_id,
+ c.priority,
c.section_id,
c.categ_id,
c.partner_id,
@@ -136,23 +145,24 @@ class crm_lead_report(osv.osv):
0.0 as perc_cancel,
(select count(id) from mailgate_message where thread_id=c.id) as email,
date_trunc('day',c.create_date) as create_date,
- avg(cast(to_char(date_trunc('day',c.date_open) - date_trunc('day',c.date_deadline),'DD') as int)) as expected_closing_days,
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
crm_lead c
- where c.type='lead' or c.type is null
group by
to_char(c.create_date, 'YYYY'),
+ to_char(c.date_open, 'YYYY-MM-DD'),
+ to_char(c.date_closed, 'YYYY-mm-dd'),
to_char(c.create_date, 'MM'),
c.state,
c.user_id,
c.id,
c.section_id,
c.stage_id,
- categ_id,
+ c.categ_id,
c.partner_id,
c.company_id,
+ c.priority,
c.type,
c.create_date,
to_char(c.create_date, 'YYYY-MM-DD')
diff --git a/addons/crm/report/crm_lead_report_view.xml b/addons/crm/report/crm_lead_report_view.xml
index 3419849165a..5dd32fe349d 100644
--- a/addons/crm/report/crm_lead_report_view.xml
+++ b/addons/crm/report/crm_lead_report_view.xml
@@ -15,6 +15,7 @@
+
@@ -25,7 +26,6 @@
-
@@ -105,16 +105,20 @@
-
+
+
-
-
-
-
+
+
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
+
+
@@ -155,13 +164,13 @@
+
-
@@ -176,7 +185,7 @@
form
{"search_default_User":1,"search_default_This Month":1,'group_by_no_leaf':1,'group_by':[]}
tree,graph
- [('type', '=', 'lead')]
+ ['|',('type', '=', 'lead'),('type', '=', False)]
diff --git a/addons/crm/report/crm_phonecall_report.py b/addons/crm/report/crm_phonecall_report.py
index c1954f8607f..c0e666e4eaa 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
+from crm import crm
AVAILABLE_STATES = [
('draft','Draft'),
@@ -78,6 +79,7 @@ class crm_phonecall_report(osv.osv):
'name': fields.char('Year', size=64, required=False, readonly=True),
'user_id':fields.many2one('res.users', 'User', readonly=True),
'section_id':fields.many2one('crm.case.section', 'Section', readonly=True),
+ 'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority'),
'nbr': fields.integer('# of Cases', readonly=True),
'state': fields.selection(AVAILABLE_STATES, 'State', size=16, readonly=True),
'avg_answers': fields.function(_get_data, string='Avg. Answers', method=True, type="integer"),
@@ -89,15 +91,22 @@ class crm_phonecall_report(osv.osv):
('07', 'July'), ('08', 'August'),\
('09', 'September'), ('10', 'October'),\
('11', 'November'), ('12', 'December')], 'Month', readonly=True),
- 'company_id': fields.many2one('res.company', 'Company', readonly=True),
'create_date': fields.datetime('Create Date', readonly=True),
'day': fields.char('Day', size=128, readonly=True),
'delay_close': fields.float('Delay to close', digits=(16,2),readonly=True, group_operator="avg",help="Number of Days to close the case"),
+ 'duration': fields.float('Duration', digits=(16,2),readonly=True, group_operator="avg"),
+ 'delay_open': fields.float('Delay to open',digits=(16,2),readonly=True, group_operator="avg",help="Number of Days to open the case"),
'categ_id': fields.many2one('crm.case.categ', 'Category', \
domain="[('section_id','=',section_id),\
('object_id.model', '=', 'crm.phonecall')]"),
'partner_id': fields.many2one('res.partner', 'Partner' , readonly=True),
+ 'stage_id': fields.many2one ('crm.case.stage', 'Stage', \
+ domain="[('section_id','=',section_id),\
+ ('object_id.model', '=', 'crm.phonecall')]", readonly=True),
'company_id': fields.many2one('res.company', 'Company', readonly=True),
+ 'opening_date': fields.date('Opening Date', readonly=True),
+ 'creation_date': fields.date('Creation Date', readonly=True),
+ 'date_closed': fields.date('Close Date', readonly=True),
}
def init(self, cr):
@@ -114,23 +123,45 @@ class crm_phonecall_report(osv.osv):
to_char(c.create_date, 'YYYY') as name,
to_char(c.create_date, 'MM') as month,
to_char(c.create_date, 'YYYY-MM-DD') as day,
+ to_char(c.create_date, 'YYYY-MM-DD') as creation_date,
+ to_char(c.date_open, 'YYYY-MM-DD') as opening_date,
+ to_char(c.date_closed, 'YYYY-mm-dd') as date_closed,
+ c.state,
+ c.user_id,
+ c.section_id,
+ c.categ_id,
+ c.partner_id,
+ c.stage_id,
+ c.duration,
+ c.company_id,
+ c.priority,
+ (select 1) as nbr,
+ 0 as avg_answers,
+ 0.0 as perc_done,
+ 0.0 as perc_cancel,
+ date_trunc('day',c.create_date) as create_date,
+ avg(extract('epoch' from (c.date_closed-c.create_date)))/(3600*24) as delay_close,
+ avg(extract('epoch' from (c.date_open-c.create_date)))/(3600*24) as delay_open
+
+ from
+ crm_phonecall c
+ where c.categ_id in (select res_id from ir_model_data where (name = 'categ_phone1' or name ='categ_phone2'))
+ 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,
- count(*) as nbr,
- 0 as avg_answers,
- 0.0 as perc_done,
- 0.0 as perc_cancel,
- 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
- crm_phonecall 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
- ,to_char(c.create_date, 'YYYY-MM-DD'),c.create_date
+ c.duration,
+ c.priority,
+ to_char(c.date_open, 'YYYY-MM-DD'),
+ to_char(c.date_closed, 'YYYY-mm-dd'),
+ c.stage_id,
+ to_char(c.create_date, 'YYYY-MM-DD'),
+ c.create_date
)""")
crm_phonecall_report()
diff --git a/addons/crm/report/crm_phonecall_report_view.xml b/addons/crm/report/crm_phonecall_report_view.xml
index 4e57ba1d474..6202b0ab3ad 100644
--- a/addons/crm/report/crm_phonecall_report_view.xml
+++ b/addons/crm/report/crm_phonecall_report_view.xml
@@ -10,18 +10,22 @@
tree
-
-
-
+
+
+
+
+
-
-
-
+
+
+
+
+
@@ -36,9 +40,9 @@
-
+
-
+
@@ -86,34 +90,25 @@
-
-
+
+
-
+
+
-
-
-
-
-
@@ -122,48 +117,46 @@
-
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
From d4b07711c131ebb796d07886f3cc7ac31b9fb00f Mon Sep 17 00:00:00 2001
From: "nel@tinyerp.com" <>
Date: Mon, 7 Jun 2010 09:24:19 +0200
Subject: [PATCH 04/14] [IMP] leads report
bzr revid: nel@tinyerp.com-20100607072419-h27um4kir4g2z31b
---
.../account/report/account_invoice_report.py | 5 +-
.../report/account_invoice_report_view.xml | 49 +++++++------------
addons/crm/report/crm_lead_report.py | 8 +++
addons/crm/report/crm_lead_report_view.xml | 10 ++--
4 files changed, 38 insertions(+), 34 deletions(-)
diff --git a/addons/account/report/account_invoice_report.py b/addons/account/report/account_invoice_report.py
index 523d77c84e3..1fb90a86bec 100644
--- a/addons/account/report/account_invoice_report.py
+++ b/addons/account/report/account_invoice_report.py
@@ -49,6 +49,7 @@ class account_invoice_report(osv.osv):
'price_total':fields.float('Total Price', readonly=True),
'price_average':fields.float('Average Price', readonly=True),
'nbr':fields.integer('# of Lines', readonly=True),
+ 'reconciled':fields.integer('# reconciled lines', readonly=True),
'type': fields.selection([
('out_invoice','Customer Invoice'),
('in_invoice','Supplier Invoice'),
@@ -62,7 +63,7 @@ class account_invoice_report(osv.osv):
('open','Open'),
('paid','Done'),
('cancel','Cancelled')
- ], 'Order State', readonly=True),
+ ], 'Invoice State', readonly=True),
'date_due': fields.date('Due Date', 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),
@@ -89,6 +90,7 @@ class account_invoice_report(osv.osv):
l.quantity * u.factor
end) as product_qty,
s.partner_id as partner_id,
+ s.reconciled::integer,
s.payment_term as payment_term,
s.period_id as period_id,
u.name as uom_name,
@@ -137,6 +139,7 @@ class account_invoice_report(osv.osv):
l.product_id,
u.name,
l.uos_id,
+ s.reconciled,
s.user_id,
s.state,
s.residual,
diff --git a/addons/account/report/account_invoice_report_view.xml b/addons/account/report/account_invoice_report_view.xml
index 965d5078ae9..a76ccb95f3d 100644
--- a/addons/account/report/account_invoice_report_view.xml
+++ b/addons/account/report/account_invoice_report_view.xml
@@ -20,8 +20,6 @@
-
-
@@ -29,8 +27,11 @@
-
+
+
+
+
@@ -69,31 +70,26 @@
domain="[('date','<=', time.strftime('%%Y-%%m-%%d')), ('date','>',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
help="Invoices during last 7 days"/>
-
+ domain="[('state','in',('draft','open'))]"
+ help = "Draft and Open Invoices"/>
-
-
-
+
+
-
@@ -101,42 +97,35 @@
-
-
-
-
+
+
+
-
-
+
+
-
-
-
-
-
-
-
-
-
+
-
-
+
+
+
+
diff --git a/addons/crm/report/crm_lead_report.py b/addons/crm/report/crm_lead_report.py
index 17ddf5d3024..db9837b5d0c 100644
--- a/addons/crm/report/crm_lead_report.py
+++ b/addons/crm/report/crm_lead_report.py
@@ -93,7 +93,10 @@ class crm_lead_report(osv.osv):
'day': fields.char('Day', size=128, readonly=True),
'email': fields.integer('# of Emails', size=128, readonly=True),
'delay_open': fields.float('Delay to open',digits=(16,2),readonly=True, group_operator="avg",help="Number of Days to open the case"),
+ 'delay_expected': fields.float('Overpassed Deadline',digits=(16,2),readonly=True, group_operator="avg"),
'delay_close': fields.float('Delay to close',digits=(16,2),readonly=True, group_operator="avg",help="Number of Days to close the case"),
+ 'probability': fields.float('Probability',digits=(16,2),readonly=True),
+ 'planned_revenue': fields.float('Planned Revenue',digits=(16,2),readonly=True),
'categ_id': fields.many2one('crm.case.categ', 'Category',\
domain="[('section_id','=',section_id),\
('object_id.model', '=', 'crm.lead')]" , readonly=True),
@@ -132,6 +135,7 @@ class crm_lead_report(osv.osv):
to_char(c.date_closed, 'YYYY-mm-dd') as date_closed,
c.state as state,
c.user_id,
+ c.probability,
c.stage_id,
c.type as type,
c.company_id,
@@ -139,6 +143,7 @@ class crm_lead_report(osv.osv):
c.section_id,
c.categ_id,
c.partner_id,
+ c.planned_revenue,
(select 1) as nbr,
0 as avg_answers,
0.0 as perc_done,
@@ -146,6 +151,7 @@ class crm_lead_report(osv.osv):
(select count(id) from mailgate_message where thread_id=c.id) as email,
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_deadline - c.date_closed)))/(3600*24) as delay_expected,
avg(extract('epoch' from (c.date_open-c.create_date)))/(3600*24) as delay_open
from
crm_lead c
@@ -159,8 +165,10 @@ class crm_lead_report(osv.osv):
c.id,
c.section_id,
c.stage_id,
+ c.probability,
c.categ_id,
c.partner_id,
+ c.planned_revenue,
c.company_id,
c.priority,
c.type,
diff --git a/addons/crm/report/crm_lead_report_view.xml b/addons/crm/report/crm_lead_report_view.xml
index 5dd32fe349d..af5c5aeb7a6 100644
--- a/addons/crm/report/crm_lead_report_view.xml
+++ b/addons/crm/report/crm_lead_report_view.xml
@@ -26,6 +26,8 @@
+
+
@@ -167,12 +169,14 @@
-
-
-
+
+
+
+
+
From 031aca199d401ab41066326122b678a0ca4d8d01 Mon Sep 17 00:00:00 2001
From: "nel@tinyerp.com" <>
Date: Mon, 7 Jun 2010 10:01:33 +0200
Subject: [PATCH 05/14] [IMP] project issue
bzr revid: nel@tinyerp.com-20100607080133-qpl63e1r8hnsgvc1
---
.../project_issue/report/project_issue_report.py | 6 ++++--
.../report/project_issue_report_view.xml | 14 ++++++++------
2 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/addons/project_issue/report/project_issue_report.py b/addons/project_issue/report/project_issue_report.py
index 26ae5252dc8..92f170eb556 100644
--- a/addons/project_issue/report/project_issue_report.py
+++ b/addons/project_issue/report/project_issue_report.py
@@ -51,6 +51,7 @@ class project_issue_report(osv.osv):
_columns = {
'name': fields.char('Year', size=64, required=False, readonly=True),
'user_id':fields.many2one('res.users', 'Responsible', readonly=True),
+ 'user_id2':fields.many2one('res.users', 'Assigned To', readonly=True),
'section_id':fields.many2one('crm.case.section', 'Section', readonly=True),
'state': fields.selection(AVAILABLE_STATES, 'State', size=16, readonly=True),
'avg_answers': fields.function(_get_data, string='Avg. Answers', method=True, type="integer"),
@@ -66,6 +67,7 @@ class project_issue_report(osv.osv):
'day': fields.char('Day', size=128, readonly=True),
'opening_date': fields.date('Opening Date', readonly=True),
'creation_date': fields.date('Creation Date', readonly=True),
+ 'date_closed': fields.date('Closed Date', 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),
@@ -78,8 +80,8 @@ 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')]"),
- 'date_closed': fields.date('Close Date', readonly=True),
+ 'type_id': fields.many2one('crm.case.resource.type', 'Version', domain="[('object_id.model', '=', 'project.issue')]"),
+ 'user_id2losed': fields.date('Close Date', 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),
diff --git a/addons/project_issue/report/project_issue_report_view.xml b/addons/project_issue/report/project_issue_report_view.xml
index 396a892e38c..dd88d419f95 100644
--- a/addons/project_issue/report/project_issue_report_view.xml
+++ b/addons/project_issue/report/project_issue_report_view.xml
@@ -12,7 +12,7 @@
-
+
@@ -91,11 +91,13 @@
-
-
-
+
+
+
+
-
+
From 3d9e53939fcb81c521d12fb9044e81c50a5f4af6 Mon Sep 17 00:00:00 2001
From: "Vir (Open ERP)"
Date: Mon, 7 Jun 2010 14:34:11 +0530
Subject: [PATCH 06/14] [IMP] account_* , document : In view icons are improved
bzr revid: vir@tinyerp.com-20100607090411-w238imu82cz79hza
---
addons/account/account_invoice_view.xml | 22 ++++-----
addons/account/account_view.xml | 8 ++--
addons/account/project/project_view.xml | 8 ++--
.../report/account_account_report_view.xml | 16 +++----
.../account_analytic_entries_report_view.xml | 30 ++++++------
.../report/account_analytic_report_view.xml | 38 +++++++--------
.../report/account_entries_report_view.xml | 40 ++++++++--------
.../report/account_invoice_report_view.xml | 48 +++++++++----------
addons/account/report/account_report_view.xml | 8 ++--
.../crossovered_budget_view.xml | 4 +-
addons/account_voucher/voucher_view.xml | 30 ++++++------
addons/document/document_view.xml | 10 ++--
.../document/report/document_report_view.xml | 4 +-
.../mrp/report/mrp_production_order_view.xml | 2 +-
14 files changed, 134 insertions(+), 134 deletions(-)
diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml
index 4c4a3f3a9ef..aa4ccfc74ff 100644
--- a/addons/account/account_invoice_view.xml
+++ b/addons/account/account_invoice_view.xml
@@ -346,9 +346,9 @@
-
-
-
+
+
+
@@ -357,16 +357,16 @@
-
-
-
+
+
+
-
-
-
+
+
+
-
-
+
+
diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml
index 5e8edd306e3..ca777ea61ae 100644
--- a/addons/account/account_view.xml
+++ b/addons/account/account_view.xml
@@ -836,8 +836,8 @@
-
-
+
+
@@ -979,8 +979,8 @@
-
-
+
+
diff --git a/addons/account/project/project_view.xml b/addons/account/project/project_view.xml
index b4a7b67a05a..363eeec138b 100644
--- a/addons/account/project/project_view.xml
+++ b/addons/account/project/project_view.xml
@@ -25,8 +25,8 @@
-
-
+
+
@@ -396,8 +396,8 @@
-
-
+
+
diff --git a/addons/account/report/account_account_report_view.xml b/addons/account/report/account_account_report_view.xml
index 137fa0c69ae..f233d0e905b 100644
--- a/addons/account/report/account_account_report_view.xml
+++ b/addons/account/report/account_account_report_view.xml
@@ -56,15 +56,15 @@
-
-
-
-
+
+
+
+
-
-
-
-
+
+
+
+
diff --git a/addons/account/report/account_analytic_entries_report_view.xml b/addons/account/report/account_analytic_entries_report_view.xml
index 82a063256c1..8344abf4628 100644
--- a/addons/account/report/account_analytic_entries_report_view.xml
+++ b/addons/account/report/account_analytic_entries_report_view.xml
@@ -35,14 +35,14 @@
-
-
-
-
-
-
-
+
+
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
diff --git a/addons/account/report/account_analytic_report_view.xml b/addons/account/report/account_analytic_report_view.xml
index f853b809867..290e6950569 100644
--- a/addons/account/report/account_analytic_report_view.xml
+++ b/addons/account/report/account_analytic_report_view.xml
@@ -36,26 +36,26 @@
-
-
-
-
-
-
@@ -63,28 +63,28 @@
-
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
diff --git a/addons/account/report/account_entries_report_view.xml b/addons/account/report/account_entries_report_view.xml
index 5d1b99b578e..0c3a77db2a7 100644
--- a/addons/account/report/account_entries_report_view.xml
+++ b/addons/account/report/account_entries_report_view.xml
@@ -50,25 +50,25 @@
-
-
-
@@ -78,24 +78,24 @@
-
-
-
-
+
+
+
+
-
-
-
-
+
+
+
+
-
-
-
-
+
+
+
+
-
-
-
+
+
+
diff --git a/addons/account/report/account_invoice_report_view.xml b/addons/account/report/account_invoice_report_view.xml
index 965d5078ae9..416b340b89c 100644
--- a/addons/account/report/account_invoice_report_view.xml
+++ b/addons/account/report/account_invoice_report_view.xml
@@ -56,39 +56,39 @@
-
-
-
-
@@ -96,26 +96,26 @@
-
-
-
-
+
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
diff --git a/addons/account/report/account_report_view.xml b/addons/account/report/account_report_view.xml
index 9b1688730aa..190ff856c8a 100644
--- a/addons/account/report/account_report_view.xml
+++ b/addons/account/report/account_report_view.xml
@@ -153,8 +153,8 @@
search
-
-
+
+
@@ -221,8 +221,8 @@
search
-
-
+
+
diff --git a/addons/account_budget/crossovered_budget_view.xml b/addons/account_budget/crossovered_budget_view.xml
index b48ccc55daa..e7a0faf069d 100644
--- a/addons/account_budget/crossovered_budget_view.xml
+++ b/addons/account_budget/crossovered_budget_view.xml
@@ -185,8 +185,8 @@
-
-
+
+
diff --git a/addons/account_voucher/voucher_view.xml b/addons/account_voucher/voucher_view.xml
index 6eb6988480d..0049c5ff5de 100644
--- a/addons/account_voucher/voucher_view.xml
+++ b/addons/account_voucher/voucher_view.xml
@@ -71,7 +71,7 @@
-
+
account.voucher.select
account.voucher
@@ -79,10 +79,10 @@
-
-
-
-
+
+
+
+
@@ -92,14 +92,14 @@
-
-
-
-
-
+
+
+
+
+
-
+
@@ -107,7 +107,7 @@
-
+
Voucher Entries
@@ -245,7 +245,7 @@
-
+
account.journal.form.inherit
account.journal
@@ -257,7 +257,7 @@
-
+
-
+
diff --git a/addons/document/document_view.xml b/addons/document/document_view.xml
index fd424ad7d52..0bab191d942 100644
--- a/addons/document/document_view.xml
+++ b/addons/document/document_view.xml
@@ -234,22 +234,22 @@
search
-
-
-
-
+
-
+
diff --git a/addons/document/report/document_report_view.xml b/addons/document/report/document_report_view.xml
index 4afc66fb4d7..00743d768e7 100644
--- a/addons/document/report/document_report_view.xml
+++ b/addons/document/report/document_report_view.xml
@@ -41,8 +41,8 @@
-
-
+
+
diff --git a/addons/mrp/report/mrp_production_order_view.xml b/addons/mrp/report/mrp_production_order_view.xml
index 55957619e31..fdd201380d0 100644
--- a/addons/mrp/report/mrp_production_order_view.xml
+++ b/addons/mrp/report/mrp_production_order_view.xml
@@ -81,7 +81,7 @@
-
+
From 1d99d0277f1b49845196e830b26c4fb382d83c00 Mon Sep 17 00:00:00 2001
From: "nel@tinyerp.com" <>
Date: Mon, 7 Jun 2010 11:04:43 +0200
Subject: [PATCH 07/14] [IMP] hr_expense, project_issue
bzr revid: nel@tinyerp.com-20100607090443-w7rqzhhs3c8h6qq6
---
addons/hr_expense/report/hr_expense_report.py | 14 ++--
.../report/hr_expense_report_view.xml | 67 ++++++++++---------
.../report/project_issue_report_view.xml | 4 +-
3 files changed, 45 insertions(+), 40 deletions(-)
diff --git a/addons/hr_expense/report/hr_expense_report.py b/addons/hr_expense/report/hr_expense_report.py
index 2b0f6b4addf..85fa541ec10 100644
--- a/addons/hr_expense/report/hr_expense_report.py
+++ b/addons/hr_expense/report/hr_expense_report.py
@@ -29,7 +29,7 @@ class hr_expense_report(osv.osv):
_auto = False
_rec_name = 'date'
_columns = {
- 'date': fields.date('Date', readonly=True),
+ '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'),
@@ -44,9 +44,11 @@ class hr_expense_report(osv.osv):
'invoice_id': fields.many2one('account.invoice', 'Invoice',readonly=True),
'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),
+ 'user_id':fields.many2one('res.users', 'Validation User', readonly=True),
'currency_id': fields.many2one('res.currency', 'Currency', readonly=True),
'price_total':fields.float('Total Price', readonly=True),
+ 'delay_valid':fields.float('Delay Valid', readonly=True),
+ 'delay_confirm':fields.float('Delay Confirm', 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),
@@ -75,20 +77,22 @@ class hr_expense_report(osv.osv):
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,
+ s.user_valid as user_id,
s.department_id,
to_char(date_trunc('day',s.create_date), 'YYYY') as year,
to_char(date_trunc('day',s.create_date), 'MM') as month,
to_char(date_trunc('day',s.create_date), 'YYYY-MM-DD') as day,
+ avg(extract('epoch' from age(s.date_valid,s.date)))/(3600*24) as delay_valid,
+ avg(extract('epoch' from age(s.date_valid,s.date_confirm)))/(3600*24) as delay_confirm,
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,
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,
- (select count(analytic_account) from hr_expense_line where id=l.id and analytic_account is not null) as no_of_account,
+ (select 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)
@@ -104,10 +108,10 @@ class hr_expense_report(osv.osv):
l.analytic_account,
s.invoice_id,
s.currency_id,
+ s.user_valid,
s.department_id,
l.uom_id,
l.id,
- s.user_id,
s.state,
s.journal_id,
s.company_id,
diff --git a/addons/hr_expense/report/hr_expense_report_view.xml b/addons/hr_expense/report/hr_expense_report_view.xml
index a4aa15e7076..bcc560573ab 100644
--- a/addons/hr_expense/report/hr_expense_report_view.xml
+++ b/addons/hr_expense/report/hr_expense_report_view.xml
@@ -9,7 +9,6 @@
-
@@ -21,12 +20,13 @@
+
-
+
+
-
@@ -37,7 +37,7 @@
graph
-
+
@@ -76,48 +76,49 @@
icon="terp-camera_test"
domain="[('state','=','accepted')]"
help = "Accepted Expenses"/>
+
-
-
-
-
-
+
-
-
-
-
-
-
-
+
+
-
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
@@ -128,7 +129,7 @@
hr.expense.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':[]}
diff --git a/addons/project_issue/report/project_issue_report_view.xml b/addons/project_issue/report/project_issue_report_view.xml
index dd88d419f95..b4d0af02185 100644
--- a/addons/project_issue/report/project_issue_report_view.xml
+++ b/addons/project_issue/report/project_issue_report_view.xml
@@ -90,7 +90,7 @@
-
+
project.issue.report
form
graph,tree
- {'search_default_This Month':1,'search_default_project_id':1,'group_by_no_leaf':1,'group_by':[]}
+ {'search_default_This Month':1,'search_default_project':1,'group_by_no_leaf':1,'group_by':[]}
From 3621f203748323942fff352104481a0c62c30667 Mon Sep 17 00:00:00 2001
From: "nel@tinyerp.com" <>
Date: Mon, 7 Jun 2010 12:49:21 +0200
Subject: [PATCH 08/14] [IMP] Timesheet
bzr revid: nel@tinyerp.com-20100607104921-o0n8qctydiqegyvf
---
.../report/timesheet_report.py | 27 ++++++++-
.../report/timesheet_report_view.xml | 57 +++++++++----------
2 files changed, 51 insertions(+), 33 deletions(-)
diff --git a/addons/hr_timesheet_sheet/report/timesheet_report.py b/addons/hr_timesheet_sheet/report/timesheet_report.py
index 3dd8d161c5f..a8c0440a053 100644
--- a/addons/hr_timesheet_sheet/report/timesheet_report.py
+++ b/addons/hr_timesheet_sheet/report/timesheet_report.py
@@ -39,6 +39,9 @@ class timesheet_report(osv.osv):
'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),
+ 'total_diff': fields.float('#Total Diff',readonly=True),
+ 'total_timesheet': fields.float('#Total Timesheet',readonly=True),
+ 'total_attendance': fields.float('#Total Attendance',readonly=True),
'company_id': fields.many2one('res.company', 'Company',readonly=True),
'department_id':fields.many2one('hr.department','Department',readonly=True),
'date_from': fields.date('Date from',readonly=True,),
@@ -67,10 +70,25 @@ 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(aal.unit_amount) as quantity,
- sum(aal.amount) as cost,
+ aal.unit_amount as quantity,
+ aal.amount as cost,
aal.account_id,
aal.product_id,
+ (SELECT sum(day.total_difference)
+ FROM hr_timesheet_sheet_sheet AS sheet
+ LEFT JOIN hr_timesheet_sheet_sheet_day AS day
+ ON (sheet.id = day.sheet_id
+ AND day.name = sheet.date_current) where sheet.id=htss.id) as total_diff,
+ (SELECT sum(day.total_timesheet)
+ FROM hr_timesheet_sheet_sheet AS sheet
+ LEFT JOIN hr_timesheet_sheet_sheet_day AS day
+ ON (sheet.id = day.sheet_id
+ AND day.name = sheet.date_current) where sheet.id=htss.id) as total_timesheet,
+ (SELECT sum(day.total_attendance)
+ FROM hr_timesheet_sheet_sheet AS sheet
+ LEFT JOIN hr_timesheet_sheet_sheet_day AS day
+ ON (sheet.id = day.sheet_id
+ AND day.name = sheet.date_current) where sheet.id=htss.id) as total_attendance,
aal.to_invoice,
aal.general_account_id,
htss.user_id,
@@ -87,6 +105,8 @@ class timesheet_report(osv.osv):
aal.account_id,
htss.date_from,
htss.date_to,
+ aal.unit_amount,
+ aal.amount,
htss.date_current,
aal.to_invoice,
aal.product_id,
@@ -94,8 +114,9 @@ class timesheet_report(osv.osv):
htss.name,
htss.company_id,
htss.state,
+ htss.id,
htss.department_id,
htss.user_id
)
""")
-timesheet_report()
\ No newline at end of file
+timesheet_report()
diff --git a/addons/hr_timesheet_sheet/report/timesheet_report_view.xml b/addons/hr_timesheet_sheet/report/timesheet_report_view.xml
index 0cba7ad179b..51e6b5d295c 100644
--- a/addons/hr_timesheet_sheet/report/timesheet_report_view.xml
+++ b/addons/hr_timesheet_sheet/report/timesheet_report_view.xml
@@ -24,8 +24,6 @@
-
-
@@ -36,6 +34,11 @@
+
+
+
+
+
@@ -65,52 +68,46 @@
+
-
-
-
-
-
+
+
-
-
+
+
+
+
+
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
@@ -121,7 +118,7 @@
timesheet.report
form
tree,graph
- {'search_default_month':1,'search_default_User':1,'search_default_user_id':uid,'group_by_no_leaf':1,'group_by':[]}
+ {'search_default_month':1,'search_default_User_id':1,'group_by_no_leaf':1,'group_by':[]}
From cce45bf40a1ae5318f9382791a6d3de3723d74bc Mon Sep 17 00:00:00 2001
From: "Vir (Open ERP)"
Date: Mon, 7 Jun 2010 18:05:16 +0530
Subject: [PATCH 09/14] [IMP] crm_*, email_template, account : Icons are
modified, new icon images added
bzr revid: vir@tinyerp.com-20100607123516-w4oim055l852utgn
---
.../report/account_account_report_view.xml | 4 +-
.../account_analytic_entries_report_view.xml | 2 +-
addons/base_calendar/base_calendar_view.xml | 32 +++++------
addons/crm/crm_lead_view.xml | 34 +++++------
addons/crm/crm_meeting_view.xml | 16 +++---
addons/crm/crm_opportunity_view.xml | 26 ++++-----
addons/crm/crm_phonecall_view.xml | 24 ++++----
addons/crm/crm_report_view.xml | 16 +++---
addons/crm/report/crm_lead_report_view.xml | 26 ++++-----
.../crm/report/crm_phonecall_report_view.xml | 26 ++++-----
addons/crm_claim/crm_claim_view.xml | 14 ++---
.../report/crm_claim_report_view.xml | 48 ++++++++--------
.../crm_fundraising/crm_fundraising_view.xml | 18 +++---
.../report/crm_fundraising_report_view.xml | 41 +++++++-------
addons/crm_helpdesk/crm_helpdesk_view.xml | 14 ++---
.../report/crm_helpdesk_report_view.xml | 56 +++++++------------
.../email_template_mailbox_view.xml | 12 ++--
17 files changed, 196 insertions(+), 213 deletions(-)
diff --git a/addons/account/report/account_account_report_view.xml b/addons/account/report/account_account_report_view.xml
index f233d0e905b..bd9101a3382 100644
--- a/addons/account/report/account_account_report_view.xml
+++ b/addons/account/report/account_account_report_view.xml
@@ -45,10 +45,10 @@
-
-
diff --git a/addons/account/report/account_analytic_entries_report_view.xml b/addons/account/report/account_analytic_entries_report_view.xml
index 8344abf4628..1564859540a 100644
--- a/addons/account/report/account_analytic_entries_report_view.xml
+++ b/addons/account/report/account_analytic_entries_report_view.xml
@@ -50,7 +50,7 @@
-
+
diff --git a/addons/base_calendar/base_calendar_view.xml b/addons/base_calendar/base_calendar_view.xml
index fc5140c8303..d0c1a57ba84 100644
--- a/addons/base_calendar/base_calendar_view.xml
+++ b/addons/base_calendar/base_calendar_view.xml
@@ -95,10 +95,10 @@
search
-
-
@@ -108,19 +108,19 @@
-
-
+
-
-
-
-
-
+
@@ -383,7 +383,7 @@
-
@@ -396,15 +396,15 @@
-
-
+
-
-
-
diff --git a/addons/crm/crm_lead_view.xml b/addons/crm/crm_lead_view.xml
index dbfbeedf0a8..465c63ae626 100644
--- a/addons/crm/crm_lead_view.xml
+++ b/addons/crm/crm_lead_view.xml
@@ -50,7 +50,7 @@
name="convert_opportunity"
string="Convert"
help="Convert to Opportunity"
- icon="gtk-index"
+ icon="gtk-index"
type="object"/>
search
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
-
-
-
+
+
+
-
diff --git a/addons/crm/crm_meeting_view.xml b/addons/crm/crm_meeting_view.xml
index e2decc30340..cd3b7866a89 100644
--- a/addons/crm/crm_meeting_view.xml
+++ b/addons/crm/crm_meeting_view.xml
@@ -263,32 +263,32 @@
-
-
-
-
+
-
-
-
-
diff --git a/addons/crm/crm_opportunity_view.xml b/addons/crm/crm_opportunity_view.xml
index 407c3c53cf4..eadc4158d69 100644
--- a/addons/crm/crm_opportunity_view.xml
+++ b/addons/crm/crm_opportunity_view.xml
@@ -275,21 +275,21 @@
search
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/addons/crm/crm_phonecall_view.xml b/addons/crm/crm_phonecall_view.xml
index c5813a38b09..db8adda789c 100644
--- a/addons/crm/crm_phonecall_view.xml
+++ b/addons/crm/crm_phonecall_view.xml
@@ -136,7 +136,7 @@
-
+
@@ -196,9 +196,9 @@
-
+
-
+
CRM - Inbound Phone Calls Tree
crm.phonecall
@@ -247,12 +247,12 @@
search
-
-
-
-
-
-
-
-
-
+
diff --git a/addons/crm/crm_report_view.xml b/addons/crm/crm_report_view.xml
index 2992959bdd0..ee5a6ac35f4 100644
--- a/addons/crm/crm_report_view.xml
+++ b/addons/crm/crm_report_view.xml
@@ -70,10 +70,10 @@
-
-
@@ -162,10 +162,10 @@
-
-
@@ -237,10 +237,10 @@
-
-
@@ -330,10 +330,10 @@
-
-
diff --git a/addons/crm/report/crm_lead_report_view.xml b/addons/crm/report/crm_lead_report_view.xml
index af5c5aeb7a6..f6ac9238b3c 100644
--- a/addons/crm/report/crm_lead_report_view.xml
+++ b/addons/crm/report/crm_lead_report_view.xml
@@ -76,17 +76,17 @@
-
-
-
-
-
@@ -100,16 +100,16 @@
help="My section" />
-
+
-
-
+
-
-
-
-
-
diff --git a/addons/crm/report/crm_phonecall_report_view.xml b/addons/crm/report/crm_phonecall_report_view.xml
index 6202b0ab3ad..ddc50460e31 100644
--- a/addons/crm/report/crm_phonecall_report_view.xml
+++ b/addons/crm/report/crm_phonecall_report_view.xml
@@ -77,25 +77,25 @@
-
-
-
-
-
-
@@ -104,7 +104,7 @@
context="{'group_by':'stage_id'}" />
-
@@ -114,8 +114,8 @@
-
-
+
@@ -132,15 +132,15 @@
-
-
-
-
diff --git a/addons/crm_claim/crm_claim_view.xml b/addons/crm_claim/crm_claim_view.xml
index 2b3f883024c..61cf7c6368d 100644
--- a/addons/crm_claim/crm_claim_view.xml
+++ b/addons/crm_claim/crm_claim_view.xml
@@ -258,16 +258,16 @@
search
-
-
-
-
-
-
+
-
diff --git a/addons/crm_claim/report/crm_claim_report_view.xml b/addons/crm_claim/report/crm_claim_report_view.xml
index ca6fdb95277..7892039436c 100644
--- a/addons/crm_claim/report/crm_claim_report_view.xml
+++ b/addons/crm_claim/report/crm_claim_report_view.xml
@@ -77,25 +77,25 @@
-
-
-
-
-
-
@@ -105,69 +105,69 @@
widget="selection"
context="{'invisible_section': False}">
-
-
-
+
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/addons/crm_fundraising/crm_fundraising_view.xml b/addons/crm_fundraising/crm_fundraising_view.xml
index 6853da7c89a..9ef1c936be4 100644
--- a/addons/crm_fundraising/crm_fundraising_view.xml
+++ b/addons/crm_fundraising/crm_fundraising_view.xml
@@ -269,13 +269,13 @@
-
-
-
@@ -285,26 +285,26 @@
string="Fund Description" />
-
-
-
-
+
-
-
diff --git a/addons/crm_fundraising/report/crm_fundraising_report_view.xml b/addons/crm_fundraising/report/crm_fundraising_report_view.xml
index 20e8ef68b6b..6e27fc8390d 100644
--- a/addons/crm_fundraising/report/crm_fundraising_report_view.xml
+++ b/addons/crm_fundraising/report/crm_fundraising_report_view.xml
@@ -76,25 +76,25 @@
-
-
-
-
-
-
@@ -104,60 +104,61 @@
widget="selection"
context="{'invisible_section': False}">
-
-
-
+
-
-
+
+
-
-
-
-
-
-
-
-
-
diff --git a/addons/crm_helpdesk/crm_helpdesk_view.xml b/addons/crm_helpdesk/crm_helpdesk_view.xml
index 451f6c7119e..57e7bba0199 100644
--- a/addons/crm_helpdesk/crm_helpdesk_view.xml
+++ b/addons/crm_helpdesk/crm_helpdesk_view.xml
@@ -234,12 +234,12 @@
search
-
-
-
-
-
+
-
-
diff --git a/addons/crm_helpdesk/report/crm_helpdesk_report_view.xml b/addons/crm_helpdesk/report/crm_helpdesk_report_view.xml
index f564bb38d4d..c6875e21a4a 100644
--- a/addons/crm_helpdesk/report/crm_helpdesk_report_view.xml
+++ b/addons/crm_helpdesk/report/crm_helpdesk_report_view.xml
@@ -71,25 +71,25 @@
-
-
-
-
-
-
@@ -98,14 +98,14 @@
widget="selection"
context="{'invisible_section': False}">
-
-
@@ -114,59 +114,41 @@
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
+
diff --git a/addons/email_template/email_template_mailbox_view.xml b/addons/email_template/email_template_mailbox_view.xml
index e6ff86d1087..36852db16df 100755
--- a/addons/email_template/email_template_mailbox_view.xml
+++ b/addons/email_template/email_template_mailbox_view.xml
@@ -129,14 +129,14 @@
search
-
-
+
+
-
-
+
+
-
-
+
+
From cd442ab8b7541be6738127b0beb9133999e5520e Mon Sep 17 00:00:00 2001
From: "Vir (Open ERP)"
Date: Mon, 7 Jun 2010 18:17:17 +0530
Subject: [PATCH 10/14] [MOD] Small change in icons
bzr revid: vir@tinyerp.com-20100607124717-nyblksbsbdv0yzhq
---
addons/account/report/account_invoice_report_view.xml | 2 +-
addons/email_template/email_template_mailbox_view.xml | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/addons/account/report/account_invoice_report_view.xml b/addons/account/report/account_invoice_report_view.xml
index 21e960aee26..542b695e7dd 100644
--- a/addons/account/report/account_invoice_report_view.xml
+++ b/addons/account/report/account_invoice_report_view.xml
@@ -95,7 +95,7 @@
-
+
diff --git a/addons/email_template/email_template_mailbox_view.xml b/addons/email_template/email_template_mailbox_view.xml
index 36852db16df..f94fa886ee6 100755
--- a/addons/email_template/email_template_mailbox_view.xml
+++ b/addons/email_template/email_template_mailbox_view.xml
@@ -130,10 +130,10 @@
-
+
-
+
From b5ed5d2ccad62da30eb92e76c8f43611dfc232fd Mon Sep 17 00:00:00 2001
From: "nel@tinyerp.com" <>
Date: Mon, 7 Jun 2010 16:26:20 +0200
Subject: [PATCH 11/14] [FIX] stock: split production lots
bzr revid: nel@tinyerp.com-20100607142620-26gm67x3n6bs4rlw
---
addons/stock/wizard/stock_move.py | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/addons/stock/wizard/stock_move.py b/addons/stock/wizard/stock_move.py
index 00b7b616aa5..aa7bb42cf8b 100644
--- a/addons/stock/wizard/stock_move.py
+++ b/addons/stock/wizard/stock_move.py
@@ -258,7 +258,7 @@ class split_in_production_lot(osv.osv_memory):
quantity_rest -= quantity
uos_qty = quantity / move_qty * move.product_uos_qty
uos_qty_rest = quantity_rest / move_qty * move.product_uos_qty
- if quantity_rest <= 0:
+ if quantity_rest < 0:
quantity_rest = quantity
break
default_val = {
@@ -266,8 +266,11 @@ class split_in_production_lot(osv.osv_memory):
'product_uos_qty': uos_qty,
'state': move.state
}
- current_move = move_obj.copy(cr, uid, move.id, default_val)
- new_move.append(current_move)
+ if quantity_rest > 0:
+ current_move = move_obj.copy(cr, uid, move.id, default_val)
+ new_move.append(current_move)
+ if quantity_rest == 0:
+ current_move = move.id
prodlot_id = False
if line.use_exist and line.name:
prodlot_id = prodlot_obj.search(cr, uid, [('prefix','=',line.name),('product_id','=',data.product_id.id)])
From e93e319baf5a11eb6fcc0f4c5bbf6efbe8761ceb Mon Sep 17 00:00:00 2001
From: "Jay (Open ERP)"
Date: Mon, 7 Jun 2010 20:02:47 +0530
Subject: [PATCH 12/14] [REF] Project_issue : Minor modifs
bzr revid: jvo@tinyerp.com-20100607143247-493hisj7hsib90i4
---
addons/project_issue/project_issue.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/addons/project_issue/project_issue.py b/addons/project_issue/project_issue.py
index ecc42a00be2..92f671aa82e 100644
--- a/addons/project_issue/project_issue.py
+++ b/addons/project_issue/project_issue.py
@@ -76,6 +76,7 @@ class project_issue(osv.osv, crm.crm_case):
date_open = datetime.strptime(issue.date_open, "%Y-%m-%d %H:%M:%S")
ans = date_open - date_create
date_until = issue.date_open
+ #Calculating no. of working hours to open the issue
hours = cal_obj.interval_hours_get(cr, uid, issue.project_id.resource_calendar_id.id,
mx.DateTime.strptime(issue.create_date, '%Y-%m-%d %H:%M:%S'),
mx.DateTime.strptime(issue.date_open, '%Y-%m-%d %H:%M:%S'))
@@ -85,6 +86,7 @@ class project_issue(osv.osv, crm.crm_case):
date_close = datetime.strptime(issue.date_closed, "%Y-%m-%d %H:%M:%S")
date_until = issue.date_closed
ans = date_close - date_create
+ #Calculating no. of working hours to close the issue
hours = cal_obj.interval_hours_get(cr, uid, issue.project_id.resource_calendar_id.id,
mx.DateTime.strptime(issue.create_date, '%Y-%m-%d %H:%M:%S'),
mx.DateTime.strptime(issue.date_closed, '%Y-%m-%d %H:%M:%S'))
From 00c072a4a8271fd0324a75ae34f15abc79710401 Mon Sep 17 00:00:00 2001
From: "nel@tinyerp.com" <>
Date: Mon, 7 Jun 2010 20:42:14 +0200
Subject: [PATCH 13/14] [IMP] make sequence on supplier visible and use
sequences for PO
bzr revid: nel@tinyerp.com-20100607184214-5u3171l0foqvnjsm
---
addons/mrp_procurement/mrp_procurement.py | 9 ++++++---
addons/product/product.py | 3 ++-
addons/product/product_view.xml | 4 ++--
addons/purchase/purchase.py | 12 +++++++-----
.../wizard/purchase_requisition_partner.py | 12 ++++++------
5 files changed, 23 insertions(+), 17 deletions(-)
diff --git a/addons/mrp_procurement/mrp_procurement.py b/addons/mrp_procurement/mrp_procurement.py
index 1f974318ee3..bb18326af07 100644
--- a/addons/mrp_procurement/mrp_procurement.py
+++ b/addons/mrp_procurement/mrp_procurement.py
@@ -262,8 +262,9 @@ class mrp_procurement(osv.osv):
user = self.pool.get('res.users').browse(cr, uid, uid)
for procurement in self.browse(cr, uid, ids):
if procurement.product_id.product_tmpl_id.supply_method <> 'produce':
- if procurement.product_id.seller_ids:
- partner = procurement.product_id.seller_ids[0].name
+ partner_list = sorted([(partner_id.sequence, partner_id) for partner_id in procurement.product_id.seller_ids if partner_id])
+ if partner_list:
+ partner = partner_list and partner_list[0] and partner_list[0][1] and partner_list[0][1].name or False
if user.company_id and user.company_id.partner_id:
if partner.id == user.company_id.partner_id.id:
return True
@@ -288,7 +289,9 @@ class mrp_procurement(osv.osv):
if not procurement.product_id.seller_ids:
cr.execute('update mrp_procurement set message=%s where id=%s', (_('No supplier defined for this product !'), procurement.id))
return False
- partner = procurement.product_id.seller_ids[0].name
+ partner_list = sorted([(partner_id.sequence, partner_id) for partner_id in procurement.product_id.seller_ids if partner_id and partner_id.sequence])
+ partner = partner_list and partner_list[0] and partner_list[0][1] and partner_list[0][1].name or False
+
if user.company_id and user.company_id.partner_id:
if partner.id == user.company_id.partner_id.id:
return False
diff --git a/addons/product/product.py b/addons/product/product.py
index aaa369cdfcf..eddbd992874 100644
--- a/addons/product/product.py
+++ b/addons/product/product.py
@@ -245,7 +245,8 @@ class product_template(osv.osv):
result = {}
for product in self.browse(cr, uid, ids, context):
if product.seller_ids:
- result[product.id] = product.seller_ids[0].delay
+ partner_list = sorted([(partner_id.sequence, partner_id) for partner_id in product.seller_ids if partner_id and partner_id.sequence])
+ result[product.id] = partner_list and partner_list[0] and partner_list[0][1] and partner_list[0][1].delay or False
else:
result[product.id] = 1
return result
diff --git a/addons/product/product_view.xml b/addons/product/product_view.xml
index 11ed4bfba65..9f13467c4cb 100644
--- a/addons/product/product_view.xml
+++ b/addons/product/product_view.xml
@@ -426,7 +426,7 @@