Backed out changeset 517314d6f865

This commit is contained in:
Bertrand Chenal
2009-05-26 13:35:54 +02:00
parent 5623cfc060
commit 4e56a0331a
-16
View File
@@ -39,13 +39,6 @@ class Template(ModelSQL, ModelView):
products = fields.One2Many('product.product', 'template', 'Products',
states=STATES)
def __init__(self):
super(Template, self).__init__()
self._error_messages.update({
'change_default_uom': 'You cannot change the default uom for a '\
'product which is associated to stock moves.',
})
def default_active(self, cursor, user, context=None):
return True
@@ -73,15 +66,6 @@ class Template(ModelSQL, ModelView):
res[product.id] = product[field]
return res
def write(self, cursor, user, ids, vals, context=None):
if vals.get("default_uom"):
templates = self.browse(cursor, user, ids, context=context)
for template in templates:
if template.default_uom.id != vals.get("default_uom"):
self.raise_user_error(cursor, 'change_default_uom')
super(Template, self).write(cursor, user, ids, vals, context=context)
def copy(self, cursor, user, ids, default=None, context=None):
if default is None:
default = {}