fixed bugs

This commit is contained in:
Cayo Puigdefabregas 2022-05-30 17:35:27 +02:00
parent b0c58595c1
commit a1728810d1
2 changed files with 3 additions and 2 deletions

View File

@ -1169,6 +1169,7 @@ class EditTransferForm(TransferForm):
)
def __init__(self, *args, **kwargs):
# import pdb;pdb.set_trace()
super().__init__(*args, **kwargs)
del self.type

View File

@ -54,7 +54,7 @@ class DeviceListMix(GenericMixView):
if lot_id:
lot = lots.filter(Lot.id == lot_id).one()
if not lot.is_temporary and lot.transfer:
form_transfer = EditTransferForm(lot_id=lot.id, id=lot.transfer.id)
form_transfer = EditTransferForm(lot_id=lot.id)
form_new_action = NewActionForm(lot=lot_id)
self.context.update(
@ -412,7 +412,7 @@ class NewTransferView(GenericMixView):
self.form.save()
new_lot_id = lot_id
if self.form.newlot.id:
new_lot_id = self.form.newlot.id
new_lot_id = "{}".format(self.form.newlot.id)
Lot.query.filter(Lot.id == new_lot_id).one()
messages.success('Transfer created successfully!')
next_url = url_for('inventory.lotdevicelist', lot_id=new_lot_id)