Merge lp:~openerp-dev/openobject-server/printscreen_group_no_lief into lp:~openerp-dev/openobject-server/trunk-dev-framework

Proposed by Ravi Gadhia (OpenERP)
Status: Merged
Merge reported by: Naresh(OpenERP)
Merged at revision: not available
Proposed branch: lp:~openerp-dev/openobject-server/printscreen_group_no_lief
Merge into: lp:~openerp-dev/openobject-server/trunk-dev-framework
Diff against target: 491 lines (+82/-58)
9 files modified
bin/addons/base/i18n/bg.po (+16/-16)
bin/addons/base/i18n/hr.po (+2/-2)
bin/addons/base/i18n/it.po (+7/-7)
bin/addons/base/i18n/ja.po (+2/-2)
bin/addons/base/i18n/sv.po (+2/-2)
bin/addons/base/i18n/uk.po (+2/-2)
bin/addons/base/i18n/zh_CN.po (+2/-2)
bin/report/printscreen/ps_list.py (+8/-2)
bin/sql_db.py (+41/-23)
To merge this branch: bzr merge lp:~openerp-dev/openobject-server/printscreen_group_no_lief
Reviewer Review Type Date Requested Status
Naresh(OpenERP) Needs Fixing
Review via email: mp+25436@code.launchpad.net

Description of the change

task_id:755
Print screen reports: support for group_by_no_leaf which should print only group by headers and no child nodes.

To post a comment you must log in.
2260. By rga <rga@rga-desktop>

[Merge] trunk-dev-framework

Revision history for this message
Naresh(OpenERP) (nch-openerp) wrote :

Hello,

1: float field not properly aligned.
2: groupby no_leaf the cloumn headers have a lot of space between them.

