diff --git a/addons/product/product.py b/addons/product/product.py index 3de28ba0e95..fb712636da0 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -789,7 +789,7 @@ class product_product(osv.osv): _description = "Product" _inherits = {'product.template': 'product_tmpl_id'} _inherit = ['mail.thread'] - _order = 'default_code,name_template' + _order = 'default_code' def _product_price(self, cr, uid, ids, name, arg, context=None): plobj = self.pool.get('product.pricelist') @@ -893,10 +893,6 @@ class product_product(osv.osv): def _is_product_variant_impl(self, cr, uid, ids, name, arg, context=None): return dict.fromkeys(ids, True) - def _get_name_template_ids(self, cr, uid, ids, context=None): - template_ids = self.pool.get('product.product').search(cr, uid, [('product_tmpl_id', 'in', ids)]) - return list(set(template_ids)) - def _get_image_variant(self, cr, uid, ids, name, args, context=None): result = dict.fromkeys(ids, False) for obj in self.browse(cr, uid, ids, context=context): @@ -971,10 +967,6 @@ class product_product(osv.osv): 'active': fields.boolean('Active', help="If unchecked, it will allow you to hide the product without removing it."), 'product_tmpl_id': fields.many2one('product.template', 'Product Template', required=True, ondelete="cascade", select=True, auto_join=True), 'barcode': fields.char('Barcode', help="International Article Number used for product identification.", oldname='ean13', copy=False), - 'name_template': fields.related('product_tmpl_id', 'name', string="Template Name", type='char', store={ - 'product.template': (_get_name_template_ids, ['name'], 10), - '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', ondelete='restrict'), 'is_product_variant': fields.function( _is_product_variant_impl, type='boolean', string='Is a product variant'), # image: all image fields are base64 encoded and PIL-supported