ERPNext.com Frappe Cloud Support Partners Foundation Frappe School

RuntimeError: no object bound to flags on saving of File doc

Hello Guys

i am trying to create file doc so on save i am getting error

Traceback (most recent call last):
22:57:05 worker_short.1 | File “/usr/lib/python3.6/threading.py”, line 916, in _bootstrap_inner
22:57:05 worker_short.1 | self.run()
22:57:05 worker_short.1 | File “/usr/lib/python3.6/threading.py”, line 864, in run
22:57:05 worker_short.1 | self._target(*self._args, **self._kwargs)
22:57:05 worker_short.1 | File “/home/frappe/frappe-bench/apps/upro_erp/upro_erp/riverstone_erpnext_proj/report/mrp_report_for_traded_items/mrp_report_for_traded_items_new.py”, line 244, in write_data
22:57:05 worker_short.1 | file_doc.save(ignore_permissions=True)
22:57:05 worker_short.1 | File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 273, in save
22:57:05 worker_short.1 | return self._save(*args, **kwargs)
22:57:05 worker_short.1 | File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 296, in _save
22:57:05 worker_short.1 | self.insert()
22:57:05 worker_short.1 | File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 219, in insert
22:57:05 worker_short.1 | self._set_defaults()
22:57:05 worker_short.1 | File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 612, in _set_defaults
22:57:05 worker_short.1 | if frappe.flags.in_import:
22:57:05 worker_short.1 | File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/werkzeug/local.py”, line 348, in getattr
22:57:05 worker_short.1 | return getattr(self._get_current_object(), name)
22:57:05 worker_short.1 | File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/werkzeug/local.py”, line 311, in _get_current_object
22:57:05 worker_short.1 | raise RuntimeError(“no object bound to %s” % self.name)
22:57:05 worker_short.1 | RuntimeError: no object bound to flags

Thanks
Eliyas