[ADD/REMOVED] mrp : Production order report added, files from report_mrp modules are removed to mrp module
bzr revid: vir@tinyerp.com-20100316084939-z3iccty0n0rrj35d
This commit is contained in:
parent
696ddf9aaf
commit
7083ee61a3
|
@ -69,6 +69,8 @@
|
|||
'process/service_product_process.xml',
|
||||
'process/procurement_process.xml',
|
||||
'mrp_installer.xml',
|
||||
'report/mrp_report_view.xml',
|
||||
'report/mrp_production_order_view.xml',
|
||||
],
|
||||
'demo_xml': ['mrp_demo.xml', 'mrp_order_point.xml'],
|
||||
'installable': True,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
|
@ -15,7 +15,7 @@
|
|||
# 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/>.
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
|
@ -23,6 +23,8 @@ import price
|
|||
import workcenter_load
|
||||
import order
|
||||
import bom_structure
|
||||
import mrp_report
|
||||
import mrp_production_order
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
|
|
@ -0,0 +1,64 @@
|
|||
# -*- 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
|
||||
|
||||
|
||||
class mrp_production_order(osv.osv):
|
||||
_name = "mrp.production.order"
|
||||
_description = "Production Order 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, required=True),
|
||||
'origin': fields.char('Source Document', size=64),
|
||||
'product_id': fields.many2one('product.product', 'Product', required=True, domain=[('type','<>','service')]),
|
||||
'state': fields.selection([('draft','Draft'),('picking_except', 'Picking Exception'),('confirmed','Waiting Goods'),('ready','Ready to Produce'),('in_production','In Production'),('cancel','Cancelled'),('done','Done')],'State', readonly=True),
|
||||
'scheduled_date':fields.date('Scheduled Date'),
|
||||
'location_src_id': fields.many2one('stock.location', 'Raw Materials Location', required=True),
|
||||
'location_dest_id': fields.many2one('stock.location', 'Finished Products Location', required=True),
|
||||
|
||||
|
||||
}
|
||||
def init(self, cr):
|
||||
tools.drop_view_if_exists(cr, 'mrp_production_order')
|
||||
cr.execute("""
|
||||
create or replace view mrp_production_order as (
|
||||
select
|
||||
min(c.id) as id,
|
||||
to_char(c.create_date, 'YYYY') as name,
|
||||
to_char(c.create_date, 'MM') as month,
|
||||
c.state,
|
||||
c.product_id,
|
||||
to_date(to_char(c.date_planned, 'dd-MM-YYYY'),'dd-MM-YYYY') as scheduled_date,
|
||||
c.name as reference,
|
||||
c.origin,
|
||||
c.location_src_id,
|
||||
c.location_dest_id
|
||||
from
|
||||
mrp_production c
|
||||
group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'), c.state,c.product_id,to_date(to_char(c.date_planned, 'dd-MM-YYYY'),'dd-MM-YYYY'),c.name,c.location_src_id,c.location_dest_id,c.origin
|
||||
)""")
|
||||
mrp_production_order()
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
@ -0,0 +1,115 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<!--
|
||||
Helpdesk report after Sales Services
|
||||
-->
|
||||
|
||||
<record id="view_report_mrp_production_order_tree" model="ir.ui.view">
|
||||
<field name="name">mrp.production.order.tree</field>
|
||||
<field name="model">mrp.production.order</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Production">
|
||||
<field name="name" />
|
||||
<field name="month"/>
|
||||
<field name="product_id" />
|
||||
<field name="scheduled_date"/>
|
||||
<field name="reference" />
|
||||
<field name="origin"/>
|
||||
<field name="location_src_id"/>
|
||||
<field name="location_dest_id" />
|
||||
<field name="state" invisible="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_report_mrp_production_order_form" model="ir.ui.view">
|
||||
<field name="name">mrp.production.order.form</field>
|
||||
<field name="model">mrp.production.order</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Production">
|
||||
<field name="name" />
|
||||
<field name="month"/>
|
||||
<field name="product_id"/>
|
||||
<field name="scheduled_date"/>
|
||||
<field name="reference" />
|
||||
<field name="origin"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- <record id="view_report_mrp_production_order_graph" model="ir.ui.view">-->
|
||||
<!-- <field name="name">mrp.production.order.graph</field>-->
|
||||
<!-- <field name="model">mrp.production.order</field>-->
|
||||
<!-- <field name="type">graph</field>-->
|
||||
<!-- <field name="arch" type="xml">-->
|
||||
<!-- <graph orientation="horizontal" string="Helpdesk" type="bar">-->
|
||||
<!-- <field name="state"/>-->
|
||||
<!-- <field name="nbr" operator="+"/>-->
|
||||
<!-- <field group="True" name="user_id"/>-->
|
||||
<!-- </graph>-->
|
||||
<!-- </field>-->
|
||||
<!-- </record>-->
|
||||
|
||||
<record id="view_report_mrp_production_order_filter" model="ir.ui.view">
|
||||
<field name="name">mrp.production.order.select</field>
|
||||
<field name="model">mrp.production.order</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search">
|
||||
<group col="16" colspan="6">
|
||||
<filter string="This Year" icon="terp-hr" domain="[('name','=',time.localtime()[0])]" default="1" />
|
||||
<filter string="This Month" icon="terp-hr" domain="[('month','=',time.strftime('%%m'))]" default="1"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Current" icon="terp-hr" domain="[('state','in',('open','draft'))]"/>
|
||||
<filter string="Scheduled Date" icon="terp-hr" domain="[('scheduled_date',=,time.strftime('%%m/%%d/%%Y'))]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="reference" />
|
||||
<field name="origin"/>
|
||||
</group>
|
||||
|
||||
<newline/>
|
||||
<group expand="1" string="Group By..." colspan="4" col="6">
|
||||
<filter string="Source Location" icon="terp-sale" domain="[]" context="{'group_by':'location_src_id'}"/>
|
||||
<filter string="Destination Location" icon="terp-sale" domain="[]" context="{'group_by':'location_dest_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="State" icon="terp-sale" domain="[]" context="{'group_by':'state'}"/>
|
||||
<filter string="Product" icon="terp-sale" domain="[]" context="{'group_by':'product_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Month" icon="terp-sale" domain="[]" context="{'group_by':'month'}"/>
|
||||
<filter string="Year" icon="terp-sale" domain="[]" context="{'group_by':'name'}"/>
|
||||
|
||||
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
<record id="action_report_mrp_production_order" model="ir.actions.act_window">
|
||||
<field name="name">Production Order</field>
|
||||
<field name="res_model">mrp.production.order</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="view_id" ref="view_report_mrp_production_order_tree"/>
|
||||
<field name="search_view_id" ref="view_report_mrp_production_order_filter"/>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window.view" id="action_report_mrp_production_order_tree">
|
||||
<field name="sequence" eval="1"/>
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="view_id" ref="view_report_mrp_production_order_tree"/>
|
||||
<field name="act_window_id" ref="action_report_mrp_production_order"/>
|
||||
</record>
|
||||
|
||||
<!-- <record model="ir.actions.act_window.view" id="action_report_mrp_production_order_graph">-->
|
||||
<!-- <field name="sequence" eval="2"/>-->
|
||||
<!-- <field name="view_mode">graph</field>-->
|
||||
<!-- <field name="view_id" ref="view_report_mrp_production_order_graph"/>-->
|
||||
<!-- <field name="act_window_id" ref="action_report_mrp_production_order"/>-->
|
||||
<!-- </record>-->
|
||||
|
||||
<menuitem name="Production" action="action_report_mrp_production_order" id="menu_report_mrp_production_orders_tree" parent="next_id_77"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
@ -98,7 +98,7 @@
|
|||
<field name="view_type">form</field>
|
||||
<field name="view_mode">graph,tree</field>
|
||||
</record>
|
||||
<menuitem action="action_report_in_out_picking_tree" id="menu_report_in_out_picking" parent="report_mrp.next_id_77"/>
|
||||
<menuitem action="action_report_in_out_picking_tree" id="menu_report_in_out_picking" parent="next_id_77"/>
|
||||
|
||||
|
||||
|
|
@ -32,3 +32,4 @@
|
|||
"access_mrp_production_stock_worker","mrp.production stock_worker","model_mrp_production","stock.group_stock_user",1,0,0,0
|
||||
"access_mrp_installer","mrp.installer","model_mrp_installer","mrp.group_mrp_user",1,0,0,0
|
||||
"access_mrp_product_produce","mrp.product.produce","model_mrp_product_produce","mrp.group_mrp_user",1,0,0,0
|
||||
"access_mrp_production_order","mrp.production.order","model_mrp_production_order","mrp.group_mrp_user",,,,
|
||||
|
|
|
Loading…
Reference in New Issue