Purchase:
bugfix creating invoices: the journal of the invoice was not good bzr revid: pinky-f3c27489ecabe5985ef3610c2ab7016bef801291
This commit is contained in:
parent
efbdb2e75f
commit
63f1614bfe
|
@ -48,9 +48,9 @@ class fake_cursor:
|
||||||
self.con = con
|
self.con = con
|
||||||
self.dbname = dbname
|
self.dbname = dbname
|
||||||
|
|
||||||
def execute_dont_run(self,*args):
|
def execute(self,*args):
|
||||||
if not fake_cursor.nbr % 100:
|
if not fake_cursor.nbr % 1:
|
||||||
print 'sql: ',fake_cursor.nbr
|
print 'sql: ',fake_cursor.nbr, args
|
||||||
res = re.match('^select.* from ([a-zA-Z_]+) .*$', args[0], re.I)
|
res = re.match('^select.* from ([a-zA-Z_]+) .*$', args[0], re.I)
|
||||||
if res:
|
if res:
|
||||||
fake_cursor._tables.setdefault(res.group(1), 0)
|
fake_cursor._tables.setdefault(res.group(1), 0)
|
||||||
|
@ -62,15 +62,15 @@ class fake_cursor:
|
||||||
# else:
|
# else:
|
||||||
# print 'sql: ',fake_cursor.nbr, args[0]
|
# print 'sql: ',fake_cursor.nbr, args[0]
|
||||||
|
|
||||||
if not fake_cursor.nbr % 5000:
|
#if not fake_cursor.nbr % 5000:
|
||||||
ct = []
|
# ct = []
|
||||||
for t,c in fake_cursor._tables.items():
|
# for t,c in fake_cursor._tables.items():
|
||||||
ct.append([c,t])
|
# ct.append([c,t])
|
||||||
ct.sort()
|
# ct.sort()
|
||||||
ct.reverse()
|
# ct.reverse()
|
||||||
print 'After %d queries' % (fake_cursor.nbr,)
|
# print 'After %d queries' % (fake_cursor.nbr,)
|
||||||
for line in ct[:50]:
|
# for line in ct[:50]:
|
||||||
print ' %s: %d' % (line[1], line[0])
|
# print ' %s: %d' % (line[1], line[0])
|
||||||
|
|
||||||
#if len(args)>1:
|
#if len(args)>1:
|
||||||
# print 'sql: ',fake_cursor.nbr, args[0], args[1]
|
# print 'sql: ',fake_cursor.nbr, args[0], args[1]
|
||||||
|
|
Loading…
Reference in New Issue