[FIX] product: is_product_variant is all time false. result: can not change ean because the field is hidden in the view. Need to overwrite the function field on product.product to have the real value (true for product.product)

This commit is contained in:
Christophe Matthieu 2014-09-29 17:12:49 +02:00 committed by Christophe Simonis
parent 4a46fce95a
commit 3986e8c509
1 changed files with 2 additions and 1 deletions

View File

@ -558,7 +558,7 @@ class product_template(osv.osv):
'active': fields.boolean('Active', help="If unchecked, it will allow you to hide the product without removing it."),
'color': fields.integer('Color Index'),
'is_product_variant': fields.function( _is_product_variant, type='boolean', string='Only one product variant'),
'is_product_variant': fields.function( _is_product_variant, type='boolean', string='Is product variant'),
'attribute_line_ids': fields.one2many('product.attribute.line', 'product_tmpl_id', 'Product Attributes'),
'product_variant_ids': fields.one2many('product.product', 'product_tmpl_id', 'Products', required=True),
@ -925,6 +925,7 @@ class product_product(osv.osv):
'product.product': (lambda self, cr, uid, ids, c=None: ids, [], 10),
}, select=True),
'attribute_value_ids': fields.many2many('product.attribute.value', id1='prod_id', id2='att_id', string='Attributes', readonly=True, ondelete='restrict'),
'is_product_variant': fields.function( _is_product_variant_impl, type='boolean', string='Is product variant'),
# image: all image fields are base64 encoded and PIL-supported
'image_variant': fields.binary("Variant Image",