diff --git a/addons/crm/crm.py b/addons/crm/crm.py
index 6513ca19a32..06cdf8389cc 100644
--- a/addons/crm/crm.py
+++ b/addons/crm/crm.py
@@ -379,7 +379,7 @@ class crm_case(osv.osv):
'priority': lambda *a: AVAILABLE_PRIORITIES[2][0],
'date': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'),
}
- _order = 'priority, date_deadline desc, id desc'
+ _order = 'priority, date_deadline desc, date desc,id desc'
def _action(self, cr, uid, cases, state_to, scrit=None, context={}):
if not scrit:
diff --git a/addons/report_purchase/report_purchase.py b/addons/report_purchase/report_purchase.py
index 947cbd31f34..591e9b43ebf 100644
--- a/addons/report_purchase/report_purchase.py
+++ b/addons/report_purchase/report_purchase.py
@@ -72,6 +72,7 @@ class report_purchase_order_product(osv.osv):
from purchase_order s
left join purchase_order_line l on (s.id=l.order_id)
left join product_uom u on (u.id=l.product_uom)
+ where l.product_id is not null
group by l.product_id, to_char(s.date_order, 'YYYY-MM-01'),s.state
)
""")
@@ -117,6 +118,7 @@ class report_purchase_order_category(osv.osv):
left join product_product p on (p.id=l.product_id)
left join product_template t on (t.id=p.product_tmpl_id)
left join product_uom u on (u.id=l.product_uom)
+ where l.product_id is not null
group by t.categ_id, to_char(s.date_order, 'YYYY-MM-01'),s.state
)
""")
diff --git a/addons/report_sale/report_sale_view.xml b/addons/report_sale/report_sale_view.xml
index f68e7cd28f7..52e50f95027 100644
--- a/addons/report_sale/report_sale_view.xml
+++ b/addons/report_sale/report_sale_view.xml
@@ -37,12 +37,24 @@
+
+
+ report.sale.order.product.graph
+ report.sale.order.product
+ graph
+
+
+
+
+
+
+
Sales by Product (this month)
report.sale.order.product
form
- tree
+ graph,tree
[('name','=',time.strftime('%Y-%m-01'))]
@@ -50,7 +62,7 @@
Sales by Product
report.sale.order.product
form
- tree
+ graph,tree
@@ -105,7 +117,7 @@
Sales by Category of Product (this month)
report.sale.order.category
form
- tree
+ graph,tree
[('name','=',time.strftime('%Y-%m-01'))]
@@ -113,16 +125,27 @@
Sales by Category of Products
report.sale.order.category
form
- tree,graph
+ graph,tree
+
+ sale.order.graph
+ sale.order
+ graph
+
+
+
+
+
+
+
Sales of the Month
sale.order
form
- tree,form
+ graph,tree,form
[('date_order','>=',time.strftime('%Y-%m-01')),('state','<>','draft'),('state','<>','cancel')]
@@ -131,4 +154,4 @@
-
\ No newline at end of file
+