[IMP] document, edi, procurement: use method Registry.cursor() (formerly get_cursor)
bzr revid: rco@openerp.com-20140409095659-sxcgsdbsxvfrzwg4
This commit is contained in:
parent
560166d5a1
commit
89f5844b2a
|
@ -2005,7 +2005,7 @@ class nodefd_content(StringIO, node_descriptor):
|
|||
|
||||
par = self._get_parent()
|
||||
uid = par.context.uid
|
||||
cr = openerp.registry(par.context.dbname).get_cursor()
|
||||
cr = openerp.registry(par.context.dbname).cursor()
|
||||
try:
|
||||
if self.mode in ('w', 'w+', 'r+'):
|
||||
data = self.getvalue()
|
||||
|
@ -2058,7 +2058,7 @@ class nodefd_static(StringIO, node_descriptor):
|
|||
|
||||
par = self._get_parent()
|
||||
# uid = par.context.uid
|
||||
cr = openerp.registry(par.context.dbname).get_cursor()
|
||||
cr = openerp.registry(par.context.dbname).cursor()
|
||||
try:
|
||||
if self.mode in ('w', 'w+', 'r+'):
|
||||
data = self.getvalue()
|
||||
|
|
|
@ -35,7 +35,7 @@ def _edi_dispatch(db_name, method_name, *method_args):
|
|||
registry = openerp.modules.registry.RegistryManager.get(db_name)
|
||||
assert registry, 'Unknown database %s' % db_name
|
||||
edi = registry['edi.edi']
|
||||
cr = registry.get_cursor()
|
||||
cr = registry.cursor()
|
||||
res = None
|
||||
res = getattr(edi, method_name)(cr, *method_args)
|
||||
cr.commit()
|
||||
|
|
|
@ -59,7 +59,7 @@ class procurement_order(osv.osv):
|
|||
context = {}
|
||||
try:
|
||||
if use_new_cursor:
|
||||
cr = openerp.registry(use_new_cursor).get_cursor()
|
||||
cr = openerp.registry(use_new_cursor).cursor()
|
||||
|
||||
procurement_obj = self.pool.get('procurement.order')
|
||||
if not skip_exception:
|
||||
|
@ -199,7 +199,7 @@ class procurement_order(osv.osv):
|
|||
if context is None:
|
||||
context = {}
|
||||
if use_new_cursor:
|
||||
cr = openerp.registry(use_new_cursor).get_cursor()
|
||||
cr = openerp.registry(use_new_cursor).cursor()
|
||||
orderpoint_obj = self.pool.get('stock.warehouse.orderpoint')
|
||||
|
||||
procurement_obj = self.pool.get('procurement.order')
|
||||
|
|
|
@ -49,7 +49,7 @@ class procurement_compute(osv.osv_memory):
|
|||
"""
|
||||
proc_obj = self.pool.get('procurement.order')
|
||||
#As this function is in a new thread, I need to open a new cursor, because the old one may be closed
|
||||
new_cr = self.pool.get_cursor()
|
||||
new_cr = self.pool.cursor()
|
||||
for proc in self.browse(new_cr, uid, ids, context=context):
|
||||
proc_obj._procure_orderpoint_confirm(new_cr, uid, automatic=proc.automatic, use_new_cursor=new_cr.dbname, context=context)
|
||||
#close the new cursor
|
||||
|
|
|
@ -45,7 +45,7 @@ class procurement_compute_all(osv.osv_memory):
|
|||
"""
|
||||
proc_obj = self.pool.get('procurement.order')
|
||||
#As this function is in a new thread, i need to open a new cursor, because the old one may be closed
|
||||
new_cr = self.pool.get_cursor()
|
||||
new_cr = self.pool.cursor()
|
||||
for proc in self.browse(new_cr, uid, ids, context=context):
|
||||
proc_obj.run_scheduler(new_cr, uid, automatic=proc.automatic, use_new_cursor=new_cr.dbname,\
|
||||
context=context)
|
||||
|
|
Loading…
Reference in New Issue