Amit Parmar (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-kanban-views2-manufacturing_orders-aar 
into lp:~openerp-dev/openobject-addons/trunk-kanban-views2.

Requested reviews:
  Amit (Open ERP) (apa-tiny)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-kanban-views2-manufacturing_orders-aar/+merge/77901

Hello Sir,

     I have created kanban view in mrp of manufactoring_orders
Thanks,
Amit Parmar
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-kanban-views2-manufacturing_orders-aar/+merge/77901
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-kanban-views2.
=== modified file 'mrp/mrp.py'
--- mrp/mrp.py	2011-09-24 09:10:37 +0000
+++ mrp/mrp.py	2011-10-03 10:58:27 +0000
@@ -403,6 +403,7 @@
     _name = 'mrp.production'
     _description = 'Manufacturing Order'
     _date_name  = 'date_planned'
+    _order = 'priority'
 
     def _production_calc(self, cr, uid, ids, prop, unknow_none, context=None):
         """ Calculates total hours and total no. of cycles for a production order.
@@ -483,12 +484,14 @@
         'hour_total': fields.function(_production_calc, type='float', string='Total Hours', multi='workorder', store=True),
         'cycle_total': fields.function(_production_calc, type='float', string='Total Cycles', multi='workorder', store=True),
         'company_id': fields.many2one('res.company','Company',required=True),
+        'color': fields.integer('Color Index'),
     }
     _defaults = {
         'priority': lambda *a: '1',
         'state': lambda *a: 'draft',
         'date_planned': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'),
         'product_qty':  lambda *a: 1.0,
+        'color': 0,
         'name': lambda x, y, z, c: x.pool.get('ir.sequence').get(y, z, 'mrp.production') or '/',
         'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'mrp.production', context=c),
     }

=== modified file 'mrp/mrp_view.xml'
--- mrp/mrp_view.xml	2011-09-24 09:10:37 +0000
+++ mrp/mrp_view.xml	2011-10-03 10:58:27 +0000
@@ -828,18 +828,109 @@
                </search>
             </field>
         </record>
+        
+        <!-- MRP Production/Orders Kanban View  -->
+        <record model="ir.ui.view" id="mrp_kanban_view">
+            <field name="name">MRP - Production Kanban</field>
+            <field name="model">mrp.production</field>
+            <field name="type">kanban</field>
+            <field name="arch" type="xml">
+                <kanban default_group_by="state">
+                    <templates>
+                        <t t-name="kanban-box">
+                            <t t-set="color" t-value="kanban_color(record.color.raw_value || record.state.raw_value)"/>
+                            <div t-att-class="color + (record.priority.raw_value == 3 ? ' oe_kanban_color_alert' : '')">
+                                <div class="oe_kanban_box oe_kanban_color_border">
+                                    <table class="oe_kanban_table oe_kanban_box_header oe_kanban_color_bgdark oe_kanban_color_border oe_kanban_draghandle">
+                                    <tr>
+                                        <td class="oe_kanban_title3" align="left" valign="middle">
+                                            <a t-if="record.priority.raw_value == 0" icon="star-off" type="button" style="opacity:0.4; filter:alpha(opacity=40);"/>
+                                            <a t-if="record.priority.raw_value == 1" icon="star-off" type="button"/>
+                                            <a t-if="record.priority.raw_value == 2" icon="star-on" type="button" style="opacity:0.6; filter:alpha(opacity=60);"/>
+                                            <a t-if="record.priority.raw_value == 3" icon="star-on" type="button"/>
+                                            <field name="name"/>
+                                        </td>
+                                        <td class="oe_kanban_title3" align="right" valign="middle">
+                                            <field name="date_planned"/>
+                                        </td>
+                                    </tr>
+                                    </table>
+    
+                                    <div class="oe_kanban_box_content oe_kanban_color_bglight oe_kanban_box_show_onclick_trigger">
+                                        <div>
+                                            Product : <field name="product_id"/>
+                                        </div>
+                                        <div>
+                                            Qty : <field name="product_qty"/> UOM : <field name="product_uom"/>
+                                        </div>
+                                        <newline/>
+                                        <div>
+                                            State : <field name="state"/><br/>
+                                            BOM : <field name="bom_id"/><br/>
+                                            Routing : <field name="routing_id"/>
+                                        </div>
+                                        <div class="oe_kanban_small">
+                                                <t t-if="record.date_start.value">
+                                                    Start Date : <field name="date_start"/>
+                                                </t>
+                                            <div class="oe_kanban_right">
+                                                <t t-if="record.date_finished.value">
+                                                    End Date : <field name="date_finished"/>
+                                                </t>
+                                            </div>
+                                        </div>
+                                    </div>
+    
+                                    <div class="oe_kanban_buttons_set oe_kanban_color_border oe_kanban_color_bglight oe_kanban_box_show_onclick">
+                                        <div class="oe_kanban_left">
+                                            <a string="Edit" icon="gtk-edit" type="edit"/>
+                                            <a string="Delete" icon="gtk-close" type="delete"/>
+                                            <a string="Change Color" icon="color-picker" type="color" name="color"/>
+                                        </div>
+                                        <div class="oe_kanban_right">
+                                            <a name="button_cancel" type="button" states="draft,ready,in_production,picking_except" string="Cancel" icon="gtk-stop"/>
+                                            <a name="action_cancel" type="object" states="confirmed" string="Cancel" icon="gtk-stop"/>
+                                            <a name="button_confirm" type="button" states="draft" string="Confirm Production" icon="gtk-apply"/>
+                                            <a name="button_produce" states="ready" type="button" string="Start Production" icon="terp-gtk-jump-to-ltr"/>
+                                            <a name="%(act_mrp_product_produce)d" states="in_production" string="Produce" icon="gtk-ok" type="action"/>
+                                            <a name="force_production" states="confirmed,picking_except" string="Force Reservation" type="object" icon="gtk-jump-to"/>
+                                            <a name="button_recreate" type="button" states="picking_except" string="Recreate Picking" icon="terp-document-new"/>
+                                        </div>
+                                        <br class="oe_kanban_clear"/>
+                                    </div>
+                                </div>
+                            </div>
+                        </t>
+                    </templates>
+                </kanban>
+            </field>
+        </record>
 
         <record id="mrp_production_action" model="ir.actions.act_window">
             <field name="name">Manufacturing Orders</field>
             <field name="type">ir.actions.act_window</field>
             <field name="res_model">mrp.production</field>
             <field name="view_type">form</field>
-            <field name="view_mode">tree,form,calendar,graph,gantt</field>
+            <field name="view_mode">tree,form,calendar,graph,gantt,kanban</field>
             <field name="view_id" eval="False"/>
             <field name="search_view_id" ref="view_mrp_production_filter"/>
             <field name="context">{'search_default_ready':1}</field>
             <field name="help">Manufacturing Orders are usually proposed automatically by OpenERP based on the bill of materials and the procurement rules, but you can also create manufacturing orders manually. OpenERP will handle the consumption of the raw materials (stock decrease) and the production of the finished products (stock increase) when the order is processed.</field>
         </record>
+        
+        <record id="open_view_manufacturing_order_tree" model="ir.actions.act_window.view">
+            <field name="sequence" eval="1"/>
+            <field name="view_mode">tree</field>
+            <field name="view_id" ref="mrp_production_tree_view"/>
+            <field name="act_window_id" ref="mrp_production_action"/>
+        </record>
+        <record id="open_view_manufacturing_order_form" model="ir.actions.act_window.view">
+            <field name="sequence" eval="2"/>
+            <field name="view_mode">form</field>
+            <field name="view_id" ref="mrp_production_form_view"/>
+            <field name="act_window_id" ref="mrp_production_action"/>
+        </record> 
+        
         <menuitem action="mrp_production_action" id="menu_mrp_production_action"
             parent="menu_mrp_manufacturing" sequence="1"/>
 

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to