[ADD] added configuration view for mrp

bzr revid: tpa@tinyerp.com-20120305105243-owrr6ks1326t1hi2
This commit is contained in:
Turkesh Patel (Open ERP) 2012-03-05 16:22:43 +05:30
parent 2f2e447573
commit 55c4d298ef
6 changed files with 180 additions and 15 deletions

View File

@ -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/>.
#
##############################################################################
@ -26,5 +26,6 @@ import wizard
import report
import company
import procurement
import res_config
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -86,6 +86,7 @@ Dashboard provided by this module:
'report/mrp_report_view.xml',
'report/mrp_production_order_view.xml',
'board_manufacturing_view.xml',
'res_config_view.xml',
],
@ -94,7 +95,7 @@ Dashboard provided by this module:
],
'test': [
'test/order_demo.yml',
'test/order_process.yml',
'test/order_process.yml',
'test/cancel_order.yml',
],
'installable': True,

View File

@ -105,15 +105,17 @@
<menuitem name="Master Bill of Materials"
id="menu_mrp_property"
parent="menu_mrp_configuration"
groups="base.group_extended"
groups="base.group_mrp_routings,base.group_mrp_properties"
sequence="20" />
<menuitem
action="mrp_property_action"
id="menu_mrp_property_action"
groups="base.group_mrp_properties"
parent="menu_mrp_property"/>
<menuitem
action="mrp_property_group_action"
parent="menu_mrp_property"
groups="base.group_mrp_properties"
id="menu_mrp_property_group_action"/>
<!--
@ -304,7 +306,7 @@
<field name="search_view_id" ref="mrp_routing_search_view"/>
<field name="help">Routings allow you to create and manage the manufacturing operations that should be followed within your work centers in order to produce a product. They are attached to bills of materials that will define the required raw materials.</field>
</record>
<menuitem action="mrp_routing_action" id="menu_mrp_routing_action" parent="mrp.menu_mrp_property" groups="base.group_extended" sequence="1"/>
<menuitem action="mrp_routing_action" id="menu_mrp_routing_action" parent="mrp.menu_mrp_property" groups="base.group_mrp_routings" sequence="1"/>
<!--
Bill of Materials
@ -323,7 +325,7 @@
<newline/>
<field name="product_qty"/>
<field name="product_uom"/>
<field name="routing_id" groups="base.group_extended"/>
<field name="routing_id" groups="base.group_mrp_routings"/>
<newline/>
<field name="product_uos_qty" groups="product.group_uos" />
<field name="product_uos" groups="product.group_uos"/>
@ -350,7 +352,7 @@
<newline/>
<field name="product_qty"/>
<field name="product_uom"/>
<field name="routing_id" groups="base.group_extended"/>
<field name="routing_id" groups="base.group_mrp_routings"/>
<newline/>
<field name="product_uos_qty" groups="product.group_uos" />
<field name="product_uos" groups="product.group_uos"/>
@ -375,7 +377,7 @@
<page string="Revisions" groups="base.group_extended" attrs="{'invisible': [('bom_id','!=',False)]}">
<field colspan="4" name="revision_ids" nolabel="1" widget="one2many_list"/>
</page>
<page string="Properties" groups="base.group_extended">
<page string="Properties" groups="base.group_mrp_properties">
<field name="position"/>
<field name="active"/>
<field name="sequence"/>
@ -395,7 +397,7 @@
<page string="Revisions" groups="base.group_extended" attrs="{'invisible': [('bom_id','!=',False)]}">
<field colspan="4" name="revision_ids" nolabel="1" widget="one2many_list"/>
</page>
<page string="Properties" groups="base.group_extended">
<page string="Properties" groups="base.group_mrp_properties">
<field name="position"/>
<field name="active"/>
<field name="sequence"/>
@ -455,7 +457,7 @@
<field name="product_uom"/>
<field name="type"/>
<field name="method" groups="base.group_extended"/>
<field name="routing_id" groups="base.group_extended"/>
<field name="routing_id" groups="base.group_mrp_routings"/>
<field name="date_start" groups="base.group_extended"/>
<field name="date_stop" groups="base.group_extended"/>
</tree>
@ -477,7 +479,7 @@
<field name="product_uom"/>
<field name="type"/>
<field name="method" groups="base.group_extended"/>
<field name="routing_id" groups="base.group_extended"/>
<field name="routing_id" groups="base.group_mrp_routings"/>
<field name="date_start" groups="base.group_extended"/>
<field name="date_stop" groups="base.group_extended"/>
</tree>
@ -575,7 +577,7 @@
<field name="product_id"/>
<field name="product_qty" sum="Total Qty"/>
<field name="product_uom"/>
<field name="routing_id" groups="base.group_extended"/>
<field name="routing_id" groups="base.group_mrp_routings"/>
<field name="hour_total" sum="Total Hours" groups="base.group_extended"/>
<field name="cycle_total" sum="Total Cycles" groups="base.group_extended"/>
<field name="origin"/>
@ -649,7 +651,7 @@
<notebook colspan="4">
<page string="Consumed Products">
<field name="bom_id" domain="[('product_id','=',product_id),('bom_id','=',False)]" on_change="bom_id_change(bom_id)"/>
<field name="routing_id" groups="base.group_extended" select="1"/>
<field name="routing_id" groups="base.group_mrp_routings" select="1"/>
<field name="location_src_id" domain="[('usage','=','internal')]" on_change="location_id_change(location_src_id,location_dest_id)"/>
<field name="location_dest_id" domain="[('usage','=','internal')]"/>
<separator string="" colspan="4"/>
@ -810,7 +812,7 @@
<separator orientation="vertical"/>
<field name="name"/>
<field name="product_id"/>
<field name="routing_id" groups="base.group_extended"/>
<field name="routing_id" groups="base.group_mrp_routings"/>
<field name="origin"/>
</group>
<newline/>
@ -961,7 +963,7 @@
<field name="bom_id" domain="[('product_id','=',product_id),('bom_id','=',False)]"/>
</xpath>
<xpath expr="/form/notebook/page/field[@name='close_move']" position="after">
<group colspan="4" groups="base.group_extended">
<group colspan="4" groups="base.group_mrp_properties">
<separator colspan="4" string="Properties" />
<field colspan="4" name="property_ids" nolabel="1"/>
</group>

