hi all , i’m trying to create a new Journal Entry using frappe.get_doc and this is my backend code
def insert_new_journal_entry_fees(R_account,P_Account,student_sys_number,amount):
doc = frappe.get_doc({
'doctype': 'Journal Entry',
})
doc.append("Journal Entry Account", {
"Account" : R_account ,
"party_type" : 'Student',
"party" : student_sys_number,
"credit_in_account_currency" : int(amount)
})
doc.append("Journal Entry Account", {
"Account" : P_Account ,
"party_type" : 'Student',
"party" : student_sys_number,
"debit_in_account_currency" : int(amount)
})
doc.save(ignore_permissions=True)
doc.submit()
frappe.db.commit()
and i got this error
Traceback (most recent call last):
File "/home/frappe/frappe-bench/apps/frappe/frappe/app.py", line 60, in application
response = frappe.api.handle()
File "/home/frappe/frappe-bench/apps/frappe/frappe/api.py", line 55, in handle
return frappe.handler.handle()
File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 22, in handle
data = execute_cmd(cmd)
File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 61, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 1042, in call
return fn(*args, **newargs)
File "/home/frappe/frappe-bench/apps/erpnext/erpnext/education/api.py", line 191, in insert_new_journal_entry_fees
"credit_in_account_currency" : int(amount)
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py", line 149, in append
value = self._init_child(value, key)
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py", line 184, in _init_child
value["doctype"] = self.get_table_field_doctype(key)
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py", line 298, in get_table_field_doctype
return self.meta.get_field(fieldname).options
AttributeError: 'NoneType' object has no attribute 'options'