[IMP] product: re-enabled the multi variant feature

bzr revid: qdp-launchpad@openerp.com-20130220082707-x6r4pwcscmymkrz2
This commit is contained in:
Quentin (OpenERP) 2013-02-20 09:27:07 +01:00
parent 17fae74958
commit 7daccf5074
5 changed files with 42 additions and 16 deletions

View File

@ -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','&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>

View File

@ -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.

View File

@ -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>

View File

@ -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."),
}

View File

@ -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>