[FIX] procurement: remove yml statement that queries the db asynchronously
[odoo/odoo.git] / addons / mrp / mrp_view.xml
index fb452f2..3049670 100644 (file)
@@ -9,7 +9,6 @@
 
         <menuitem id="menu_mrp_manufacturing" name="Manufacturing" parent="base.menu_mrp_root" sequence="1"/>
 
-
         <menuitem name="Master Data"
             id="menu_mrp_bom"
             parent="base.menu_mrp_root"
             <field name="type">search</field>
             <field name="arch" type="xml">
                 <search string="Search">
-                   <group col='15' colspan='4'>
+                   <group>
                        <field name="name"/>
                        <field name="composition"/>
                        <field name="group_id"  widget="selection" />
                    </group>
                    <newline/>
-                   <group expand="0" string="Group By..." colspan="4" col="20">
+                   <group expand="0" string="Group By...">
                         <filter string="Property Group" icon="terp-personal" domain="[]" context="{'group_by':'group_id'}"/>
                     </group>
                </search>
             <field name="view_type">form</field>
             <field name="view_mode">tree,form</field>
             <field name="search_view_id" ref="view_mrp_property_search"/>
-            <field name="help">The Properties in OpenERP are used to select the right bill of materials for manufacturing a product when you have different ways of building the same product. You can assign several properties to each Bill of Materials. When a sales person creates a sales order, he can relate it to several properties and OpenERP will automatically select the BoM to use according the the needs.</field>
+            <field name="help">The Properties in OpenERP are used to select the right bill of materials for manufacturing a product when you have different ways of building the same product. You can assign several properties to each Bill of Materials. When a sales person creates a sales order, he can relate it to several properties and OpenERP will automatically select the BoM to use according the needs.</field>
         </record>
         <menuitem name="Master Bill of Materials"
             id="menu_mrp_property"
         <menuitem
             action="mrp_property_action"
             id="menu_mrp_property_action"
-            parent="menu_mrp_property"
-            groups="base.group_extended" />
+            parent="menu_mrp_property"/>
         <menuitem
             action="mrp_property_group_action"
-            id="menu_mrp_property_group_action"
-            parent="menu_mrp_property"/>
+            parent="menu_mrp_property"
+            id="menu_mrp_property_group_action"/>
 
         <!--
         Work Centers
             <field name="type">search</field>
             <field name="arch" type="xml">
                 <search string="Search for mrp workcenter">
-                   <group col='15' colspan='4'>
+                   <group>
                         <filter string="Inactive" icon="terp-gdu-smart-failing" domain="[('active','=',False)]"/>
                         <separator orientation="vertical"/>
-                           <field name="code"/>
-                           <field name="name"/>
-                           <field name="resource_type"/>
+                        <field name="code"/>
+                        <field name="name"/>
+                        <field name="resource_type"/>
                    </group>
                    <newline/>
-                   <group expand="0" string="Group By..." colspan="4" col="20" groups="base.group_extended">
+                   <group expand="0" string="Group By..." groups="base.group_extended">
                         <filter string="Type" icon="terp-stock_symbol-selection" domain="[]" context="{'group_by':'resource_type'}"/>
                         <separator orientation="vertical" groups="base.group_multi_company"/>
                         <filter string="Company" icon="terp-go-home" domain="[]" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
                     <separator colspan="4" string="General Information"/>
                     <field colspan="4" name="name" select="1"/>
                     <field name="sequence" select="1"/>
-                    <field name="workcenter_id" select="1" widget="selection"/>
+                    <field name="workcenter_id"/>
                     <field name="cycle_nbr"/>
                     <field name="hour_nbr" widget="float_time"/>
                     <field name="company_id" widget="selection" groups="base.group_multi_company"/>
                     <field name="location_id"/>
                     <field name="company_id" groups="base.group_multi_company"/>
                     <newline/>
-                    <group expand="0" string="Group By..." colspan="4" col="8" groups="base.group_extended">
+                    <group expand="0" string="Group By..." groups="base.group_extended">
                         <filter string="Production Location" icon="terp-accessories-archiver" domain="[]" context="{'group_by':'location_id'}"/>
                     </group>
                 </search>
             <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="30"/>