91
addons/mrp/res_config.py Normal file
View File

@ -0,0 +1,91 @@
# -*- 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 pooler
from tools.translate import _
class mrp_configuration(osv.osv_memory):
_inherit = 'res.config.settings'
_columns = {
'default_method' : fields.selection(
[('manual', 'Based on Purchase Order Lines'),
('picking', 'Based on Receptions'),
('order', 'Pre-Generate Draft Invoices based on Purchase Orders'),
], 'Invoicing Control Method', required=True , help="You can set Invoicing Control Method."),
'module_stock_planning': fields.boolean('Track work order planning',
help ="""
This allows to create a manual procurement plan apart of the normal MRP scheduling, which works automatically based on minimum stock rules.
It installs the stock_planning module.
"""),
'module_mrp_repair': fields.boolean("Track products repair",
help="""The aim is to have a complete module to manage all products repairs.
* Add/remove products in the reparation
* Impact for stocks
* Invoicing (products and/or services)
* Warranty concept
* Repair quotation report
* Notes for the technician and for the final customer
It installs the mrp_repair module."""),
'module_mrp_operations': fields.boolean("Track dates in work order operations",
help="""This allows to add state, date_start,date_stop in production order operation lines (in the "Work Centers" tab).
It installs the mrp_operations module."""),
'module_mrp_subproduct': fields.boolean("Produce several products from one production",
help="""You can configure sub-products in the bill of material.
Without this module:
A + B + C -> D
With this module:
A + B + C -> D + E.
It installs the purchase_double_validation module."""),
'module_stock_location' : fields.boolean("Allow push/pull flows by product",
help="""This module supplements the Warehouse application by effectively implementing Push and Pull inventory flows.
Typically this could be used to:
* Manage product manufacturing chains
* Manage default locations per product
* Define routes within your warehouse according to business needs, such as:
- Quality Control
- After Sales Services
- Supplier Returns.
It Installs stock_location module."""),
'module_mrp_jit': fields.boolean("Allow the just in time scheduling",
help="""This allows Just In Time computation of procurement orders.
All procurement orders will be processed immediately, which could in some
cases entail a small performance impact.
It installs the mrp_jit module."""),
'module_mrp_operations': fields.boolean("Track dates in work order operations",
help="""This allows to add state, date_start,date_stop in production order operation lines (in the "Work Centers" tab).
It installs the mrp_operations module."""),
'group_mrp_routings':fields.boolean("Manage manufacturing operations ",
help="""Routings allow you to create and manage the manufacturing operations that should be followed within your work centers in order to produce a product. They are attached to bills of materials that will define the required raw materials..
It assigns the "Routings" group to employee."""),
'group_mrp_properties':fields.boolean("Allow different properties per product in your order",
help="""Allows to Define specific property groups that can be assigned to the properties of your bill of materials.
It assigns the "Properties of Product" group to employee."""),
}
_defaults = {
'default_method': lambda s,c,u,ctx: s.pool.get('purchase.order').default_get(c,u,['invoice_method'],context=ctx)['invoice_method'],
}
mrp_configuration()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,60 @@
<openerp>
<data>
<record id="view_mrp_config" model="ir.ui.view">
<field name="name">Manufacturing Application</field>
<field name="model">res.config.settings</field>
<field name="type">form</field>
<field name="inherit_id" ref="base.view_res_config_settings"/>
<field name="arch" type="xml">
<form position ="replace">
<form string ="Manufacturing Application">
<separator string="Manufacturing Order" colspan="4"/>
<group colspan="4" col="8" name="Purchase_order">
<group colspan="4" col="4">
<field name="group_mrp_routings"/>
<newline/>
<field name="module_stock_planning"/>
<newline/>
<field name="module_mrp_repair"/>
<newline/>
</group>
<group colspan="4" col="4">
<newline/>
<field name="module_mrp_operations"/>
<newline/>
<field name="module_mrp_subproduct"/>
<newline/>
</group>
</group>
<separator string="Logistic" colspan="4"/>
<group colspan="4" col="4">
<field name="module_stock_location"/>
<newline/>
<field name="module_mrp_jit"/>
<newline/>
</group>
<separator string="Bill Of Material" colspan="4"/>
<group colspan="4" col="4">
<field name="group_mrp_properties"/>
</group>
</form>
</form>
</field>
</record>
<record id="action_mrp_configuration" model="ir.actions.act_window">
<field name="name">Configure Manufacturing Application</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">res.config.settings</field>
<field name="view_id" ref="view_mrp_config"/>
<field name="view_type">form</field>
<field name="view_mode">form</field>
</record>
<menuitem id="base.menu_mrp_config" name="Mrp" parent="base.menu_config" sequence="1" action="mrp.action_mrp_configuration"/>
</data>
</openerp>

View File

@ -12,6 +12,16 @@
<field name="implied_ids" eval="[(4, ref('group_mrp_user'))]"/>
</record>
<record id="base.group_mrp_routings" model="res.groups">
<field name="name">Routings</field>
<field name="category_id" ref="base.module_category_hidden"/>
</record>
<record id="base.group_mrp_properties" model="res.groups">
<field name="name">Properties of Product</field>
<field name="category_id" ref="base.module_category_hidden"/>
</record>
<!-- restrict access to menu -->
<record model='ir.ui.menu' id="mrp_Sched_all">
<field eval="[(6,0,[ref('group_mrp_manager')])]" name="groups_id"/>