[MERGE] forward port of branch 8.0 up to e883193
[odoo/odoo.git] / addons / mrp / mrp_view.xml
index a91d6ef..b9e5aaf 100644 (file)
             <field name="model">mrp.property.group</field>
             <field name="arch" type="xml">
                 <form string="Properties categories">
-                    <label for="name"/>
-                    <field name="name"/>
-                    <label for="description"/>
-                    <field name="description"/>
+                    <group>
+                        <field name="name"/>
+                    </group>
+                    <separator string="Description"/>
+                    <field name="description" nolabel="1"/>
                 </form>
             </field>
         </record>
             parent="base.menu_mrp_root"
             groups="group_mrp_manager"
             sequence="50"/>
+        <menuitem
+            id="menu_mrp_configuration_manufacturing"
+            name="Manufacturing"
+            parent="menu_mrp_configuration"
+            groups="group_mrp_manager"
+            sequence="1"/>
+        <menuitem
+            id="menu_mrp_configuration_products"
+            name="Products"
+            parent="menu_mrp_configuration"
+            groups="group_mrp_manager"
+            sequence="2"/>
+
+
 
         <record id="mrp_property_tree_view" model="ir.ui.view">
             <field name="name">mrp.property.tree</field>
@@ -84,8 +99,8 @@
                         <field name="group_id"/>
                         <field name="composition"/>
                     </group>
-                    <label for="description"/>
-                    <field name="description"/>
+                    <separator string="Description"/>
+                    <field name="description" nolabel="1"/>
                 </form>
             </field>
         </record>
             action="mrp_property_action"
             id="menu_mrp_property_action"
             groups="product.group_mrp_properties"
-            parent="menu_mrp_configuration"
+            parent="menu_mrp_configuration_products"
             sequence="30"/>
         <menuitem
             action="mrp_property_group_action"
-            parent="menu_mrp_configuration"
+            parent="menu_mrp_configuration_products"
             groups="base.group_no_one,product.group_mrp_properties"
             id="menu_mrp_property_group_action"
             sequence="35"/>
                                     <field name="costs_general_account_id" attrs="{ 'required':['|',('costs_cycle_account_id', '=', True),('costs_hour_account_id', '=', True)]}" groups="analytic.group_analytic_accounting"/>
                                 </group>
                             </group>
-                            <label for="note"/>
-                            <field name="note"/>
+                            <separator string="Description"/>
+                            <field name="note" nolabel="1"/>
                         </page>
                     </notebook>
                 </form>
                         <group>
                             <field name="product_tmpl_id" on_change="onchange_product_tmpl_id(product_tmpl_id, product_qty, context)"/>
                             <field name="product_id"/>
-                            <field name="product_uom" class="oe_inline" on_change="onchange_uom(product_tmpl_id, product_uom)" groups="product.group_uom"/>
                             <label for="product_qty" string="Quantity"/>
                             <div>
                                 <field name="product_qty" class="oe_inline" on_change="onchange_product_tmpl_id(product_tmpl_id, product_qty, context)"/>
                         <group>
                             <field name="name" groups="product.group_mrp_properties"/>
                             <field name="code" string="Reference"/>
-                            <field name="type"/>
+                            <field name="type" widget="radio"/>
                             <p colspan="2" class="oe_grey" attrs="{'invisible': [('type','=','normal')]}">
                                 When processing a sales order for this product, the delivery order
                                 will contain the raw materials, instead of the finished product.
                                 <tree string="Components" editable="bottom">
                                     <field name="sequence" widget="handle"/>
                                     <field name="product_id" on_change="onchange_product_id(product_id, product_qty)"/>
-                                    <field name="type"/>
+                                    <field name="type" groups="mrp.group_route_line_type"/>
                                     <field name="product_qty"/>
-                                    <field name="product_rounding"/>
-                                    <field name="product_efficiency"/>
                                     <field name="product_uom" on_change="onchange_uom(product_id, product_uom)" groups="product.group_uom"/>
+                                    <field name="product_rounding" groups="mrp.group_rounding_efficiency"/>
+                                    <field name="product_efficiency" groups="mrp.group_rounding_efficiency"/>
                                     <field name="date_start"/>
                                     <field name="date_stop"/>
-                                    <field name="routing_id"/>
                                     <field name="attribute_value_ids" widget="many2many_tags"/>
                                 </tree>
                             </field>
 
        <record id="mrp_bom_tree_view" model="ir.ui.view">
             <field name="name">mrp.bom.tree</field>
-            <field name="model">mrp.bom</field>
-            <!--field name="field_parent">child_complete_ids</field-->
+            <field name="model">mrp.bom.line</field>
+            <field name="field_parent">child_line_ids</field>
             <field name="arch" type="xml">
                 <tree string="Bill of Materials">
                     <field name="sequence" invisible="1"/>