+        <menuitem action="mrp_routing_action" id="menu_mrp_routing_action" parent="mrp.menu_mrp_property" groups="base.group_extended" sequence="1"/>
 
         <!--
           Bill of Materials
             <field name="arch" type="xml">
                 <form string="Bill of Material">
                     <group colspan="4" col="6">
-                        <field name="product_id" on_change="onchange_product_id(product_id, name)" select="1"/>
+                        <field name="product_id" on_change="onchange_product_id(product_id, name, context)" select="1"/>
                         <field name="name" select="1"/>
                         <field name="code" select="1" string="Reference" groups="base.group_extended"/>
                         <newline/>
                                     <field name="date_start"/>
                                     <field name="date_stop"/>
                                 </tree>
+                                <form string="Bill of Material">
+                                    <group colspan="4" col="6">
+                                    <field name="product_id" on_change="onchange_product_id(product_id, name)" select="1"/>
+                                    <field name="name" select="1"/>
+                                    <field name="code" select="1" string="Reference" groups="base.group_extended"/>
+                                    <newline/>
+                                    <field name="product_qty"/>
+                                    <field name="product_uom"/>
+                                    <field name="routing_id"  groups="base.group_extended"/>
+                                    <newline/>
+                                    <field name="product_uos_qty" groups="product.group_uos" />
+                                    <field name="product_uos"  groups="product.group_uos"/>
+                                    <newline/>
+                                    <field name="type" groups="base.group_extended"/>
+                                    <field name="company_id" select="1" groups="base.group_multi_company" widget="selection"/>
+                                </group>
+                                <group groups="base.group_extended">
+                                <notebook colspan="4">
+                                    <page string="Components">
+                                        <field colspan="4" name="bom_lines" nolabel="1" widget="one2many_list">
+                                            <tree string="Components" editable="bottom">
+                                                <field name="product_id" on_change="onchange_product_id(product_id, name)" select="1"/>
+                                                <field name="product_qty"/>
+                                                <field name="product_uom"/>
+                                                <field name="name" invisible="1"/>
+                                                <field name="date_start"/>
+                                                <field name="date_stop"/>
+                                            </tree>
+                                        </field>
+                                    </page>
+                                    <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">
+                                        <field name="position"/>
+                                        <field name="active"/>
+                                        <field name="sequence"/>
+                                        <field name="bom_id"/>
+
+                                        <field name="date_start"/>
+                                        <field name="date_stop"/>
+                                        <field name="product_rounding"/>
+                                        <field name="product_efficiency" groups="base.group_extended"/>
+                                        <field colspan="4" name="property_ids" nolabel="2" groups="base.group_extended"/>
+                                    </page>
+                                </notebook>
+                                </group>
+                            </form>
                             </field>
                         </page>
                         <page string="Revisions" groups="base.group_extended" attrs="{'invisible': [('bom_id','!=',False)]}">
                             <field name="date_stop"/>
                             <field name="product_rounding"/>
                             <field name="product_efficiency" groups="base.group_extended"/>
-                            <field colspan="4" name="property_ids" nolabel="2" groups="base.group_extended"/>
+                            <separator string="Properties" colspan="4"/>
+                            <newline/>
+                            <field colspan="4" name="property_ids" nolabel="1" groups="base.group_extended"/>
                         </page>
                     </notebook>
                 </form>
            <field name="type">search</field>
             <field name="arch" type="xml">
                 <search string="Search Bill Of Material">
-                    <group col='4' colspan='4'>
+                    <group>
                          <field name="name"/>
                          <field name="code" string="Reference"/>
                          <field name="product_id"/>
                          <field name="company_id" groups="base.group_multi_company"/>
                     </group>
                     <newline/>
-                    <group expand="0" string="Group By..." colspan="4" col="8" groups="base.group_extended">
+                    <group expand="0" string="Group By..." groups="base.group_extended">
                         <filter string="Product" icon="terp-accessories-archiver" domain="[]" context="{'group_by':'product_id'}"/>
                         <filter string='Default UOM' icon="terp-mrp" domain="[]" context="{'group_by' : 'product_uom'}" />
                         <separator orientation="vertical"/>
                 </tree>
             </field>
         </record>
