Use a sequence of records, values in write
issue3499 review1641003
This commit is contained in:
1 parent
f761598e32
commit
b795c949e6
1 file changed
+12
-6
@@ -23,14 +23,17 @@ class ShipmentOut:
|
||||
})
|
||||
|
||||
@classmethod
|
||||
def write(cls, shipments, vals):
|
||||
def write(cls, *args):
|
||||
pool = Pool()
|
||||
Sale = pool.get('sale.sale')
|
||||
SaleLine = pool.get('sale.line')
|
||||
|
||||
super(ShipmentOut, cls).write(shipments, vals)
|
||||
super(ShipmentOut, cls).write(*args)
|
||||
|
||||
if 'state' in vals and vals['state'] in ('done', 'cancel'):
|
||||
actions = iter(args)
|
||||
for shipments, values in zip(actions, actions):
|
||||
if values.get('state') not in ('done', 'cancel'):
|
||||
continue
|
||||
sales = []
|
||||
move_ids = []
|
||||
for shipment in shipments:
|
||||
@@ -70,14 +73,17 @@ class ShipmentOutReturn:
|
||||
})
|
||||
|
||||
@classmethod
|
||||
def write(cls, shipments, vals):
|
||||
def write(cls, *args):
|
||||
pool = Pool()
|
||||
Sale = pool.get('sale.sale')
|
||||
SaleLine = pool.get('sale.line')
|
||||
|
||||
super(ShipmentOutReturn, cls).write(shipments, vals)
|
||||
super(ShipmentOutReturn, cls).write(*args)
|
||||
|
||||
if 'state' in vals and vals['state'] == 'received':
|
||||
actions = iter(args)
|
||||
for shipments, values in zip(actions, actions):
|
||||
if values.get('state') != 'received':
|
||||
continue
|
||||
sales = []
|
||||
move_ids = []
|
||||
for shipment in shipments:
|
||||
|
||||
Reference in new issue
Block a user