mirror of
https://github.com/NaN-tic/trytond-product_purchase_sequence.git
synced 2023-12-14 04:02:54 +01:00
Adapt signature of "def write()"
This commit is contained in:
parent
c6d10f0242
commit
f622b56812
1 changed files with 9 additions and 6 deletions
15
product.py
15
product.py
|
@ -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()
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue