Hi,
I create a new site in frappe framework, then run wizard.
In wizard step I choose the USD currency as my system currency, but when I create doctype with currency field it show something else currency.
I try to find in System Setting but it does not in there.
Can anyone help where change I change default currency?
I do not install erpnext to my site.
When I install erpnext app to site, I see this option Global Setting.
So I think that Global Setting is part of erpnext not frappe.
I my case I do not need erpnext app. It just a small custom app build over frappe framework.
I have tried this also, but it works for me only, not work for other users.
I believe session default is for personal user preference. It does not affect for whole app.
There’s should be a way to do it.
I took me about a week of fulltime working hour already for try to find this solution. but still don’t have solution yet.
To be honest, I dont really understand about your suggestion.
When I add new field Currency to my Doctype and set default to USD, my currency field still show wrong current format, as well as in report.
Thank you very much @NCP for taking your time trying to help me out about this issue.
Finally I manage solve this by add a new doctype to my app, for example My App Setting, then add add new docfield Currency link to Currency doctype.
and here is on update event of my doctype:
from frappe.model import no_value_fields
import frappe
from frappe.model.document import Document
class MyAppSetting(Document):
def on_update(self):
for df in self.meta.get("fields"):
if df.fieldtype not in no_value_fields and self.has_value_changed(df.fieldname):
frappe.db.set_default(df.fieldname, self.get(df.fieldname))
I copy this code from system_settings.py. And yes everything work as expected.