-                    <field name="name" invisible="1"/>
-                    <field name="product_tmpl_id"/>
                     <field name="product_id"/>
                     <field name="product_uom" groups="product.group_uom"/>
-                    <field name="code"/>
                     <field name="type"/>
                     <field name="routing_id" groups="mrp.group_mrp_routings"/>
                     <field name="date_start"/>
             <field name="name">Bill of Materials</field>
             <field name="type">ir.actions.act_window</field>
             <field name="res_model">mrp.bom</field>
+            <field name="domain">[]</field> <!-- force empty -->
             <field name="view_type">form</field>
             <field name="search_view_id" ref="view_mrp_bom_filter"/>
             <field name="help" type="html">
             </field>
         </record>
 
-       <record id="mrp_bom_component_tree_view" model="ir.ui.view">
+        <record id="mrp_bom_component_tree_view" model="ir.ui.view">
             <field name="name">mrp.bom.component.tree</field>
             <field name="model">mrp.bom.line</field>
             <field name="arch" type="xml">
             </field>
         </record>
 
-        <record id="mrp_bom_form_action2" model="ir.actions.act_window">
-            <field name="name">Bill of Material Components</field>
-            <field name="type">ir.actions.act_window</field>
-            <field name="res_model">mrp.bom.line</field>
-            <field name="view_type">tree</field>
-            <field name="view_mode">tree</field>
-            <field name="help" type="html">
-              <p class="oe_view_nocontent_create">
-                Click to add a component to a bill of material.
-              </p><p>
-                Bills of materials components are components and by-products
-                used to create master bills of materials.  Use this menu to
-                search in which BoM a specific component is used.
-              </p>
-            </field>
-        </record>
-
         <record id="product_template_search_view_procurment" model="ir.ui.view">
              <field name="name">product.template.search.bom</field>
              <field name="model">product.template</field>
             action="mrp_bom_form_action"
             id="menu_mrp_bom_form_action"
             parent="menu_mrp_bom"
-            sequence="10"/>
+            sequence="99"/>
        <menuitem name="Products" 
             id="menu_mrp_product_form" 
             action="product_template_action"
             parent="menu_mrp_bom"/>
-        <menuitem
-            action="mrp_bom_form_action2"
-            id="menu_mrp_bom_form_action2"
-            parent="menu_mrp_configuration"
-            sequence="20"/>
 
         <record id="action2" model="ir.actions.act_window">
             <field name="name">Bill of Materials Structure</field>
             <field name="type">ir.actions.act_window</field>
-            <field name="res_model">mrp.bom</field>
-            <field name="domain">[('id', 'in', active_ids)]</field>
+            <field name="res_model">mrp.bom.line</field>
+            <field name="domain">[('bom_id', 'in', active_ids)]</field>
             <field name="view_type">tree</field>
             <field name="view_id" ref="mrp_bom_tree_view"/>
             <field name="view_type">tree</field>
                                     <field name="move_lines" nolabel="1" options="{'reload_on_button': true}">
                                         <tree colors="blue:state == 'draft';black:state in ('ready','assigned','in_production');gray:state in ('cancel','done');red:state in ('confirmed','waiting')" string="Products to Consume">
                                             <field name="product_id"/>
-                                            <field name="product_qty"  string="Quantity"/>
+                                            <field name="product_uom_qty"  string="Quantity"/>
                                             <field name="product_uom" string="Unit of Measure" groups="product.group_uom"/>
                                             <field name="state" invisible="1"/>
                                             <button name="%(mrp.move_consume)d"
                                        <tree colors="red:scrapped==True;blue:state == 'draft';black:state in ('confirmed','ready','in_production');gray:state == 'cancel' " string="Consumed Products" editable="bottom">
                                            <field name="product_id" readonly="1"/>
                                            <field name="restrict_lot_id" context="{'product_id': product_id}" groups="stock.group_production_lot"/>
-                                           <field name="product_qty" readonly="1"/>
+                                           <field name="product_uom_qty" readonly="1"/>
                                            <field name="product_uom" readonly="1" string="Unit of Measure" groups="product.group_uom"/>
                                            <field name="state" invisible="1"/>
                                            <field name="scrapped" invisible="1"/>
                                     <field name="move_created_ids" nolabel="1" options="{'reload_on_button': true}">
                                         <tree string="Products to Finish">
                                             <field name="product_id"/>
-                                            <field name="product_qty"/>
+                                            <field name="product_uom_qty"/>
                                             <field name="product_uom"  string="Unit of Measure" groups="product.group_uom"/>
                                             <field name="state" invisible="1"/>