+       <record id="mrp_bom_component_tree_view" model="ir.ui.view">
+            <field name="name">mrp.bom.component.tree</field>
+            <field name="model">mrp.bom</field>
+            <field name="type">tree</field>
+            <field name="field_parent">child_complete_ids</field>
+            <field name="arch" type="xml">
+                <tree string="BoM Structure" colors="blue:method">
+                    <field name="sequence" invisible="1"/>
+                    <field name="name" string="Component Name"/>
+                    <field name="code"/>
+                    <field name="product_id" string="Component Product"/>
+                    <field name="bom_id"/>
+                    <field name="product_qty"/>
+                    <field name="product_uom"/>
+                    <field name="type"/>
+                    <field name="method" groups="base.group_extended"/>
+                    <field name="routing_id" groups="base.group_extended"/>
+                    <field name="date_start" groups="base.group_extended"/>
+                    <field name="date_stop" groups="base.group_extended"/>
+                </tree>
+            </field>
+        </record>
         <record id="mrp_bom_form_action" model="ir.actions.act_window">
             <field name="name">Bill of Materials</field>
             <field name="type">ir.actions.act_window</field>
             <field name="type">ir.actions.act_window</field>
             <field name="res_model">mrp.bom</field>
             <field name="view_type">form</field>
+            <field name="view_id" ref="mrp_bom_component_tree_view"/>
             <field name="domain">[('bom_id','!=',False)]</field>
             <field name="help">Bills of materials components are components and sub-products used to create master bills of materials. Use this menu to search in which BoM a specific component is used.</field>
         </record>
             <field name="res_model">mrp.bom</field>
             <field name="domain">[('id','=',active_id)]</field>
             <field name="view_type">tree</field>
+            <field name="view_mode">tree</field>
             <field name="view_id" ref="mrp_bom_tree_view"/>
         </record>
         <record id="ir_BOM_structure" model="ir.values">
             <field eval="'mrp.bom'" name="model"/>
             <field name="name">Bill of Materials Structure</field>
             <field eval="'ir.actions.act_window,'+str(action2)" name="value"/>
-            <field eval="True" name="object"/>
         </record>
 
         <record id="mrp_bom_revision_tree" model="ir.ui.view">
             <field name="type">form</field>
             <field name="arch" type="xml">
                 <form string="Manufacturing Orders">
-                    <group colspan="4" col="6">
+                    <group colspan="4" col="7">
                         <field name="name" string="Reference"/>
                         <field name="date_planned"/>
                         <field name="origin"/>
+                        <newline/>
                         <field name="product_id" on_change="product_id_change(product_id)"/>
                         <field name="product_qty"/>
-                        <group colspan="2" col="4">
                         <field name="product_uom"/>
                         <button type="action"
                             icon="terp-accessories-archiver+"
                             name="%(mrp.action_change_production_qty)d"
                             string="Change Qty" states="ready,confirmed" />
-                        </group>
                         <label string="" colspan="2"/>
                         <field name="product_uos_qty" groups="product.group_uos"/>
                         <field name="product_uos" groups="product.group_uos"/>
 
                             <field colspan="2" name="move_lines" nolabel="1" widget="one2many_list"
                                 mode="tree,form" height="275" domain="[('state','&lt;&gt;', ('done', 'cancel'))]">
-                                <tree colors="blue:state in ('draft');black:state in ('picking_except','confirmed','ready','in_production');gray:state in ('cancel','done') " string="Products to Consume">
+                                <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_uom"  string="UOM"/>
                                         string="Consume Products" type="action"
                                         icon="gtk-go-forward" context="{'consume': True}"
                                         states="draft,waiting,confirmed,assigned" />
+                                    <button
+                                           name="%(stock.track_line)d"
+                                           string="Split in production lots"
+                                           type="action" icon="gtk-justify-fill"
+                                           states="draft,waiting,confirmed,assigned" />
                                     <button name="%(stock.move_scrap)d"
                                         string="Scrap Products" type="action"
                                         icon="gtk-convert" context="{'scrap': True}"
 
                             <field colspan="2" name="move_lines2" nolabel="1"  domain="[('state','in', ('done', 'cancel'))]"
                                        widget="one2many_list" mode="tree,form" height="275">
