Fixed an issue where it was not possible to delete farm animals
This commit is contained in:
parent
55628a29b0
commit
895157dd6a
|
@ -481,9 +481,9 @@ class Animal(ModelSQL, ModelView, AnimalMixin):
|
|||
pool = Pool()
|
||||
Lot = pool.get('stock.lot')
|
||||
|
||||
lots = [a.lot for a in animals]
|
||||
if lots:
|
||||
Lot.write(lots, {'animal': None})
|
||||
lots = [a.lot for a in animals if a.lot is not None]
|
||||
# if lots:
|
||||
# Lot.write(lots, {'animal': None})
|
||||
result = super(Animal, cls).delete(animals)
|
||||
if lots:
|
||||
Lot.delete(lots)
|
||||
|
|
Loading…
Reference in New Issue