-                                            <!--TODO: should have a partial picking here-->
                                         </tree>
                                     </field>
                                 </group>
                                     <field name="move_created_ids2" nolabel="1" options="{'reload_on_button': true}">
                                         <tree colors="red:scrapped==True;blue:state == 'draft';black:state in('confirmed','ready','in_production');gray:state in('cancel','done') " string="Finished Products">
                                             <field name="product_id" readonly="1"/>
-                                            <field name="product_qty" readonly="1"/>
+                                            <field name="product_uom_qty" readonly="1"/>
                                             <field name="restrict_lot_id" groups="stock.group_production_lot"/>
                                             <field name="product_uom" readonly="1" string="Unit of Measure" groups="product.group_uom"/>
                                             <field name="location_dest_id"  readonly="1" string="Destination Loc." widget="selection" groups="stock.group_locations"/>
             </field>
         </record>
 
-        <menuitem id="menu_pm_resources_config" name="Resources" parent="menu_mrp_configuration"/>
-        <menuitem action="mrp_workcenter_action" id="menu_view_resource_search_mrp" groups="mrp.group_mrp_routings" parent="mrp.menu_mrp_configuration" sequence="25"/>
+        <menuitem id="menu_pm_resources_config" name="Resources" parent="menu_mrp_configuration" sequence="3"/>
+        <menuitem action="mrp_workcenter_action" id="menu_view_resource_search_mrp" groups="mrp.group_mrp_routings" parent="mrp.menu_mrp_configuration_manufacturing" sequence="25"/>
         <menuitem action="resource.action_resource_calendar_form" id="menu_view_resource_calendar_search_mrp" parent="menu_pm_resources_config" sequence="1" groups="base.group_no_one"/>
         <menuitem action="resource.action_resource_calendar_leave_tree" id="menu_view_resource_calendar_leaves_search_mrp" parent="menu_pm_resources_config" sequence="1" groups="base.group_no_one"/>
 
             <field name="context">{'default_product_id': active_id, 'search_default_product_id': active_id}</field>
             <field name="name">Bill of Materials</field>
             <field name="res_model">mrp.bom</field>
+            <field name="domain">[]</field> <!-- Force empty -->
             <field name="view_type">form</field>
         </record>
 
             <field name="name">product.template.procurement</field>
             <field name="model">product.template</field>
             <field name="inherit_id" ref="product.product_template_only_form_view"/>
+            <field name="groups_id" eval="[(4, ref('mrp.group_mrp_user'))]"/>
             <field name="arch" type="xml">
                 <div name="buttons" position="inside">
                     <button class="oe_inline oe_stat_button" name="%(template_open_bom)d" type="action"
-                        groups="mrp.group_mrp_user" attrs="{'invisible':[('type', '=', 'service')]}" icon="fa-flask">
+                        attrs="{'invisible':[('type', '=', 'service')]}" icon="fa-flask">
                         <field string="Bill of Materials" name="bom_count" widget="statinfo" />
                     </button>
                     <button class="oe_inline oe_stat_button" name="action_view_mos" type="object" 
-                        groups="mrp.group_mrp_user" attrs="{'invisible':[('type', '=', 'service')]}" icon="fa-list-alt">
+                        attrs="{'invisible':[('type', '=', 'service')]}" icon="fa-list-alt">
                         <field string="Manufacturing" name="mo_count" widget="statinfo" />
                     </button>
                 </div>
             <field name="name">product.product.procurement</field>
             <field name="model">product.product</field>
             <field name="inherit_id" ref="product.product_normal_form_view"/>
+            <field name="groups_id" eval="[(4, ref('mrp.group_mrp_user'))]"/>
             <field name="arch" type="xml">
                 <div name="buttons" position="inside">
                     <button class="oe_inline oe_stat_button" name="action_view_bom" type="object" 
-                        groups="mrp.group_mrp_user" attrs="{'invisible':[('type', '=', 'service')]}" icon="fa-flask">
+                        attrs="{'invisible':[('type', '=', 'service')]}" icon="fa-flask">
                         <field string="Bill of Materials" name="bom_count" widget="statinfo" />
                     </button>
                     <button class="oe_inline oe_stat_button" name="%(act_product_mrp_production)d" type="action" 
-                        groups="mrp.group_mrp_user" attrs="{'invisible':[('type', '=', 'service')]}" icon="fa-list-alt">
+                        attrs="{'invisible':[('type', '=', 'service')]}" icon="fa-list-alt">
                         <field string="Manufacturing" name="mo_count" widget="statinfo" />
                     </button>
                 </div>