diff --git a/addons/purchase/report/purchase_report.py b/addons/purchase/report/purchase_report.py
index f447fd598f9..f5338e93723 100644
--- a/addons/purchase/report/purchase_report.py
+++ b/addons/purchase/report/purchase_report.py
@@ -43,9 +43,15 @@ class report_purchase_order(osv.osv):
('done','Done'),
('cancel','Cancel')
], 'Order State', readonly=True),
+ 'invoice_method': fields.selection([
+ ('manual','Manual'),
+ ('order','From Order'),
+ ('picking','From Picking')
+ ],'Invoicing Control', readonly=True),
'product_id':fields.many2one('product.product', 'Product', readonly=True),
'warehouse_id': fields.many2one('stock.warehouse', 'Warehouse', readonly=True),
- 'category_id': fields.many2one('product.category', 'Categories', readonly=True),
+ '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),
'company_id':fields.many2one('res.company', 'Company', readonly=True),
'user_id':fields.many2one('res.users', 'Responsible', readonly=True),
@@ -70,24 +76,24 @@ class report_purchase_order(osv.osv):
s.state,
s.warehouse_id as warehouse_id,
s.partner_id as partner_id,
+ s.fiscal_position,
s.create_uid as user_id,
s.company_id as company_id,
+ s.invoice_method,
l.product_id,
- t.categ_id as category_id,
+ s.location_id as location_id,
sum(l.product_qty*u.factor) as quantity,
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
from purchase_order s
left join purchase_order_line l on (s.id=l.order_id)
- 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 s.company_id,s.create_uid,s.partner_id,
- t.categ_id,l.product_id,s.date_order,
+ s.location_id,l.product_id,s.date_order,
to_char(s.date_order, 'YYYY'),to_char(s.date_order, 'MM'),s.state,
- s.warehouse_id
+ s.warehouse_id,s.fiscal_position,s.invoice_method
)
""")
report_purchase_order()
diff --git a/addons/purchase/report/purchase_report_view.xml b/addons/purchase/report/purchase_report_view.xml
index 19f13755083..5fe1330dcae 100644
--- a/addons/purchase/report/purchase_report_view.xml
+++ b/addons/purchase/report/purchase_report_view.xml
@@ -33,6 +33,8 @@
+
+
@@ -72,16 +74,32 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
@@ -95,6 +113,7 @@
form
tree,graph
+ {'search_default_user_id':True}
diff --git a/addons/sale/report/sale_report.py b/addons/sale/report/sale_report.py
index 9ca34fc2d3d..77cdb4d4cc3 100644
--- a/addons/sale/report/sale_report.py
+++ b/addons/sale/report/sale_report.py
@@ -39,6 +39,8 @@ class sale_report(osv.osv):
'partner_id':fields.many2one('res.partner', 'Partner', readonly=True),
'shop_id':fields.many2one('sale.shop', 'Shop', readonly=True),
'company_id':fields.many2one('res.company', 'Company', readonly=True),
+ 'payment_term': fields.many2one('account.payment.term', 'Payment Term',readonly=True),
+ 'fiscal_position': fields.many2one('account.fiscal.position', 'Fiscal Position',readonly=True),
'user_id':fields.many2one('res.users', 'Salesman', readonly=True),
'price_total':fields.float('Total Price', readonly=True),
'delay':fields.float('Avg Closing Days', digits=(16,2), readonly=True),
@@ -70,6 +72,8 @@ class sale_report(osv.osv):
s.partner_id as partner_id,
s.user_id as user_id,
s.shop_id as shop_id,
+ s.fiscal_position as fiscal_position,
+ s.payment_term as payment_term,
s.company_id as company_id,
extract(epoch from avg(s.date_confirm-s.create_date))/(24*60*60)::decimal(16,2) as delay,
sum(l.product_uom_qty*l.price_unit) as price_total,
@@ -84,7 +88,7 @@ class sale_report(osv.osv):
group by
s.date_order, s.partner_id, l.product_id,
l.product_uom, s.user_id, s.state, s.shop_id,
- s.company_id
+ s.company_id,s.fiscal_position,s.payment_term
)
""")
sale_report()
diff --git a/addons/sale/report/sale_report_view.xml b/addons/sale/report/sale_report_view.xml
index 79fd67084d2..9b927a7d7a0 100644
--- a/addons/sale/report/sale_report_view.xml
+++ b/addons/sale/report/sale_report_view.xml
@@ -21,6 +21,8 @@
+
+
@@ -72,6 +74,17 @@
+
+
+
+
+
+
+
+
+
+
+
@@ -80,8 +93,10 @@
+
+