diff --git a/addons/mrp/report/mrp_production_order_view.xml b/addons/mrp/report/mrp_production_order_view.xml index 841c1b9084e..abb046bd685 100644 --- a/addons/mrp/report/mrp_production_order_view.xml +++ b/addons/mrp/report/mrp_production_order_view.xml @@ -2,7 +2,7 @@ diff --git a/addons/stock/__terp__.py b/addons/stock/__terp__.py index 502ac0222a5..7a03b225dc2 100644 --- a/addons/stock/__terp__.py +++ b/addons/stock/__terp__.py @@ -53,6 +53,7 @@ Thanks to the double entry management, the inventory controlling is powerful and "product_view.xml", "partner_view.xml", "report/report_stock_view.xml", + "report/report_stock_picking_view.xml", "security/stock_security.xml", "security/ir.model.access.csv", ], diff --git a/addons/stock/report/__init__.py b/addons/stock/report/__init__.py index 3c650e3ed8c..6e0bc044d3e 100644 --- a/addons/stock/report/__init__.py +++ b/addons/stock/report/__init__.py @@ -27,6 +27,7 @@ import picking import lot_overview import lot_overview_all import report_stock +import report_stock_picking # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/stock/report/report_stock_picking.py b/addons/stock/report/report_stock_picking.py new file mode 100644 index 00000000000..2fe450d60de --- /dev/null +++ b/addons/stock/report/report_stock_picking.py @@ -0,0 +1,63 @@ +# -*- 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 . +# +############################################################################## +from osv import fields,osv +import tools + +class report_stock_picking(osv.osv): + _name = "report.stock.picking" + _description = "Stock Picking Report" + _auto = False + _columns = { + 'name': fields.char('Year',size=64,required=False, 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), + 'reference': fields.char('Reference', size=64, select=True), + 'nbr': fields.integer('# of Orders', readonly=True), + 'origin': fields.char('Origin', size=64), + 'order_date':fields.date('Order Date'), + '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), + 'address_id': fields.many2one('res.partner.address', 'Partner'), + 'expected_date': fields.date('Expected Date'), + + } + def init(self, cr): + tools.drop_view_if_exists(cr, 'report_stock_picking') + cr.execute(""" + create or replace view report_stock_picking as ( + select + min(c.id) as id, + to_char(c.create_date, 'YYYY') as name, + to_char(c.create_date, 'MM') as month, + c.name as reference, + c.origin, + c.state, + c.type, + c.address_id, + to_date(to_char(c.date, 'MM-dd-YYYY'),'MM-dd-YYYY') as order_date, + to_date(to_char(c.min_date, 'MM-dd-YYYY'),'MM-dd-YYYY') as expected_date, + count(*) as nbr + from + stock_picking c + group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'),c.name,c.origin,c.date,c.state,c.type,c.address_id,c.min_date + )""") +report_stock_picking() +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/stock/report/report_stock_picking_view.xml b/addons/stock/report/report_stock_picking_view.xml new file mode 100644 index 00000000000..913498fde55 --- /dev/null +++ b/addons/stock/report/report_stock_picking_view.xml @@ -0,0 +1,123 @@ + + + + + + + report.stock.picking.tree + report.stock.picking + tree + + + + + + + + + + + + + + + + + + report.stock.picking.form + report.stock.picking + form + +
+ + + + + +
+ + + report.stock.picking.graph + report.stock.picking + graph + + + + + + + + + + report.stock.picking.select + report.stock.picking + search + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Picking + report.stock.picking + form + tree,graph + + + + + + + tree + + + + + + + graph + + + + + + +
+
+