review: Needs Fixing

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/addons/base/i18n/bg.po'
2--- bin/addons/base/i18n/bg.po 2010-04-22 03:42:56 +0000
3+++ bin/addons/base/i18n/bg.po 2010-06-29 13:12:29 +0000
4@@ -7,13 +7,13 @@
5 "Project-Id-Version: OpenERP Server 5.0.4\n"
6 "Report-Msgid-Bugs-To: support@openerp.com\n"
7 "POT-Creation-Date: 2009-12-18 08:39+0000\n"
8-"PO-Revision-Date: 2010-04-21 04:53+0000\n"
9-"Last-Translator: OpenERP Administrators <Unknown>\n"
10+"PO-Revision-Date: 2010-05-15 14:19+0000\n"
11+"Last-Translator: Boris <boris.t.ivanov@gmail.com>\n"
12 "Language-Team: \n"
13 "MIME-Version: 1.0\n"
14 "Content-Type: text/plain; charset=UTF-8\n"
15 "Content-Transfer-Encoding: 8bit\n"
16-"X-Launchpad-Export-Date: 2010-04-22 03:42+0000\n"
17+"X-Launchpad-Export-Date: 2010-05-17 05:00+0000\n"
18 "X-Generator: Launchpad (build Unknown)\n"
19
20 #. module: base
21@@ -83,7 +83,7 @@
22 #. module: base
23 #: view:workflow.activity:0
24 msgid "Outgoing transitions"
25-msgstr "Изходящи промени"
26+msgstr "Изходящи преходи"
27
28 #. module: base
29 #: selection:ir.report.custom,frequency:0
30@@ -1754,7 +1754,7 @@
31 #: code:addons/base/module/module.py:0
32 #, python-format
33 msgid "Can not upgrade module '%s'. It is not installed."
34-msgstr "Не може да бъде обновен модул '%s'. Той не е инсталиран."
35+msgstr "Модул '%s' не може да бъде обновен. Той не е инсталиран."
36
37 #. module: base
38 #: model:res.country,name:base.cu
39@@ -2039,7 +2039,7 @@
40 #. module: base
41 #: selection:maintenance.contract.wizard,state:0
42 msgid "Unvalidated"
43-msgstr "Непроверен"
44+msgstr "Невалидирано"
45
46 #. module: base
47 #: model:ir.ui.menu,name:base.next_id_9
48@@ -2066,7 +2066,7 @@
49 #: code:addons/base/maintenance/maintenance.py:0
50 #, python-format
51 msgid "Unable to find a valid contract"
52-msgstr "Не може да се намери валиден договор"
53+msgstr "Не е намерeн валиден договор"
54
55 #. module: base
56 #: code:addons/base/ir/ir_actions.py:0
57@@ -5002,7 +5002,7 @@
58 #: code:addons/base/module/wizard/wizard_module_import.py:0
59 #, python-format
60 msgid "Can not create the module file: %s !"
61-msgstr "Модулния файл: %s, не можеда да бъде създаден !"
62+msgstr "Модулния файл: %s, не можеда да бъде създаден !"
63
64 #. module: base
65 #: model:ir.module.module,description:base.module_meta_information
66@@ -5028,7 +5028,7 @@
67 #: code:addons/base/ir/ir_actions.py:0
68 #, python-format
69 msgid "Please specify server option --smtp-from !"
70-msgstr "Моля укажете опцията на сървъра --smtp-from !"
71+msgstr "Моля укажете опция на сървъра --smtp-from !"
72
73 #. module: base
74 #: selection:wizard.module.lang.export,format:0
75@@ -6225,7 +6225,7 @@
76 #. module: base
77 #: field:ir.ui.view_sc,user_id:0
78 msgid "User Ref."
79-msgstr "Справка за потребител"
80+msgstr "Потребителска справка"
81
82 #. module: base
83 #: model:ir.ui.menu,name:base.menu_base_config
84@@ -6812,7 +6812,7 @@
85 #. module: base
86 #: view:workflow.activity:0
87 msgid "Incoming transitions"
88-msgstr "Входящи промени"
89+msgstr "Входящи преходи"
90
91 #. module: base
92 #: model:res.country,name:base.cn
93@@ -7277,7 +7277,7 @@
94 #. module: base
95 #: help:res.partner.address,partner_id:0
96 msgid "Keep empty for a private address, not related to partner."
97-msgstr "Оставете празно за личен адрес несвързан с партньора"
98+msgstr "Оставете празно за личен адрес нямащ отношение към партньора."
99
100 #. module: base
101 #: model:res.country,name:base.vu
102@@ -7296,8 +7296,8 @@
103 "Save this document to a .tgz file. This archive containt UTF-8 %s files and "
104 "may be uploaded to launchpad."
105 msgstr ""
106-"Запази документа като .tgz файл. Този архив съдържа %s UTF-8 файлове и може "
107-"да бъде качен в launchpad."
108+"Запазете документа като .tgz файл. Този архив съдържа %s UTF-8 файлове и "
109+"може да бъде качен в launchpad."
110
111 #. module: base
112 #: wizard_button:module.upgrade,end,config:0
113@@ -7728,7 +7728,7 @@
114 "invoice, then `object.invoice_address_id.mobile` is the field which gives "
115 "the correct mobile number"
116 msgstr ""
117-"Оказва полетата които ще се използват за доставяне на мобилен номер, напр., "
118+"Указва полетата които ще се използват за доставяне на мобилен номер, напр., "
119 "когато изберете фактура, тогава 'object.invoice_address_id.mobile' е полето "
120 "което дава правилния мобилен номер"
121
122@@ -8080,7 +8080,7 @@
123 #. module: base
124 #: field:ir.exports,name:0
125 msgid "Export Name"
126-msgstr "Име на извлечането"
127+msgstr "Име на изнасянето"
128
129 #. module: base
130 #: help:res.partner.address,type:0
131
132=== modified file 'bin/addons/base/i18n/hr.po'
133--- bin/addons/base/i18n/hr.po 2010-05-14 04:55:01 +0000
134+++ bin/addons/base/i18n/hr.po 2010-06-29 13:12:29 +0000
135@@ -7,13 +7,13 @@
136 "Project-Id-Version: OpenERP Server 5.0.4\n"
137 "Report-Msgid-Bugs-To: support@openerp.com\n"
138 "POT-Creation-Date: 2009-12-18 08:39+0000\n"
139-"PO-Revision-Date: 2010-05-13 04:54+0000\n"
140+"PO-Revision-Date: 2010-05-17 04:48+0000\n"
141 "Last-Translator: goranc <goranc@gmail.com>\n"
142 "Language-Team: openerp-translators\n"
143 "MIME-Version: 1.0\n"
144 "Content-Type: text/plain; charset=UTF-8\n"
145 "Content-Transfer-Encoding: 8bit\n"
146-"X-Launchpad-Export-Date: 2010-05-14 04:54+0000\n"
147+"X-Launchpad-Export-Date: 2010-05-17 05:00+0000\n"
148 "X-Generator: Launchpad (build Unknown)\n"
149 "Language: hr\n"
150
151
152=== modified file 'bin/addons/base/i18n/it.po'
153--- bin/addons/base/i18n/it.po 2010-05-14 04:55:01 +0000
154+++ bin/addons/base/i18n/it.po 2010-06-29 13:12:29 +0000
155@@ -7,13 +7,13 @@
156 "Project-Id-Version: OpenERP Server 5.0.4\n"
157 "Report-Msgid-Bugs-To: support@openerp.com\n"
158 "POT-Creation-Date: 2009-12-18 08:39+0000\n"
159-"PO-Revision-Date: 2010-05-13 09:24+0000\n"
160-"Last-Translator: Carlo - didotech.com <Unknown>\n"
161+"PO-Revision-Date: 2010-05-16 16:24+0000\n"
162+"Last-Translator: eLBati - albatos.com <lorenzo.battistini@albatos.com>\n"
163 "Language-Team: \n"
164 "MIME-Version: 1.0\n"
165 "Content-Type: text/plain; charset=UTF-8\n"
166 "Content-Transfer-Encoding: 8bit\n"
167-"X-Launchpad-Export-Date: 2010-05-14 04:54+0000\n"
168+"X-Launchpad-Export-Date: 2010-05-17 05:00+0000\n"
169 "X-Generator: Launchpad (build Unknown)\n"
170
171 #. module: base
172@@ -901,7 +901,7 @@
173 #. module: base
174 #: field:ir.model.access,perm_read:0
175 msgid "Read Access"
176-msgstr "Accesso di Lettura"
177+msgstr "Accesso in lettura"
178
179 #. module: base
180 #: model:ir.model,name:base.model_ir_exports
181@@ -3875,7 +3875,7 @@
182 #. module: base
183 #: field:ir.model.access,perm_create:0
184 msgid "Create Access"
185-msgstr "Crea Accesso"
186+msgstr "Accesso in creazione"
187
188 #. module: base
189 #: field:res.partner.address,state_id:0
190@@ -5506,7 +5506,7 @@
191 #. module: base
192 #: field:ir.model.access,perm_write:0
193 msgid "Write Access"
194-msgstr "Accesso Scrittura"
195+msgstr "Accesso in scrittura"
196
197 #. module: base
198 #: field:res.bank,city:0
199@@ -7411,7 +7411,7 @@
200 #. module: base
201 #: field:ir.model.access,perm_unlink:0
202 msgid "Delete Permission"
203-msgstr "Cancella Autorizzazione"
204+msgstr "Permesso di cancellazione"
205
206 #. module: base
207 #: model:ir.model,name:base.model_multi_company_default
208
209=== modified file 'bin/addons/base/i18n/ja.po'
210--- bin/addons/base/i18n/ja.po 2010-05-14 04:55:01 +0000
211+++ bin/addons/base/i18n/ja.po 2010-06-29 13:12:29 +0000
212@@ -8,13 +8,13 @@
213 "Project-Id-Version: openobject-server\n"
214 "Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
215 "POT-Creation-Date: 2009-12-18 08:39+0000\n"
216-"PO-Revision-Date: 2010-05-13 04:56+0000\n"
217+"PO-Revision-Date: 2010-05-17 04:47+0000\n"
218 "Last-Translator: Harry (Open ERP) <hmo@tinyerp.com>\n"
219 "Language-Team: Japanese <ja@li.org>\n"
220 "MIME-Version: 1.0\n"
221 "Content-Type: text/plain; charset=UTF-8\n"
222 "Content-Transfer-Encoding: 8bit\n"
223-"X-Launchpad-Export-Date: 2010-05-14 04:54+0000\n"
224+"X-Launchpad-Export-Date: 2010-05-17 05:00+0000\n"
225 "X-Generator: Launchpad (build Unknown)\n"
226
227 #. module: base
228
229=== modified file 'bin/addons/base/i18n/sv.po'
230--- bin/addons/base/i18n/sv.po 2010-05-14 04:55:01 +0000
231+++ bin/addons/base/i18n/sv.po 2010-06-29 13:12:29 +0000
232@@ -7,13 +7,13 @@
233 "Project-Id-Version: OpenERP Server 5.0.0\n"
234 "Report-Msgid-Bugs-To: support@openerp.com\n"
235 "POT-Creation-Date: 2009-12-18 08:39+0000\n"
236-"PO-Revision-Date: 2010-05-13 04:57+0000\n"
237+"PO-Revision-Date: 2010-05-17 04:45+0000\n"
238 "Last-Translator: Anders Wallenquist <anders.wallenquist@vertel.se>\n"
239 "Language-Team: <>\n"
240 "MIME-Version: 1.0\n"
241 "Content-Type: text/plain; charset=UTF-8\n"
242 "Content-Transfer-Encoding: 8bit\n"
243-"X-Launchpad-Export-Date: 2010-05-14 04:54+0000\n"
244+"X-Launchpad-Export-Date: 2010-05-17 05:00+0000\n"
245 "X-Generator: Launchpad (build Unknown)\n"
246
247 #. module: base
248
249=== modified file 'bin/addons/base/i18n/uk.po'
250--- bin/addons/base/i18n/uk.po 2010-05-14 04:55:01 +0000
251+++ bin/addons/base/i18n/uk.po 2010-06-29 13:12:29 +0000
252@@ -7,13 +7,13 @@
253 "Project-Id-Version: OpenERP Server 5.0.0\n"
254 "Report-Msgid-Bugs-To: support@openerp.com\n"
255 "POT-Creation-Date: 2009-12-18 08:39+0000\n"
256-"PO-Revision-Date: 2010-05-13 04:57+0000\n"
257+"PO-Revision-Date: 2010-05-17 04:49+0000\n"
258 "Last-Translator: Fabien (Open ERP) <fp@tinyerp.com>\n"
259 "Language-Team: \n"
260 "MIME-Version: 1.0\n"
261 "Content-Type: text/plain; charset=UTF-8\n"
262 "Content-Transfer-Encoding: 8bit\n"
263-"X-Launchpad-Export-Date: 2010-05-14 04:54+0000\n"
264+"X-Launchpad-Export-Date: 2010-05-17 05:01+0000\n"
265 "X-Generator: Launchpad (build Unknown)\n"
266
267 #. module: base
268
269=== modified file 'bin/addons/base/i18n/zh_CN.po'
270--- bin/addons/base/i18n/zh_CN.po 2010-05-14 04:55:01 +0000
271+++ bin/addons/base/i18n/zh_CN.po 2010-06-29 13:12:29 +0000
272@@ -7,13 +7,13 @@
273 "Project-Id-Version: OpenERP Server 5.0.4\n"
274 "Report-Msgid-Bugs-To: support@openerp.com\n"
275 "POT-Creation-Date: 2009-12-18 08:39+0000\n"
276-"PO-Revision-Date: 2010-05-13 04:57+0000\n"
277+"PO-Revision-Date: 2010-05-17 04:47+0000\n"
278 "Last-Translator: OpenERP Administrators <Unknown>\n"
279 "Language-Team: \n"
280 "MIME-Version: 1.0\n"
281 "Content-Type: text/plain; charset=UTF-8\n"
282 "Content-Transfer-Encoding: 8bit\n"
283-"X-Launchpad-Export-Date: 2010-05-14 04:55+0000\n"
284+"X-Launchpad-Export-Date: 2010-05-17 05:01+0000\n"
285 "X-Generator: Launchpad (build Unknown)\n"
286
287 #. module: base
288
289=== modified file 'bin/report/printscreen/ps_list.py'
290--- bin/report/printscreen/ps_list.py 2010-04-09 10:28:15 +0000
291+++ bin/report/printscreen/ps_list.py 2010-06-29 13:12:29 +0000
292@@ -61,6 +61,7 @@
293 context={}
294 self.context = context
295 self.groupby = context.get('group_by',[])
296+ self.groupby_no_leaf = context.get('group_by_no_leaf',False)
297 pool = pooler.get_pool(cr.dbname)
298 model = pool.get(datas['model'])
299 model_id = pool.get('ir.model').search(cr, uid, [('model','=',model._name)])
300@@ -80,6 +81,7 @@
301 records = model.read_group(cr, uid, domain, fields_order, groupby , 0, None, context)
302 for rec in records:
303 rec['__group'] = True
304+ rec['__no_leaf'] = self.groupby_no_leaf
305 for f in fields_order:
306 if f not in rec:
307 rec.update({f:False})
308@@ -89,6 +91,8 @@
309 if groupby:
310 get_groupby_data(groupby, domain)
311 else:
312+ if self.groupby_no_leaf:
313+ continue
314 child_ids = model.search(cr, uid, domain)
315 res = model.read(cr, uid, child_ids, result['fields'].keys(), context)
316 rows.extend(res)
317@@ -167,8 +171,6 @@
318 if fields[f]['type']=='many2one' and line[f]:
319 if not line.get('__group'):
320 line[f]= line[f][1]
321- else:
322- line[f]= line[f]
323 if fields[f]['type']=='selection' and line[f]:
324 for key, value in fields[f]['selection']:
325 if key == line[f]:
326@@ -207,12 +209,16 @@
327 line[f] = new_d1
328 if line.get('__group'):
329 col = etree.SubElement(node_line, 'col', para='group', tree='no')
330+ if fields[f]['type'] =='integer':
331+ col.set('tree','float')
332 else:
333 col = etree.SubElement(node_line, 'col', para='yes', tree='no')
334 if line[f] != None:
335 col.text = tools.ustr(line[f] or '')
336 if float_flag:
337 col.set('tree','float')
338+ if line.get('__no_leaf') and temp[count] == 1 and f != 'id' and not line['__context']['group_by']:
339+ tsum[count] = float(tsum[count]) + float(line[f])
340 if not line.get('__group') and f != 'id' and temp[count] == 1:
341 tsum[count] = float(tsum[count]) + float(line[f]);
342 else:
343
344=== modified file 'bin/sql_db.py'
345--- bin/sql_db.py 2010-04-01 19:33:19 +0000
346+++ bin/sql_db.py 2010-06-29 13:12:29 +0000
347@@ -100,7 +100,7 @@
348 msg = "Cursor not closed explicitly\n" \
349 "Cursor was created at %s:%s"
350 self.__logger.warn(msg, *self.__caller)
351- self.close()
352+ self._close(True)
353
354 @check
355 def execute(self, query, params=None):
356@@ -118,7 +118,7 @@
357 params = params or None
358 res = self._obj.execute(query, params)
359 except psycopg2.ProgrammingError, pe:
360- self.__logger.error("Programming error: %s, in query %s" % (pe, query))
361+ self.__logger.error("Programming error: %s, in query %s", pe, query)
362 raise
363 except Exception:
364 self.__logger.exception("bad query: %s", self._obj.query)
365@@ -177,6 +177,9 @@
366
367 @check
368 def close(self):
369+ return self._close(False)
370+
371+ def _close(self, leak=False):
372 if not self._obj:
373 return
374
375@@ -194,7 +197,12 @@
376 # part because browse records keep a reference to the cursor.
377 del self._obj
378 self.__closed = True
379- self._pool.give_back(self._cnx)
380+
381+ if leak:
382+ self._cnx.leaked = True
383+ else:
384+ keep_in_pool = self.dbname not in ('template1', 'template0', 'postgres')
385+ self._pool.give_back(self._cnx, keep_in_pool=keep_in_pool)
386
387 @check
388 def autocommit(self, on):
389@@ -214,6 +222,9 @@
390 return getattr(self._obj, name)
391
392
393+class PsycoConnection(psycopg2.extensions.connection):
394+ pass
395+
396 class ConnectionPool(object):
397
398 __logger = logging.getLogger('db.connection_pool')
399@@ -239,57 +250,64 @@
400 count = len(self._connections)
401 return "ConnectionPool(used=%d/count=%d/max=%d)" % (used, count, self._maxconn)
402
403- def _debug(self, msg):
404- self.__logger.debug(repr(self))
405- self.__logger.debug(msg)
406+ def _debug(self, msg, *args):
407+ msg = '%r ' + msg
408+ self.__logger.debug(msg, self, *args)
409
410 @locked
411 def borrow(self, dsn):
412- self._debug('Borrow connection to %s' % (dsn,))
413-
414- result = None
415+ self._debug('Borrow connection to %r', dsn)
416+
417+ # free leaked connections
418+ for i, (cnx, _) in tools.reverse_enumerate(self._connections):
419+ if getattr(cnx, 'leaked', False):
420+ delattr(cnx, 'leaked')
421+ self._connections.pop(i)
422+ self._connections.append((cnx, False))
423+ self._debug('Free leaked connection to %r', cnx.dsn)
424+
425 for i, (cnx, used) in enumerate(self._connections):
426 if not used and dsn_are_equals(cnx.dsn, dsn):
427- self._debug('Existing connection found at index %d' % i)
428-
429 self._connections.pop(i)
430 self._connections.append((cnx, True))
431+ self._debug('Existing connection found at index %d', i)
432
433- result = cnx
434- break
435- if result:
436- return result
437+ return cnx
438
439 if len(self._connections) >= self._maxconn:
440 # try to remove the oldest connection not used
441 for i, (cnx, used) in enumerate(self._connections):
442 if not used:
443- self._debug('Removing old connection at index %d: %s' % (i, cnx.dsn))
444 self._connections.pop(i)
445+ self._debug('Removing old connection at index %d: %r', i, cnx.dsn)
446 break
447 else:
448 # note: this code is called only if the for loop has completed (no break)
449 raise PoolError('The Connection Pool Is Full')
450
451+ result = psycopg2.connect(dsn=dsn, connection_factory=PsycoConnection)
452+ self._connections.append((result, True))
453 self._debug('Create new connection')
454- result = psycopg2.connect(dsn=dsn)
455- self._connections.append((result, True))
456 return result
457
458 @locked
459- def give_back(self, connection):
460- self._debug('Give back connection to %s' % (connection.dsn,))
461+ def give_back(self, connection, keep_in_pool=True):
462+ self._debug('Give back connection to %r', connection.dsn)
463 for i, (cnx, used) in enumerate(self._connections):
464 if cnx is connection:
465 self._connections.pop(i)
466- self._connections.append((cnx, False))
467+ if keep_in_pool:
468+ self._connections.append((cnx, False))
469+ self._debug('Put connection to %r in pool', cnx.dsn)
470+ else:
471+ self._debug('Forgot connection to %r', cnx.dsn)
472 break
473 else:
474 raise PoolError('This connection does not below to the pool')
475
476 @locked
477 def close_all(self, dsn):
478- self._debug('Close all connections to %s' % (dsn,))
479+ self._debug('Close all connections to %r', dsn)
480 for i, (cnx, used) in tools.reverse_enumerate(self._connections):
481 if dsn_are_equals(cnx.dsn, dsn):
482 cnx.close()
483@@ -305,7 +323,7 @@
484
485 def cursor(self, serialized=False):
486 cursor_type = serialized and 'serialized ' or ''
487- self.__logger.debug('create %scursor to "%s"' % (cursor_type, self.dbname,))
488+ self.__logger.debug('create %scursor to %r', cursor_type, self.dbname)
489 return Cursor(self._pool, self.dbname, serialized=serialized)
490
491 def serialized_cursor(self):

Subscribers

People subscribed via source and target branches