[MERGE] from trunk
[odoo/odoo.git] / addons / product / product_view.xml
index edec2ea..0256b9f 100644 (file)
                    <filter string="Consumable" name="consumable" icon="terp-accessories-archiver" domain="[('type','=','consu')]" help="Consumable products"/>
                    <separator/>
                    <filter string="Can be Sold" name="filter_to_sell" icon="terp-accessories-archiver-minus" domain="[('sale_ok','=',1)]"/>
-                   <filter name="filter_to_purchase" string="Can be Purchased" icon="terp-accessories-archiver+" domain="[('purchase_ok', '=', 1)]"/>
                    <field name="categ_id"/>
                    <group expand="0" string="Context...">
-                       <field name="pricelist_id" context="{'pricelist': self}" groups="product.group_sale_pricelist"/>
+                       <field name="pricelist_id" context="{'pricelist': self}" filter_domain="[]" groups="product.group_sale_pricelist"/>
                        <field name="company_id" groups="base.group_multi_company"/>
                    </group>
                    <group  expand='0' string='Group by...'>
@@ -39,7 +38,6 @@
                     <field name="name"/>
                     <field name="categ_id" invisible="1"/>
                     <field name="type" invisible="1"/>
-                    <field name="variants" groups="product.group_product_variant"/>
                     <field name="uom_id" string="Unit of Measure" groups="product.group_uom"/>
                     <field name="qty_available"/>
                     <field name="virtual_available"/>
                                         <div name="ean">
                                             <field name="ean13" placeholder="e.g. 5901234123457"/>
                                         </div>
-                                    </group>
-                                    <group>
-                                        <field groups="product.group_product_variant" name="variants"/>
-                                        <field name="price_margin" groups="product.group_product_variant"/>
-                                        <field name="price_extra" groups="product.group_product_variant"/>
+                                        <field name="company_id" groups="base.group_multi_company" widget="selection"/>
                                     </group>
                                 </group>
-                                <field name="description" placeholder="describe the product's characteristics for internal use..."/>
+                                <field name="description" placeholder="describe the product characteristics..."/>
                             </page>
                             <page string="Procurements" groups="base.group_user">
                                 <group name="procurement">
                                         <field name="cost_method" groups="product.group_costing_method"/>
                                         <field name="standard_price" attrs="{'readonly':[('cost_method','=','average')]}"/>
                                     </group>
-                                    <group name="procurement_uom" groups="product.group_uom">
+                                    <group name="procurement_uom" groups="product.group_uom" string="Purchase">
                                         <field name="uom_po_id"/>
                                     </group>
                                 </group>
-                                <separator string="Notes for Suppliers"/>
+                                <separator string="Description for Suppliers"/>
                                 <field name="description_purchase" placeholder="This note will be displayed on requests for quotation..."/>
                             </page>
                             <page string="Inventory" groups="base.group_user">
                                 <group name="inventory">
                                     <group name="status" string="Status">
                                         <field name="state"/>
-                                        <field name="product_manager"/>
+                                        <field name="product_manager"
+                                        context="{'default_groups_ref': ['base.group_user', 'base.group_partner_manager', 'base.group_sale_manager']}"/>
                                     </group>
                                     <group name="Weights" groups="product.group_stock_packaging" string="Weights">
                                         <field digits="(14, 3)" name="volume" attrs="{'readonly':[('type','=','service')]}"/>
                                     </group>
                                 </group>
                             </page>
-                            <page string="Sales" attrs="{'readonly':[('sale_ok','=',0)]}">
+                            <page string="Sales" attrs="{'invisible':[('sale_ok','=',False)]}">
                                 <group name="sale">
                                     <group string="Sale Conditions">
                                         <label for="warranty"/>
                                         <field name="name"/>
                                     </form>
                                 </field>
-                                <separator string="Notes on Quotations"/>
+                                <separator string="Description for Quotations"/>
                                 <field name="description_sale" placeholder="note to be displayed on quotations..."/>
                             </page>
                         </notebook>
                     </sheet>
                     <div class="oe_chatter">
-                        <field name="message_ids" widget="mail_thread"/>
                         <field name="message_follower_ids" widget="mail_followers"/>
+                        <field name="message_ids" widget="mail_thread"/>
                     </div>
                 </form>
             </field>
                 Click to define a new product.
               </p><p>
                 You must define a product for everything you buy or sell,
-                wether it's a physical product, a consumable or service.
+                whether it's a physical product, a consumable or service.
               </p>
             </field>
         </record>
               <p class="oe_view_nocontent_create">
                 Click to define a new product.
               </p><p>
-                You must define a product for everything you sell, wether it's
+                You must define a product for everything you sell, whether it's
                 a physical product, a consumable or a service you offer to
                 customers.
               </p><p>
               <p class="oe_view_nocontent_create">
                 Click to define a new product.
               </p><p>
-                You must define a product for everything you purchase, wheter
+                You must define a product for everything you purchase, whether
                 it's a physical product, a consumable or services you buy to
                 subcontractants.
               </p><p>
                             </h1>
                         </div>
                         <group>
-                            <group>
+                            <group name="parent" col="4">
                                 <field name="parent_id"/>
-                            </group>
-                            <group>
                                 <field name="type"/>
                             </group>
                         </group>
-                        <group name="basic">
-                            <group name="account_property" string="Account Properties"/>
-                            <group name="account_stock_property" string="Account Stock Properties"/>
-                        </group>
                     </sheet>
                 </form>
             </field>
                 <tree string="Units of Measure">
                     <field name="name"/>
                     <field name="category_id"/>
