Adapt signature of "def write()"

This commit is contained in:
jmartin 2014-05-20 16:56:25 +02:00
parent c6d10f0242
commit f622b56812

View file

@ -44,12 +44,15 @@ class Product:
return super(Product, cls).create(vlist)
@classmethod
def write(cls, products, vals):
super(Product, cls).write(products, vals)
for product in products:
if product.template.purchasable and not product.template.salable \
and not product.code:
if not vals.get('code'):
def write(cls, *args):
super(Product, cls).write(*args)
actions = iter(args)
for products, values in zip(actions, actions):
for product in products:
if (product.template.purchasable
and not product.template.salable
and not product.code):
if not values.get('code'):
cls.write([product], {
'code': cls.get_purchase_sequence()
})