Bench console does not update DB

hey all, very new to ERPNext, only a few hours. Got a lot of time in Netsuite (13yrs) and looking for something for my customers I can migrate to that meets the minimum, but without the $$$ requirement.

Playing around with the backend, to that end I managed to find the bench console, however I noticed that you cannot save any changes to Documents, any attempt terminates gracefully and even triggers onchange events (for example User change triggers avatar requests) but no changes to DB. Is there a switch on the command line I can use?

What are the commands / code you have tried on bench console?

Hi Pawan,

u = frappe.get_doc("User", "[my email address]")
u.as_json() #shows data I'm expecting
u.last_name = "AnotherName"
u.save()

it updates the in-memory document, but makes no changes to the db.

After u.save(), try frappe.db.commit()

2 Likes

That’s it! Thanks Pawan!