[IMP]Manufacturing orders view change

bzr revid: kjo@tinyerp.com-20120622120353-poglhhjdz17vbegi
This commit is contained in:
Kuldeep Joshi (OpenERP) 2012-06-22 17:33:53 +05:30
parent 2b85a687e5
commit de90ef25dc
5 changed files with 35 additions and 27 deletions

View File

@ -472,9 +472,9 @@ class mrp_production(osv.osv):
'bom_id': fields.many2one('mrp.bom', 'Bill of Material', domain=[('bom_id','=',False)], readonly=True, states={'draft':[('readonly',False)]}),
'routing_id': fields.many2one('mrp.routing', string='Routing', on_delete='set null', readonly=True, states={'draft':[('readonly',False)]}, help="The list of operations (list of work centers) to produce the finished product. The routing is mainly used to compute work center costs during operations and to plan future loads on work centers based on production plannification."),
'picking_id': fields.many2one('stock.picking', 'Picking list', readonly=True, ondelete="restrict",
'picking_id': fields.many2one('stock.picking', 'Picking List', readonly=True, ondelete="restrict",
help="This is the Internal Picking List that brings the finished product to the production plan"),
'move_prod_id': fields.many2one('stock.move', 'Move product', readonly=True),
'move_prod_id': fields.many2one('stock.move', 'Product Move', readonly=True),
'move_lines': fields.many2many('stock.move', 'mrp_production_move_ids', 'production_id', 'move_id', 'Products to Consume', domain=[('state','not in', ('done', 'cancel'))], states={'done':[('readonly',True)]}),
'move_lines2': fields.many2many('stock.move', 'mrp_production_move_ids', 'production_id', 'move_id', 'Consumed Products', domain=[('state','in', ('done', 'cancel'))]),
'move_created_ids': fields.one2many('stock.move', 'production_id', 'Products to Produce', domain=[('state','not in', ('done', 'cancel'))], states={'done':[('readonly',True)]}),
@ -1112,9 +1112,9 @@ class mrp_production_product_line(osv.osv):
_columns = {
'name': fields.char('Name', size=64, required=True),
'product_id': fields.many2one('product.product', 'Product', required=True),
'product_qty': fields.float('Product Qty', digits_compute=dp.get_precision('Product Unit of Measure'), required=True),
'product_qty': fields.float('Product Quantity', digits_compute=dp.get_precision('Product Unit of Measure'), required=True),
'product_uom': fields.many2one('product.uom', 'Product Unit of Measure', required=True),
'product_uos_qty': fields.float('Product UOS Qty'),
'product_uos_qty': fields.float('Product UOS Quantity'),
'product_uos': fields.many2one('product.uom', 'Product UOS'),
'production_id': fields.many2one('mrp.production', 'Production Order', select=True),
}

View File

@ -642,17 +642,19 @@
<notebook>
<page string="Consumed Products">
<group col="4">
<group>
<field name="bom_id" domain="[('product_id','=',product_id),('bom_id','=',False)]" on_change="bom_id_change(bom_id)"/>
</group>
<group>
<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')]"/>
</group>
<group>
<field name="bom_id" domain="[('product_id','=',product_id),('bom_id','=',False)]" on_change="bom_id_change(bom_id)"/>
</group>
</group>
<separator string="Products to Consume"/>
<field name="move_lines" domain="[('state','&lt;&gt;', ('done', 'cancel'))]">
<tree colors="blue:state == 'draft';black:state in ('picking_except','confirmed','ready','in_production');gray:state in ('cancel','done') " string="Products to Consume">
<field name="product_id" />
<field name="product_qty" string="Qty"/>
<field name="product_qty" string="Quantity"/>
<field name="product_uom" string="Unit of Measure"/>
<field name="location_id" string="Source Loc."/>
<field name="state" invisible="1"/>
@ -671,10 +673,11 @@
states="draft,waiting,confirmed,assigned"/>
</tree>
</field>
<separator string="Consumed Product"/>
<field name="move_lines2" domain="[('state','in', ('done', 'cancel'))]">
<tree colors="red:scrapped==True;blue:state == 'draft';black:state in('picking_except','confirmed','ready','in_production');gray:state == 'cancel' " string="Consumed Products" editable="bottom">
<field name="product_id" readonly="1"/>
<field name="product_qty" readonly="1" string="Qty"/>
<field name="product_qty" readonly="1" string="Quantity"/>
<field name="product_uom" readonly="1" string="Unit of Measure"/>
<field name="prodlot_id" context="{'product_id': product_id}"/>
<field name="state" invisible="1"/>
@ -686,14 +689,13 @@
states="done,cancel"/>
</tree>
</field>
</group>
</page>
<page string="Finished Products">
<group>
<field name="move_created_ids" domain="[('state','&lt;&gt;', ('done', 'cancel'))]">
<separator string="Products to Produce"/>
<field name="move_created_ids" domain="[('state','&lt;&gt;', ('done', 'cancel'))]" nolabel="1">
<tree string="Products to Finish">
<field name="product_id" />
<field name="product_qty" string="Qty"/>
<field name="product_qty" string="Quantity"/>
<field name="product_uom" string="Unit of Measure"/>
<field name="state" invisible="1"/>
<button name="%(stock.action_partial_move_server)d"
@ -706,10 +708,11 @@
states="draft,waiting,confirmed,assigned" />
</tree>
</field>
<field name="move_created_ids2" domain="[('state','in', ('done', 'cancel'))]">
<separator string="Produced Products"/>
<field name="move_created_ids2" domain="[('state','in', ('done', 'cancel'))]" nolabel="1">
<tree colors="red:scrapped==True;blue:state == 'draft';black:state in('picking_except','confirmed','ready','in_production');gray:state in('cancel','done') " string="Finished Products">
<field name="product_id" readonly="1"/>
<field name="product_qty" readonly="1" string="Qty"/>
<field name="product_qty" readonly="1" string="Quantity"/>
<field name="product_uom" readonly="1" string="Unit of Measure"/>
<field name="location_dest_id" readonly="1" string="Destination Loc." widget="selection"/>
<field name="prodlot_id" context="{'product_id': product_id}"/>
@ -722,7 +725,6 @@
states="done,cancel" />
</tree>
</field>
</group>
</page>
<page string="Work Orders">
<button name="action_compute" states="draft"
@ -732,7 +734,7 @@
<form string="Production Work Centers" version="7.0">
<group col="4">
<field colspan="4" name="name"/>
<field name="workcenter_id" widget="selection"/>
<field name="workcenter_id"/>
<field name="sequence"/>
<field name="cycle"/>
<field name="hour"/>
@ -741,7 +743,7 @@
<tree string="Production Work Centers">
<field name="sequence"/>
<field name="name"/>
<field name="workcenter_id" widget="selection"/>
<field name="workcenter_id"/>
<field name="cycle"/>
<field name="hour"/>
</tree>
@ -755,12 +757,16 @@
</page>
<page string="Extra Information">
<group col="4">
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
<group>
<field name="priority"/>
<field name="date_start"/>
<field name="date_finished"/>
<field name="picking_id"/>
<field name="move_prod_id"/>
</group>
<group>
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
<field name="picking_id"/>
<field name="move_prod_id"/>
</group>
</group>
</page>
</notebook>

View File

@ -80,7 +80,7 @@
<sheet string="Work Orders">
<group col="4">
<field colspan="4" name="name"/>
<field name="workcenter_id" widget="selection"/>
<field name="workcenter_id"/>
<field name="production_id"/>
<field name="production_state"/>
<field name="sequence"/>
@ -350,7 +350,7 @@
<field name="model">mrp.production</field>
<field name="type">form</field>
<field name="arch" type="xml">
<field name="priority" position="after">
<field name="date_finished" position="after">
<field name="allow_reorder"/>
</field>
</field>

View File

@ -70,8 +70,8 @@ class mrp_production(osv.osv):
return res
_columns = {
'sale_name': fields.function(_ref_calc, multi='sale_name', type='char', string='Sales Name', help='Indicate the name of sales order.'),
'sale_ref': fields.function(_ref_calc, multi='sale_name', type='char', string='Sales Reference', help='Indicate the Customer Reference from sales order.'),
'sale_name': fields.function(_ref_calc, multi='sale_name', type='char', string='Sale Name', help='Indicate the name of sales order.'),
'sale_ref': fields.function(_ref_calc, multi='sale_name', type='char', string='Sale Reference', help='Indicate the Customer Reference from sales order.'),
}
mrp_production()

View File

@ -8,10 +8,12 @@
<field name="inherit_id" ref="mrp.mrp_production_form_view"/>
<field name="type">form</field>
<field name="arch" type="xml">
<xpath expr="//field[@name='move_prod_id']" position="after">
<field name="sale_name"/>
<xpath expr="//field[@name='company_id']" position="after">
<field name="sale_ref"/>
</xpath>
<xpath expr="//field[@name='sale_ref']" position="after">
<field name="sale_name"/>
</xpath>
</field>
</record>