I'm doing a test where I need to imitate the onchange behavior, so:
with self.env.do_in_onchange():
self.onefield = "blahblah"
But when one exits the with block, that data is not written to DB. I'm looking for some kind of self.env.cache.write_to_db()
. Do you know of any?
I found the solution.
To write a record's cache:
To write all the environment's cache: