diff --git a/accounting/views.py b/accounting/views.py index 40caf33..27a0d93 100644 --- a/accounting/views.py +++ b/accounting/views.py @@ -809,11 +809,6 @@ class TransactionFormView(FormView): context["new_record_template"] = self._get_new_record_template_json() return context - def get_template_name(self) -> str: - """Returns the name of the template.""" - model_name = self.model.__name__.lower() - return F"accounting/{model_name}_{self.txn_type}_form.html" - def _get_new_record_template_json(self) -> str: context = {"record_type": "TTT", "no": "NNN"} template_name = "accounting/include/record_form-transfer.html"\ @@ -821,6 +816,11 @@ class TransactionFormView(FormView): else "accounting/include/record_form-non-transfer.html" return json.dumps(render_to_string(template_name, context)) + def get_template_name(self) -> str: + """Returns the name of the template.""" + model_name = self.model.__name__.lower() + return F"accounting/{model_name}_{self.txn_type}_form.html" + def make_form_from_post(self, post: Dict[str, str]) -> TransactionForm: """Creates and returns the form from the POST data.""" return TransactionForm.from_post(post, self.txn_type, self.object)