diff options
| author | Quentin (OpenERP) <qdp-launchpad@openerp.com> | 2013-02-20 09:27:07 +0100 |
|---|---|---|
| committer | Quentin (OpenERP) <qdp-launchpad@openerp.com> | 2013-02-20 09:27:07 +0100 |
| commit | 7daccf507424617412cf4b8fc3b4e1ed2fc89171 (patch) | |
| tree | 88fa48119c0a8b57946a5e4210bf719ed9b280e3 | |
| parent | 17fae74958a324bf90bfea17a7216b04b92d5dce (diff) | |
[IMP] product: re-enabled the multi variant feature
bzr revid: qdp-launchpad@openerp.com-20130220082707-x6r4pwcscmymkrz2
| -rw-r--r-- | addons/product/product_view.xml | 44 | ||||
| -rw-r--r-- | addons/sale/res_config.py | 3 | ||||
| -rw-r--r-- | addons/sale/res_config_view.xml | 4 | ||||
| -rw-r--r-- | addons/stock/res_config.py | 3 | ||||
| -rw-r--r-- | addons/stock/res_config_view.xml | 4 |
5 files changed, 42 insertions, 16 deletions
diff --git a/addons/product/product_view.xml b/addons/product/product_view.xml index 3e360594b19..6c82b4a2027 100644 --- a/addons/product/product_view.xml +++ b/addons/product/product_view.xml @@ -38,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"/> @@ -90,11 +89,6 @@ <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"/> - </group> </group> <field name="description" placeholder="describe the product characteristics..."/> </page> @@ -615,6 +609,7 @@ </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> @@ -623,7 +618,7 @@ <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"/> @@ -631,22 +626,53 @@ </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','<>', 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> diff --git a/addons/sale/res_config.py b/addons/sale/res_config.py index a693fd11024..9a9f093a7b4 100644 --- a/addons/sale/res_config.py +++ b/addons/sale/res_config.py @@ -55,6 +55,9 @@ Example: 10% for retailers, promotion of 5 EUR on this product, etc."""), 'group_discount_per_so_line': fields.boolean("Allow setting a discount on the sales order lines", implied_group='sale.group_discount_per_so_line', help="Allows you to apply some discount per sales order line."), + 'group_product_variant': fields.boolean("Support multiple variants per products ", + implied_group='product.group_product_variant', + help="""Allow to manage several variants per product. As an example, if you sell T-Shirts, for the same "Linux T-Shirt", you may have variants on sizes or colors; S, M, L, XL, XXL."""), 'module_warning': fields.boolean("Allow configuring alerts by customer or products", help="""Allow to configure notification on products and trigger them when a user wants to sale a given product or a given customer. Example: Product: this product is deprecated, do not purchase more than 5. diff --git a/addons/sale/res_config_view.xml b/addons/sale/res_config_view.xml index b150fb276b7..9d5b5d071fc 100644 --- a/addons/sale/res_config_view.xml +++ b/addons/sale/res_config_view.xml @@ -69,6 +69,10 @@ <field name="group_discount_per_so_line" class="oe_inline"/> <label for="group_discount_per_so_line"/> </div> + <div> + <field name="group_product_variant" class="oe_inline"/> + <label for="group_product_variant"/> + </div> </div> </group> </group> diff --git a/addons/stock/res_config.py b/addons/stock/res_config.py index 4c15fcf1732..d0b0563875c 100644 --- a/addons/stock/res_config.py +++ b/addons/stock/res_config.py @@ -69,9 +69,6 @@ This installs the module product_expiry."""), implied_group='stock.group_locations', help="""This allows to configure and use multiple stock locations and warehouses, instead of having a single default one."""), - 'group_product_variant': fields.boolean("Support multiple variants per products ", - implied_group='product.group_product_variant', - help="""Allow to manage several variants per product. As an example, if you sell T-Shirts, for the same "Linux T-Shirt", you may have variants on sizes or colors; S, M, L, XL, XXL."""), 'decimal_precision': fields.integer('Decimal precision on weight', help="As an example, a decimal precision of 2 will allow weights like: 9.99 kg, whereas a decimal precision of 4 will allow weights like: 0.0231 kg."), } diff --git a/addons/stock/res_config_view.xml b/addons/stock/res_config_view.xml index 3de3104a970..133e6ffa875 100644 --- a/addons/stock/res_config_view.xml +++ b/addons/stock/res_config_view.xml @@ -91,10 +91,6 @@ <field name="group_uos" class="oe_inline"/> <label for="group_uos" /> </div> - <div invisible="1"> - <field name="group_product_variant" class="oe_inline"/> - <label for="group_product_variant"/> - </div> </div> </group> </form> |