-                                   <tree colors="red:scrapped==True;blue:state in('draft');black:state in('picking_except','confirmed','ready','in_production');gray:state in('cancel') " string="Consumed Products" editable="bottom">
+                                   <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_uom" readonly="1" string="UOM"/>
-                                       <field name="location_dest_id"  readonly="1" string="Destination Loc."/>
                                        <field name="prodlot_id" context="{'product_id': product_id}"/>
                                        <field name="state" invisible="1"/>
                                        <field name="scrapped" invisible="1"/>
                                        <button
-                                           name="%(stock.track_line)d"
-                                           string="Split in production lots"
-                                           type="action" icon="gtk-justify-fill"
-                                           states="done,cancel" />
-                                       <button
                                            name="%(stock.move_scrap)d"
                                            string="Scrap Products" type="action"
                                            icon="gtk-convert"
                                </field>
                             <separator colspan="4"/>
                             <group col="9" colspan="4">
-                                <field name="state"/>
-                                <button name="button_cancel" states="draft,ready,confirmed,in_production,picking_except" string="Cancel" icon="gtk-stop"/>
+                                <field name="state" widget="statusbar" statusbar_visible="draft,ready,in_production,done" statusbar_colors='{"picking_except":"red","confirmed":"blue"}'/>
+                                <button name="button_cancel" states="draft,ready,in_production,picking_except" string="Cancel" icon="gtk-stop"/>
+                                <button name="action_cancel" type="object" states="confirmed" string="Cancel" icon="gtk-stop"/>
                                 <button name="button_confirm" states="draft" string="Confirm Production" icon="gtk-apply"/>
                                 <button name="button_produce" states="ready" string="Start Production" icon="terp-gtk-jump-to-ltr"/>
                                 <button name="%(act_mrp_product_produce)d" states="in_production" string="Produce" icon="gtk-ok" type="action"/>
                                     <field name="product_id" />
                                     <field name="product_qty"  string="Qty"/>
                                     <field name="product_uom"  string="UOM"/>
-                                    <field name="location_id"  string="Source Loc." />
                                     <field name="state" invisible="1"/>
-                                    <button name="%(stock.action_partial_move)d"
+                                    <button name="%(stock.action_partial_move_server)d"
                                         string="Partial"
                                         type="action" states="confirmed,assigned"
                                         icon="gtk-justify-fill"/>
 
                             <field colspan="2" name="move_created_ids2" nolabel="1"  domain="[('state','in', ('done', 'cancel'))]"
                                        widget="one2many_list" mode="tree,form" height="275">
-                                   <tree colors="red:scrapped==True;blue:state in('draft');black:state in('picking_except','confirmed','ready','in_production');gray:state in('cancel','done') " string="Finished Products">
+                                   <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_uom" readonly="1" string="UOM"/>
                             <button name="action_compute" states="draft"
                                 string="Compute Data" type="object"
                                 icon="terp-stock_format-scientific"
-                                colspan="4" />
+                                colspan="2" />
                             <field colspan="4" name="workcenter_lines" nolabel="1">
                                 <form string="Production Work Centers">
                                     <field colspan="4" name="name"/>
                             <button name="action_compute" states="draft"
                                 string="Compute Data" type="object"
                                 icon="terp-stock_format-scientific"
-                                colspan="4" />
+                                colspan="2" />
                             <field colspan="4" name="product_lines" nolabel="1" widget="one2many_list"/>
                         </page>
                         <page string="Extra Information">
+                            <field name="user_id"/>
                             <field name="company_id" groups="base.group_multi_company" widget="selection"/>
                             <field name="priority" groups="base.group_extended"/>
                             <newline/>
             <field name="type">search</field>
             <field name="arch" type="xml">
                 <search string="Search Production">
-                   <group col='9' colspan='4'>
-                       <filter icon="terp-camera_test" string="Ready"
+                   <group>
+                       <filter icon="terp-gtk-media-pause" string="Pending" name="pending"
+                           domain="[('state','=','confirmed')]"
+                           help="Manufacturing Orders which are waiting for raw materials."/>
+                       <filter icon="terp-camera_test" string="Ready" name="ready"
                            domain="[('state','=','ready')]"
