From 0a6d63b82cc4af3da3a1980374baa794b0c1f231 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Fri, 11 Jul 2014 16:22:52 +0200 Subject: [PATCH] [FIX] product: unfuck templates and products in views product.product reuses most of the product.template views however some parts need to be excluded or replaced. Instead of adding template only parts in base view and removing it for product, split the views in 'common' (product_template_form_view), 'template only' (product_template_only_form_view) and 'product only' (product_normal_form_view) where the first is inherited by the other two. The attribute mode='primary' on both second views allows to make sure that future inheritance of product_template_form_view and product_template_only_form_view will work with the full rendered product_template_form_view view. This allows us to have valid buttons in crm for bill of material (filters based on active_id). Also cleaning the mess with circular dependencies. --- addons/mrp/mrp_view.xml | 29 +++- addons/product/product_view.xml | 248 +++++++++++++++----------------- 2 files changed, 143 insertions(+), 134 deletions(-) diff --git a/addons/mrp/mrp_view.xml b/addons/mrp/mrp_view.xml index 52e0f539b80..0d0c1b3c4f9 100644 --- a/addons/mrp/mrp_view.xml +++ b/addons/mrp/mrp_view.xml @@ -422,7 +422,8 @@ - + + @@ -1032,12 +1033,19 @@ id="menu_mrp_production_order_action" name="Order Planning" parent="menu_mrp_planning" sequence="1"/> - + {'default_product_tmpl_id': active_id, 'search_default_product_tmpl_id': active_id} Bill of Materials mrp.bom form + + {'default_product_id': active_id, 'search_default_product_id': active_id} + Bill of Materials + mrp.bom + form + + {'search_default_product_id': [active_id]} Manufacturing Orders @@ -1047,10 +1055,23 @@ product.template.procurement product.template - +
- +
+
+
+ + product.product.procurement + product.product + + +
+ diff --git a/addons/product/product_view.xml b/addons/product/product_view.xml index 510c21ed88d..6f282a622be 100644 --- a/addons/product/product_view.xml +++ b/addons/product/product_view.xml @@ -40,8 +40,9 @@ + - product.template.product.form + product.template.common.form product.template
@@ -128,14 +129,6 @@ - - - - - - - -
@@ -146,6 +139,116 @@ + + product.product.search + product.product + primary + + + + + + + + + + + + + + + + + + + + + variants.template.tree + product.attribute.value + + + + + + + + + + + Variant Values + ir.actions.act_window + product.attribute.value + tree + form + [('product_ids.product_tmpl_id', '=', active_id)] + {'default_product_tmpl_id': active_id} + + + + Product Variants + ir.actions.act_window + product.product + tree,form,kanban + form + + +

+ Click to define a new product. +

+ You must define a product for everything you buy or sell, + whether it's a physical product, a consumable or service. +

+
+
+ + Product Variants + ir.actions.act_window + product.product + tree,form,kanban + form + {'search_default_product_tmpl_id': [active_id], 'default_product_tmpl_id': active_id} + + +

+ Click to define a new product. +

+ You must define a product for everything you buy or sell, + whether it's a physical product, a consumable or service. +

+
+
+ + + + + product.template.product.form + product.template + primary + + + + + Product Template + + + +
+ +
+ + + + + + +
+
+
+
+ Product.template.product.kanban product.template @@ -153,6 +256,9 @@ + + +
@@ -163,6 +269,9 @@ + + Variants +
  • Price:
  • @@ -188,56 +297,10 @@ id="menu_product_template_action" parent="base.menu_product" sequence="1" /> - - - - variants.template.tree - product.attribute.value - - - - - - - - - - - - Variant Values - ir.actions.act_window - product.attribute.value - tree - form - [('product_ids.product_tmpl_id', '=', active_id)] - {'default_product_tmpl_id': active_id} - - - - product.product.search - product.product - primary - - - - - - - - - - - - - - - - - product.product.tree product.product @@ -279,8 +342,6 @@ - - @@ -316,79 +377,6 @@ - - Product Variants - ir.actions.act_window - product.product - tree,form,kanban - form - - -

    - Click to define a new product. -

    - You must define a product for everything you buy or sell, - whether it's a physical product, a consumable or service. -

    -
    -
    - - - - - Product Variants - ir.actions.act_window - product.product - tree,form,kanban - form - {'search_default_product_tmpl_id': [active_id], 'default_product_tmpl_id': active_id} - - -

    - Click to define a new product. -

    - You must define a product for everything you buy or sell, - whether it's a physical product, a consumable or service. -

    -
    -
    - - - product.template.form - product.template - - - -
    - -
    -
    -
    -
    - - - product.template.form - product.template - - - - - - - -

    - - Variants - -

    -
    -
    - - - product.attribute.tree product.attribute