Contributors mailing list archives

contributors@odoo-community.org

Browse archives

Avatar

Re: How can I write all the cache?

by
Guewen Baconnier
- 23/10/2015 13:09:55
On Wed, Oct 21, 2015 at 9:37 AM, Yajo <yajo.sk8@gmail.com> wrote:
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?

_______________________________________________
Mailing-List: http://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: http://odoo-community.org/groups?unsubscribe


You should be able to do something like:

record.write(record._convert_to_write(record._cache))
 

Reference