#232 Payment document linkage
* adds error message on intervention view if a payment has been added but no document has been uploaded yet * adds same check to quality checker, meaning no intervention can be recorded which has a payment but no document * adds trigger for sending data to egon on uploading a document in case of an already existing payment * adds translations
This commit is contained in:
@@ -10,4 +10,23 @@ from konova.forms.modals import NewDocumentModalForm
|
||||
|
||||
|
||||
class NewInterventionDocumentModalForm(NewDocumentModalForm):
|
||||
document_model = InterventionDocument
|
||||
document_model = InterventionDocument
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
""" Extension of regular NewDocumentModalForm
|
||||
|
||||
Checks whether payments exist on the intervention and sends the data to EGON
|
||||
|
||||
Args:
|
||||
*args ():
|
||||
**kwargs ():
|
||||
|
||||
Returns:
|
||||
|
||||
"""
|
||||
doc = super().save(*args, **kwargs)
|
||||
|
||||
if self.instance.payments.exists():
|
||||
self.instance.send_data_to_egon()
|
||||
|
||||
return doc
|
||||
|
||||
Reference in New Issue
Block a user