-                    <field name="factor"/>
                 </tree>
             </field>
         </record>
                         <group>
                             <field name="name"/>
                             <field name="category_id"/>
-                            <field name="active"/>
+                            <field name="uom_type" on_change="onchange_type(uom_type)"/>
+                            <label for="factor"/>
+                            <div>
+                                <field name="factor" attrs="{'invisible':[('uom_type','!=','smaller')]}"/>
+                                <field name="factor_inv" attrs="{'invisible':[('uom_type','!=','bigger')]}"/>
+                                <p attrs="{'invisible':[('uom_type','!=','smaller')]}" class="oe_grey">
+                                    e.g: 1 * (reference unit) = ratio * (this unit)
+                                </p>
+                                <p attrs="{'invisible':[('uom_type','!=','bigger')]}" class="oe_grey">
+                                    e.g: 1 * (this unit) = ratio * (reference unit)
+                                </p>
+                            </div>
                         </group>
                         <group>
-                            <field name="uom_type" on_change="onchange_type(uom_type)"/>
-                            <p attrs="{'invisible':[('uom_type','!=','smaller')]}" colspan="2">
-                                e.g: 1 * (reference unit) = ratio * (this unit)
-                            </p>
-                            <p attrs="{'invisible':[('uom_type','!=','bigger')]}" colspan="2">
-                                e.g: 1 * (this unit) = ratio * (reference unit)
-                            </p>
+                            <field name="active"/>
                             <field name="rounding"/>
-                            <field name="factor" attrs="{'invisible':[('uom_type','!=','smaller')]}"/>
-                            <field name="factor_inv" attrs="{'invisible':[('uom_type','!=','bigger')]}"/>
                         </group>
                     </group>
                 </form>
                         <field name="delay"/>
                         <field name="company_id" groups="base.group_multi_company" widget="selection"/>
                     </group>
-                    <field groups="product.group_sale_pricelist" name="pricelist_ids">
+                    <p groups="product.group_purchase_pricelist" class="oe_grey">The prices below will only be taken into account when your pricelist is set as based on supplier prices.</p>
+                    <field groups="product.group_purchase_pricelist" name="pricelist_ids">
                         <tree editable="bottom" string="Pricelist">
                             <field name="min_quantity"/>
                             <field name="price"/>
             </field>
         </record>
 
+        <!-- Variants -->
         <record id="product_variant_form_view" model="ir.ui.view">
             <field name="name">product.variant.form</field>
             <field name="model">product.product</field>
                     <group col="4">
                         <field name="product_tmpl_id"/>
                         <field name="active"/>
-                        <field name="variants"/>
+                        <field name="variants" required="1"/>
                         <field name="default_code"/>
                         <field name="price_margin"/>
                         <field name="price_extra"/>
                 </form>
             </field>
         </record>
-
         <record id="product_variant_tree_view" model="ir.ui.view">
             <field name="name">product.variant.tree</field>
             <field name="model">product.product</field>
             <field name="arch" type="xml">
                 <tree string="Product Variant">
                     <field name="product_tmpl_id"/>
-                    <field name="active"/>
                     <field name="variants"/>
                     <field name="default_code"/>
                     <field name="price_margin"/>
                     <field name="price_extra"/>
+                    <field name="company_id" invisible="1"/>
+                    <field name="type" invisible="1"/>
+                    <field name="uom_id" invisible="1"/>
+                    <field name="categ_id" invisible="1"/>
                 </tree>
             </field>
         </record>
+        <record id="product_variant_action" model="ir.actions.act_window">
+            <field name="name">Product Variants</field>
+            <field name="type">ir.actions.act_window</field>
+            <!--<field name="domain">[('variants','&lt;&gt;', False)]</field>-->
+            <field name="res_model">product.product</field>
+            <field name="view_type">form</field>
+            <field name="view_mode">tree,form,kanban</field>
+            <field name="view_id" ref="product_variant_tree_view"/>
+            <field name="search_view_id" ref="product_search_form_view"/>
+            <field name="help" type="html">
+              <p class="oe_view_nocontent_create">
+                Click to define a new variant of product.
+              </p>
+            </field>
+        </record>
+        <record id="tree_view_product_variant" model="ir.actions.act_window.view">
+            <field name="sequence" eval="10"/>
+            <field name="view_mode">tree</field>
+            <field name="view_id" ref="product_variant_tree_view"/>
+            <field name="act_window_id" ref="product_variant_action"/>
+        </record>
+        <record id="form_view_product_variant" model="ir.actions.act_window.view">
+            <field name="sequence" eval="20"/>
+            <field name="view_mode">form</field>
+            <field name="view_id" ref="product_variant_form_view"/>
+            <field name="act_window_id" ref="product_variant_action"/>
+        </record>
+        <menuitem action="product.product_variant_action" id="product.menu_variant_product" parent="base.menu_product" sequence="100" groups="product.group_product_variant"/>
 
+        <!-- templates -->
         <record id="product_template_tree_view" model="ir.ui.view">
             <field name="name">product.template.product.tree</field>
             <field name="model">product.template</field>
                             <group name="status" string="Status">
                                 <field name="categ_id"/>
                                 <field name="state"/>
-                                <field name="product_manager"/>
+                                <field name="product_manager" context="{'default_groups_ref': ['base.group_user', 'base.group_partner_manager', 'base.group_sale_manager']}"/>
                             </group>
 
                             <group name="uom" string="Unit of Measure">