[REM] stock : Remove the stock_picking report

bzr revid: sbh@tinyerp.com-20100924110556-bgnci35flqhd6t57
This commit is contained in:
sbh (Open ERP)
2010-09-24 16:35:56 +05:30
parent a1863560b1
commit 2b835bccc6
4 changed files with 0 additions and 255 deletions
-1
View File
@@ -67,7 +67,6 @@ Thanks to the double entry management, the inventory controlling is powerful and
"product_view.xml",
"partner_view.xml",
"report/report_stock_move_view.xml",
"report/report_stock_picking_view.xml",
"report/report_stock_view.xml",
"security/stock_security.xml",
"security/ir.model.access.csv",
-1
View File
@@ -25,7 +25,6 @@ import ups
import picking
import lot_overview_all
import report_stock
import report_stock_picking
import report_stock_move
import stock_inventory_move_report
import lot_overview
-114
View File
@@ -1,114 +0,0 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# 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 <http://www.gnu.org/licenses/>.
#
##############################################################################
from osv import fields,osv
import tools
import decimal_precision as dp
class report_stock_picking(osv.osv):
_name = "report.stock.picking"
_description = "Stock Picking Report"
_auto = False
_columns = {
'year': 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),
'day': fields.char('Day', size=128, readonly=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_late': fields.float('Avg Due Days', digits_compute=dp.get_precision('Product UoM'), readonly=True, group_operator="avg"),
'avg_days_to_deliver': fields.float('Avg Days to Deliver', digits_compute=dp.get_precision('Product UoM'), readonly=True, group_operator="avg",
help="Number of Avg Days to deliver"),
'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"),
'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')
cr.execute("""
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,
sp.address_id as partner_id,
to_date(to_char(sp.create_date, 'MM-dd-YYYY'),'MM-dd-YYYY') as date,
count(sm.id) as nbr,
count(sp.id) as nbp,
sum(sm.product_qty*u.factor) as product_qty,
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 as company_id,
avg(extract('epoch' from (sp.date_done-sp.create_date)))/(3600*24) as avg_days_to_deliver,
avg(extract('epoch' from (sp.date_done-sp.min_date)))/(3600*24) as avg_days_late,
sp.state
from stock_picking as sp
Inner join stock_move as sm ON (sm.picking_id=sp.id)
Inner join product_uom u on (u.id=sm.product_uom)
group by sp.type,
sp.create_date,
sp.address_id,
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.company_id,
sp.state
)""")
report_stock_picking()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -1,139 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!--
Stock Picking Report
-->
<record id="view_report_report_stock_picking_tree" model="ir.ui.view">
<field name="name">report.stock.picking.tree</field>
<field name="model">report.stock.picking</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Picking">
<field name="year" invisible="1"/>
<field name="month" invisible="1"/>
<field name="day" invisible="1"/>
<field name="date" invisible="1"/>
<field name="company_id" invisible="1"/>
<field name="partner_id" invisible="1"/>
<field name="product_id" invisible="1"/>
<field name="min_date" invisible="1"/>
<field name="order_date" invisible="1"/>
<field name="date_done" invisible="1"/>
<field name="max_date" invisible="1"/>
<field name="type" invisible="1"/>
<field name="invoice_state" invisible="1"/>
<field name="state" invisible="1"/>
<field name="nbr" sum="# of Lines" />
<field name="product_qty" sum="# of Products" />
<field name="avg_days_to_deliver" avg='Avg Days to Deliver'/>
<field name="avg_days_late" avg='Avg Due Days'/>
</tree>
</field>
</record>
<record id="view_report_report_stock_picking_graph" model="ir.ui.view">
<field name="name">report.stock.picking.graph</field>
<field name="model">report.stock.picking</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph orientation="horizontal" string="Picking" type="bar">
<field name="partner_id"/>
<field name="nbr" operator="+"/>
<field name="product_qty" operator="+"/>
<field name="nbp" operator="+"/>
</graph>
</field>
</record>
<record id="view_report_report_stock_picking_filter" model="ir.ui.view">
<field name="name">report.stock.picking.select</field>
<field name="model">report.stock.picking</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Search">
<group col="16" colspan="6">
<filter icon="terp-go-year" string=" 365 Days "
domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')),('date','&gt;',(datetime.date.today()-datetime.timedelta(days=365)).strftime('%%Y-%%m-%%d'))]"
help="Picking in last 365 days"/>
<filter icon="terp-go-month" string=" 30 Days "
name="month"
domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')), ('date','&gt;',(datetime.date.today()-datetime.timedelta(days=30)).strftime('%%Y-%%m-%%d'))]"
help="Picking in last 30 days"/>
<filter icon="terp-go-week"
string=" 7 Days "
separator="1"
domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')), ('date','&gt;',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
help="Picking during last 7 days"/>
<separator orientation="vertical"/>
<filter string="Todo" icon="terp-gtk-go-back-rtl" domain="[('state','in',('draft','auto','confirmed','assigned'))]"/>
<filter string="Done" icon="terp-dialog-close" domain="[('state','=','done')]"/>
<separator orientation="vertical"/>
<field name="partner_id"/>
</group>
<newline/>
<group expand="1" string="Group By...">
<filter string="Partner" name="Partner" icon="terp-personal" domain="[]" context="{'group_by':'partner_id'}"/>
<separator orientation="vertical"/>
<filter string="Product" icon="terp-accessories-archiver" domain="[]" context="{'group_by':'product_id'}"/>
<separator orientation="vertical"/>
<filter string="Shipping Type" icon="terp-stock_symbol-selection" domain="[]" context="{'group_by':'type'}"/>
<separator orientation="vertical"/>
<filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
<filter string="Invoice Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'invoice_state'}"/>
<separator orientation="vertical"/>
<filter string="Company" icon="terp-go-home" domain="[]" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
<separator orientation="vertical"/>
<filter string="Day" icon="terp-go-today" domain="[]" context="{'group_by':'day'}"/>
<filter string="Month" icon="terp-go-month" domain="[]" context="{'group_by':'month'}"/>
<filter string="Year" icon="terp-go-year" domain="[]" context="{'group_by':'year'}"/>
</group>
<newline/>
<group expand="0" string="Extended Filters..." groups="base.group_extended">
<field name="product_id"/>
<separator orientation="vertical"/>
<field name="type"/>
<field name="invoice_state"/>
<separator orientation="vertical"/>
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
<newline/>
<field name="order_date"/>
<field name="date_done"/>
<field name="min_date"/>
<field name="max_date"/>
</group>
</search>
</field>
</record>
<record id="action_report_report_stock_picking" model="ir.actions.act_window">
<field name="name">Picking</field>
<field name="res_model">report.stock.picking</field>
<field name="view_type">form</field>
<field name="view_mode">tree,graph</field>
<field name="view_id" ref="view_report_report_stock_picking_tree"/>
<field name="search_view_id" ref="view_report_report_stock_picking_filter"/>
<field name="context">{'search_default_Partner':1,'search_default_month':1,'group_by_no_leaf':1,'group_by':[]}</field>
</record>
<record model="ir.actions.act_window.view" id="action_report_report_stock_picking_tree">
<field name="sequence" eval="1"/>
<field name="view_mode">tree</field>
<field name="view_id" ref="view_report_report_stock_picking_tree"/>
<field name="act_window_id" ref="action_report_report_stock_picking"/>
</record>
<record model="ir.actions.act_window.view" id="action_report_report_stock_picking_graph">
<field name="sequence" eval="2"/>
<field name="view_mode">graph</field>
<field name="view_id" ref="view_report_report_stock_picking_graph"/>
<field name="act_window_id" ref="action_report_report_stock_picking"/>
</record>
<menuitem name="Picking" action="action_report_report_stock_picking"
id="menu_report_report_stock_pickings_tree" parent="stock.next_id_61" sequence="5"/>
</data>
</openerp>