-                           help="Non confirmed manufacturing orders"/>
-                       <filter icon="terp-check" string="Current" name="current"
-                           domain="[('state','in',('confirmed','ready','exception','in_production'))]"
-                           help="Manufacturing Orders which are waiting for raw materials, confirmed, ready to start or currently in production."/>
+                           help="Manufacturing Orders which are ready to start production."/>
+                       <filter icon="terp-check" string="In Production" name="inprogress"
+                           domain="[('state','=','in_production')]"
+                           help="Manufacturing Orders which are currently in production."/>
                        <separator orientation="vertical"/>
                        <filter icon="terp-gnome-cpu-frequency-applet+" string="Late"
-                           domain="['&amp;', ('date_planned::date','&lt;', current_date), ('state', 'in', ('draft', 'confirmed', 'ready'))]"
+                           domain="['&amp;', ('date_planned','&lt;', current_date), ('state', 'in', ('draft', 'confirmed', 'ready'))]"
                            help="Production started late" />
                        <separator orientation="vertical"/>
                        <field name="name"/>
                        <field name="origin"/>
                     </group>
                     <newline/>
-                    <group expand="0" string="Group By..." colspan="10" col="8" groups="base.group_extended">
+                    <group expand="0" string="Group By..." groups="base.group_extended">
                         <filter string="Product" icon="terp-accessories-archiver" domain="[]" context="{'group_by':'product_id'}"/>
                         <separator orientation="vertical"/>
                         <filter string="Routing" icon="terp-stock_align_left_24" domain="[]" context="{'group_by':'routing_id'}" groups="base.group_extended"/>
             <field name="view_mode">tree,form,calendar,graph,gantt</field>
             <field name="view_id" eval="False"/>
             <field name="search_view_id" ref="view_mrp_production_filter"/>
-            <field name="context">{'search_default_current':1}</field>
+            <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>
         <menuitem action="mrp_production_action" id="menu_mrp_production_action"
                </data>
             </field>
         </record>
+
+        <act_window
+            context="{'search_default_product_id': [active_id]}"
+            id="act_product_manufacturing_open"
+            name="Manufacturing Orders"
+            view_id="mrp_production_tree_view"
+            res_model="mrp.production"
+            src_model="product.product"/>
+
         <act_window
             id="action_product_bom_structure"
             name="Product BoM Structure"
             domain="[('product_id', '=', active_id),('bom_id','=',False)]"
+            context="{'default_product_id': active_id}"
             view_type="tree"
+            view_mode="tree"
             view_id="mrp_bom_tree_view"
             res_model="mrp.bom"
             src_model="product.product"
             <field name="view_type">form</field>
             <field name="view_id" ref="mrp_workcenter_tree_view"/>
             <field name="search_view_id" ref="view_mrp_workcenter_search"/>
-            <field name="help">Work Centers allow you to create and manage manufacturing units consisting of one or more persons and/or machines that can be considered as a unit for capacity and planning forecasting.</field>
+            <field name="help">Work Centers allow you to create and manage manufacturing units.  They consist of workers and/or machines, which are considered as units for capacity and planning forecast.  Keep in mind that the working time and resource leave are not taken into account in the time computation of the work center.</field>
         </record>
 
         <menuitem id="menu_pm_resources_config" name="Resources" parent="menu_mrp_configuration"/>
         <!-- Planning -->
 
         <menuitem id="menu_mrp_planning" name="Planning"
-                       parent="base.menu_mrp_root" sequence="2"
-                       groups="base.group_extended"/>
-               <menuitem action="mrp.mrp_production_action_planning"
-                       id="menu_mrp_production_order_action"
-                       parent="menu_mrp_planning" sequence="1"
-                       groups="base.group_extended"/>
+                parent="base.menu_mrp_root" sequence="2"
+                groups="base.group_extended"/>
+        <menuitem action="mrp.mrp_production_action_planning"
+                id="menu_mrp_production_order_action"
+                parent="menu_mrp_planning" sequence="1"/>
 
     </data>
 </openerp>