Merge branch 'master' into api
# Conflicts: # apps/note/forms.py # apps/note/urls.py # apps/note/views.py
This commit is contained in:
commit
00d560c20e
9 changed files with 125 additions and 9 deletions
|
|
@ -46,3 +46,16 @@ class TransactionForm(forms.ModelForm):
|
|||
'data-minimum-input-length': 1,
|
||||
},),
|
||||
}
|
||||
|
||||
class ConsoForm(forms.ModelForm):
|
||||
def save(self, commit=True):
|
||||
button: TransactionTemplate = TransactionTemplate.objects.filter(name=self.data['button']).get()
|
||||
self.instance.destination = button.destination
|
||||
self.instance.amount = button.amount
|
||||
self.instance.transaction_type = 'bouton'
|
||||
self.instance.reason = button.name
|
||||
super().save(commit)
|
||||
|
||||
class Meta:
|
||||
model = Transaction
|
||||
fields = ('source',)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue