Odoo Help

1
1
Jesse Rye
On 10/20/16, 10:27 AM

While Sah's answer appears like it should work I did some more research and found a much simpler answer for my scenario.

All I had to do was use the current environment variable and cursor and run commit(). See below.

self.env.cr.commit()
0
Sah Vinay Mahabir
On 10/20/16, 7:55 AM

add this to py file
#top of the file
from odoo import api, fields, models, _, modules
from odoo.http import request
#before for loop
r = modules.registry.RegistryManager.get(dbname)
cr = r.cursor()
#inside loop
cr.commit()
#make sure you close cr at the end of the function scope
cr.close()

Let me know if there is any error with your log file

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 10/19/16, 4:16 PM
Seen: 3050 times
Last updated: 7/13/17, 5:08 PM