Moved the sort_post_txn_records utility and the logic to create the form to TransactionForm in the accounting application.
This commit is contained in:
@ -823,11 +823,7 @@ class TransactionFormView(FormView):
|
||||
|
||||
def make_form_from_post(self, post: Dict[str, str]) -> TransactionForm:
|
||||
"""Creates and returns the form from the POST data."""
|
||||
utils.sort_post_txn_records(post)
|
||||
form = TransactionForm(post)
|
||||
form.txn_type = self.txn_type
|
||||
form.transaction = self.object
|
||||
return form
|
||||
return TransactionForm.from_post(post, self.txn_type, self.object)
|
||||
|
||||
def make_form_from_model(self, obj: Transaction) -> TransactionForm:
|
||||
"""Creates and returns the form from a data model."""
|
||||
|
Reference in New Issue
Block a user