Merge lp:~openerp-dev/openobject-server/7.0-remove-duplicate-logging-xmo into lp:openobject-server

Proposed by Xavier (Open ERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-server/7.0-remove-duplicate-logging-xmo
Merge into: lp:openobject-server
Diff against target: 750 lines (+242/-47) (has conflicts)
15 files modified
openerp/addons/base/i18n/fr.po (+101/-19)
openerp/addons/base/i18n/hu.po (+15/-6)
openerp/addons/base/i18n/mn.po (+11/-0)
openerp/addons/base/i18n/nl.po (+11/-2)
openerp/addons/base/i18n/ro.po (+17/-5)
openerp/addons/base/i18n/tr.po (+15/-0)
openerp/netsvc.py (+5/-1)
openerp/osv/orm.py (+18/-3)
openerp/osv/osv.py (+0/-3)
openerp/report/report_sxw.py (+2/-0)
openerp/service/workers.py (+7/-1)
openerp/sql_db.py (+3/-7)
openerp/tests/addons/test_impex/ir.model.access.csv (+1/-0)
openerp/tests/addons/test_impex/models.py (+10/-0)
openerp/tests/addons/test_impex/tests/test_load.py (+26/-0)
Text conflict in openerp/addons/base/i18n/fr.po
Text conflict in openerp/addons/base/i18n/hu.po
Text conflict in openerp/addons/base/i18n/mn.po
Text conflict in openerp/addons/base/i18n/nl.po
Text conflict in openerp/addons/base/i18n/ro.po
Text conflict in openerp/addons/base/i18n/tr.po
To merge this branch: bzr merge lp:~openerp-dev/openobject-server/7.0-remove-duplicate-logging-xmo
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+147878@code.launchpad.net

Description of the change

Part of fp-desired effort to cut down on redundant or non-actionable `error` logging (including exceptions): exceptions thrown from psycopg will often be logged twice, and even when expected and caught will be logged *anyway* by a logging layer in sql_db itself, surrounding the query execution code.

This logging was removed, with its actual feature (ensuring the SQL query itself is logged) moved to dispatch_rpc, by logging the error's `.cursor.query` attribute if there is one.

Just in case, if the query execution fails but no `query` is set on the exception's `cursor` (e.g. psycopg2 blew up during parameter adaptation so no query's been executed), manually add the (non-adapted) query to the cursor for logging (can give hints as to what was being done).

To post a comment you must log in.

Unmerged revisions

4834. By Xavier (Open ERP)

[FIX] don't log-and-raise in @check

4833. By Xavier (Open ERP)

[IMP] Remove exception logging in sql_db.py

Redundant with the same feature in dispatch_rpc: exceptions triggered
by a cr.execute may find themselves logged twice, with and without
useful stack (logging.exception will only display the stack between
the place where the exception was thrown and where it's logged, so in
sql_db only a single — useless — level of stack will be displayed).

The logging in sql_db was most likely so the failed SQL could be
displayed in cases where the exception message does not display/format
it. This can be handled at a higher level by using `.cursor.query` on
psycopg2.Error objects.

Just in case the query isn't set on the cursor (e.g. if the error was
triggered while adapting arguments?), explicitly set the query on the
cursor if none is in sql_db.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'openerp/addons/base/i18n/fr.po'
2--- openerp/addons/base/i18n/fr.po 2013-02-07 04:53:20 +0000
3+++ openerp/addons/base/i18n/fr.po 2013-02-12 10:27:26 +0000
4@@ -7,14 +7,25 @@
5 "Project-Id-Version: OpenERP Server 5.0.4\n"
6 "Report-Msgid-Bugs-To: support@openerp.com\n"
7 "POT-Creation-Date: 2012-12-21 17:04+0000\n"
8+<<<<<<< TREE
9 "PO-Revision-Date: 2012-12-06 10:07+0000\n"
10 "Last-Translator: Quentin THEURET <Unknown>\n"
11 "Language-Team: \n"
12+=======
13+"PO-Revision-Date: 2013-02-07 10:58+0000\n"
14+"Last-Translator: Quentin THEURET <Unknown>\n"
15+"Language-Team: French <fr@li.org>\n"
16+>>>>>>> MERGE-SOURCE
17 "MIME-Version: 1.0\n"
18 "Content-Type: text/plain; charset=UTF-8\n"
19 "Content-Transfer-Encoding: 8bit\n"
20+<<<<<<< TREE
21 "X-Launchpad-Export-Date: 2013-02-07 04:45+0000\n"
22 "X-Generator: Launchpad (build 16477)\n"
23+=======
24+"X-Launchpad-Export-Date: 2013-02-08 05:22+0000\n"
25+"X-Generator: Launchpad (build 16482)\n"
26+>>>>>>> MERGE-SOURCE
27
28 #. module: base
29 #: model:ir.module.module,description:base.module_account_check_writing
30@@ -42,7 +53,7 @@
31 #. module: base
32 #: selection:ir.property,type:0
33 msgid "DateTime"
34-msgstr "Horodatage"
35+msgstr "Date/Heure"
36
37 #. module: base
38 #: code:addons/fields.py:643
39@@ -698,6 +709,22 @@
40 " A + B + C -> D + E\n"
41 " "
42 msgstr ""
43+"\n"
44+"Ce module vous permet de produire plusieurs produits à partir d'un ordre de "
45+"production.\n"
46+"======================================================================\n"
47+"\n"
48+"Vous pouvez configurer des sous-produits dans la nomenclature des "
49+"matériaux.\n"
50+"\n"
51+"Sans ce module :\n"
52+"----------------------\n"
53+" A + B + C -> D\n"
54+"\n"
55+"Avec ce module : \n"
56+"-----------------------\n"
57+" A + B + C -> D + E\n"
58+" "
59
60 #. module: base
61 #: selection:base.language.install,lang:0
62@@ -2217,7 +2244,7 @@
63 #. module: base
64 #: help:ir.attachment,res_id:0
65 msgid "The record id this is attached to"
66-msgstr ""
67+msgstr "L'ID de l'enregistrement est attaché à"
68
69 #. module: base
70 #: model:ir.module.module,description:base.module_share
71@@ -3594,7 +3621,7 @@
72 #. module: base
73 #: field:res.company,rml_header1:0
74 msgid "Company Tagline"
75-msgstr ""
76+msgstr "Slogan de la société"
77
78 #. module: base
79 #: code:addons/base/res/res_users.py:668
80@@ -3612,6 +3639,8 @@
81 "the user will have an access to the human resources configuration as well as "
82 "statistic reports."
83 msgstr ""
84+"l'utilisateur aura un accès à la configuration des ressources humaines comme "
85+"aux rapports statistiques."
86
87 #. module: base
88 #: model:ir.module.module,description:base.module_l10n_pl
89@@ -4409,6 +4438,18 @@
90 "If you need to manage your meetings, you should install the CRM module.\n"
91 " "
92 msgstr ""
93+"\n"
94+"Ceci est un système complet d'agenda.\n"
95+"===============================\n"
96+"\n"
97+"Il supporte :\n"
98+"---------------\n"
99+" - L'agenda des événements,\n"
100+" - Les événements récurrents.\n"
101+"\n"
102+"Si vous souhaitez gérer vos rendez-vous, vous devriez installer le module "
103+"CRM.\n"
104+" "
105
106 #. module: base
107 #: model:res.country,name:base.je
108@@ -4438,7 +4479,7 @@
109 #. module: base
110 #: view:res.partner:0
111 msgid "Tag"
112-msgstr ""
113+msgstr "Étiquette"
114
115 #. module: base
116 #: view:res.lang:0
117@@ -4478,7 +4519,7 @@
118 #. module: base
119 #: model:res.country,name:base.sk
120 msgid "Slovakia"
121-msgstr ""
122+msgstr "Slovaquie"
123
124 #. module: base
125 #: model:res.country,name:base.nr
126@@ -4719,6 +4760,18 @@
127 "comptable\n"
128 "Seddik au cours du troisième trimestre 2010."
129 msgstr ""
130+"\n"
131+"Ce module de base permet de gérer le plan comptable pour le Maroc.\n"
132+"=================================================================\n"
133+"\n"
134+"Ce Module charge le modèle du plan de comptes standard Marocain et permet "
135+"de\n"
136+"générer les états comptables aux normes marocaines (Bilan, CPC (comptes de\n"
137+"produits et charges), balance générale à 6 colonnes, Grand livre "
138+"cumulatif...).\n"
139+"L'intégration comptable a été validé avec l'aide du Cabinet d'expertise "
140+"comptable\n"
141+"Seddik au cours du troisième trimestre 2010."
142
143 #. module: base
144 #: help:ir.module.module,auto_install:0
145@@ -4753,7 +4806,7 @@
146 #. module: base
147 #: model:ir.ui.menu,name:base.menu_event_main
148 msgid "Events Organization"
149-msgstr ""
150+msgstr "Organisation d'évènements"
151
152 #. module: base
153 #: model:ir.actions.act_window,name:base.action_partner_customer_form
154@@ -4781,7 +4834,7 @@
155 #. module: base
156 #: model:ir.module.category,name:base.module_category_managing_vehicles_and_contracts
157 msgid "Managing vehicles and contracts"
158-msgstr ""
159+msgstr "Gestion de véhicules et de contrats"
160
161 #. module: base
162 #: model:ir.module.module,description:base.module_base_setup
163@@ -4908,12 +4961,12 @@
164 #. module: base
165 #: model:ir.module.module,summary:base.module_sale
166 msgid "Quotations, Sales Orders, Invoicing"
167-msgstr ""
168+msgstr "Devis, commandes, facturation"
169
170 #. module: base
171 #: field:res.partner,parent_id:0
172 msgid "Related Company"
173-msgstr ""
174+msgstr "Société parente"
175
176 #. module: base
177 #: help:ir.actions.act_url,help:0
178@@ -4959,7 +5012,7 @@
179 #. module: base
180 #: model:ir.module.module,shortdesc:base.module_knowledge
181 msgid "Knowledge Management System"
182-msgstr ""
183+msgstr "Base de connaissances"
184
185 #. module: base
186 #: view:workflow.activity:0
187@@ -4983,6 +5036,14 @@
188 "invite.\n"
189 "\n"
190 msgstr ""
191+"\n"
192+"Ce module met à jour les notes dans OpenERP, en utilisant un éditeur "
193+"externe\n"
194+"===============================================================\n"
195+"\n"
196+"Utilisez le pour mettre à jour vos notes en temps réel, avec les "
197+"utilisateurs invités.\n"
198+"\n"
199
200 #. module: base
201 #: model:ir.module.module,description:base.module_account_sequence
202@@ -5002,6 +5063,23 @@
203 " * Number Padding\n"
204 " "
205 msgstr ""
206+"\n"
207+"Ce module permet de paramétrer les séquences de numérotation interne des "
208+"écritures comptables.\n"
209+"============================================================================="
210+"=\n"
211+"\n"
212+"Il permet de configurer les séquences comptables\n"
213+"\n"
214+"Vous pouvez personnaliser les attributs suivants de la séquence : \n"
215+"-----------------------------------------------------------------------------"
216+"-----------\n"
217+" * Préfixe\n"
218+" * Suffixe\n"
219+" * Nombre suivant\n"
220+" * Incrément\n"
221+" * Espacement.\n"
222+" "
223
224 #. module: base
225 #: model:ir.module.module,shortdesc:base.module_project_timesheet
226@@ -13513,7 +13591,7 @@
227 #. module: base
228 #: field:res.users,new_password:0
229 msgid "Set Password"
230-msgstr ""
231+msgstr "Définir le mot de passe"
232
233 #. module: base
234 #: field:ir.actions.server,subject:0
235@@ -14748,7 +14826,7 @@
236 #. module: base
237 #: model:ir.model,name:base.model_change_password_wizard
238 msgid "Change Password Wizard"
239-msgstr ""
240+msgstr "Assistant de changement de mot de passe"
241
242 #. module: base
243 #: model:ir.module.module,summary:base.module_account_voucher
244@@ -14867,7 +14945,7 @@
245 #: view:base.module.upgrade:0
246 #: field:base.module.upgrade,module_info:0
247 msgid "Modules to Update"
248-msgstr ""
249+msgstr "Modules à mettre à jour"
250
251 #. module: base
252 #: model:ir.ui.menu,name:base.menu_custom_multicompany
253@@ -14956,7 +15034,7 @@
254 #. module: base
255 #: field:ir.module.module,name:0
256 msgid "Technical Name"
257-msgstr ""
258+msgstr "Nom technique"
259
260 #. module: base
261 #: model:ir.model,name:base.model_workflow_workitem
262@@ -15020,7 +15098,7 @@
263 #. module: base
264 #: view:ir.sequence:0
265 msgid "Day of the Year: %(doy)s"
266-msgstr ""
267+msgstr "Jour de l'année: %(doy)s"
268
269 #. module: base
270 #: field:ir.ui.menu,web_icon:0
271@@ -15043,6 +15121,8 @@
272 "If this field is empty, the view applies to all users. Otherwise, the view "
273 "applies to the users of those groups only."
274 msgstr ""
275+"Si ce champ est vide, la vue s'applique à tous les utilisateurs. Sinon, la "
276+"vue s'applique aux utilisateurs de ces groupes uniquement."
277
278 #. module: base
279 #: selection:base.language.install,lang:0
280@@ -15057,12 +15137,12 @@
281 #. module: base
282 #: field:ir.actions.act_window,src_model:0
283 msgid "Source Model"
284-msgstr ""
285+msgstr "Classe source"
286
287 #. module: base
288 #: view:ir.sequence:0
289 msgid "Day of the Week (0:Monday): %(weekday)s"
290-msgstr ""
291+msgstr "Jour de la semaine (0: lundi): %(weekday)s"
292
293 #. module: base
294 #: code:addons/base/module/wizard/base_module_upgrade.py:84
295@@ -15076,7 +15156,7 @@
296 #: code:addons/base/ir/ir_model.py:1024
297 #, python-format
298 msgid "Administrator access is required to uninstall a module"
299-msgstr ""
300+msgstr "L'accès administrateur est nécessaire pour désinstaller un module"
301
302 #. module: base
303 #: model:ir.model,name:base.model_base_module_configuration
304@@ -15780,7 +15860,7 @@
305 #. module: base
306 #: model:ir.module.module,shortdesc:base.module_web_view_editor
307 msgid "View Editor"
308-msgstr ""
309+msgstr "Editeur de vue"
310
311 #. module: base
312 #: view:ir.cron:0
313@@ -15860,6 +15940,8 @@
314 "Do you confirm the uninstallation of this module? This will permanently "
315 "erase all data currently stored by the module!"
316 msgstr ""
317+"Confirmez-vous la désinstallation de ce module ? Cela efface définitivement "
318+"toutes les données actuellement stockées par le module !"
319
320 #. module: base
321 #: field:ir.actions.server,mobile:0
322
323=== modified file 'openerp/addons/base/i18n/hu.po'
324--- openerp/addons/base/i18n/hu.po 2013-02-07 04:53:20 +0000
325+++ openerp/addons/base/i18n/hu.po 2013-02-12 10:27:26 +0000
326@@ -7,14 +7,23 @@
327 "Project-Id-Version: OpenERP Server 6.0\n"
328 "Report-Msgid-Bugs-To: support@openerp.com\n"
329 "POT-Creation-Date: 2012-12-21 17:04+0000\n"
330+<<<<<<< TREE
331 "PO-Revision-Date: 2012-12-23 19:57+0000\n"
332+=======
333+"PO-Revision-Date: 2013-02-09 14:26+0000\n"
334+>>>>>>> MERGE-SOURCE
335 "Last-Translator: krnkris <Unknown>\n"
336 "Language-Team: Hungarian <openerp-hungarian-team@lists.launchpad.net>\n"
337 "MIME-Version: 1.0\n"
338 "Content-Type: text/plain; charset=UTF-8\n"
339 "Content-Transfer-Encoding: 8bit\n"
340+<<<<<<< TREE
341 "X-Launchpad-Export-Date: 2013-02-07 04:46+0000\n"
342 "X-Generator: Launchpad (build 16477)\n"
343+=======
344+"X-Launchpad-Export-Date: 2013-02-10 05:23+0000\n"
345+"X-Generator: Launchpad (build 16482)\n"
346+>>>>>>> MERGE-SOURCE
347
348 #. module: base
349 #: model:ir.module.module,description:base.module_account_check_writing
350@@ -17983,7 +17992,7 @@
351 #. module: base
352 #: field:res.partner,color:0
353 msgid "Color Index"
354-msgstr "Szín mutató"
355+msgstr "Szín meghatározó"
356
357 #. module: base
358 #: model:ir.actions.act_window,help:base.action_partner_category_form
359@@ -17994,10 +18003,10 @@
360 "also belong to his parent category."
361 msgstr ""
362 "Rendszerezze a partner kategóriákat annak érdekében, hogy hatékonyabban "
363-"tudja osztályozni őket a nyomonkövetési és analitikai célokra. Egy partner "
364-"több kategóriához is tartozhat és a kategóriák hierarchikus szerkezettel is "
365-"rendelkezhetnek: egy partner, aki egy adott kategóriához tartozik szintén "
366-"tartozhat a szülőkategóriához is."
367+"tudja osztályozni őket a nyomonkövetési és analitikai, elemzési célokra. Egy "
368+"partner több kategóriához is tartozhat és a kategóriák hierarchikus "
369+"szerkezettel is rendelkezhetnek: egy partner, aki egy adott kategóriához "
370+"tartozik, szintén tartozhat a szülőkategóriához is."
371
372 #. module: base
373 #: model:ir.module.module,description:base.module_survey
374@@ -18029,7 +18038,7 @@
375 "választ adhat a \n"
376 "különböző kérdésekre ha a felmérés elkészült. Partnerek is küldhetnek emailt "
377 "a felhasználó\n"
378-"nevével és jelszóval meghívásként a felmérésben való részvételhez.\n"
379+"nevével és jelszóval, meghívásként a felmérésben való részvételhez.\n"
380 " "
381
382 #. module: base
383
384=== modified file 'openerp/addons/base/i18n/mn.po'
385--- openerp/addons/base/i18n/mn.po 2013-02-08 04:35:51 +0000
386+++ openerp/addons/base/i18n/mn.po 2013-02-12 10:27:26 +0000
387@@ -7,14 +7,25 @@
388 "Project-Id-Version: OpenERP Server 6.0.0-rc1\n"
389 "Report-Msgid-Bugs-To: support@openerp.com\n"
390 "POT-Creation-Date: 2012-12-21 17:04+0000\n"
391+<<<<<<< TREE
392 "PO-Revision-Date: 2013-02-07 04:04+0000\n"
393 "Last-Translator: Tenuun Khangaitan <tenuun.khangaitan@gmail.com>\n"
394 "Language-Team: \n"
395+=======
396+"PO-Revision-Date: 2013-02-07 06:29+0000\n"
397+"Last-Translator: Amar Zayasaikhan <chup.mono@gmail.com>\n"
398+"Language-Team: Mongolian <mn@li.org>\n"
399+>>>>>>> MERGE-SOURCE
400 "MIME-Version: 1.0\n"
401 "Content-Type: text/plain; charset=UTF-8\n"
402 "Content-Transfer-Encoding: 8bit\n"
403+<<<<<<< TREE
404 "X-Launchpad-Export-Date: 2013-02-08 04:35+0000\n"
405 "X-Generator: Launchpad (build 16482)\n"
406+=======
407+"X-Launchpad-Export-Date: 2013-02-08 05:22+0000\n"
408+"X-Generator: Launchpad (build 16482)\n"
409+>>>>>>> MERGE-SOURCE
410
411 #. module: base
412 #: model:ir.module.module,description:base.module_account_check_writing
413
414=== modified file 'openerp/addons/base/i18n/nl.po'
415--- openerp/addons/base/i18n/nl.po 2013-02-07 04:53:20 +0000
416+++ openerp/addons/base/i18n/nl.po 2013-02-12 10:27:26 +0000
417@@ -7,14 +7,23 @@
418 "Project-Id-Version: OpenERP Server 5.0.0\n"
419 "Report-Msgid-Bugs-To: support@openerp.com\n"
420 "POT-Creation-Date: 2012-12-21 17:04+0000\n"
421+<<<<<<< TREE
422 "PO-Revision-Date: 2012-12-22 07:41+0000\n"
423+=======
424+"PO-Revision-Date: 2013-02-07 09:28+0000\n"
425+>>>>>>> MERGE-SOURCE
426 "Last-Translator: Erwin van der Ploeg (Endian Solutions) <Unknown>\n"
427 "Language-Team: \n"
428 "MIME-Version: 1.0\n"
429 "Content-Type: text/plain; charset=UTF-8\n"
430 "Content-Transfer-Encoding: 8bit\n"
431+<<<<<<< TREE
432 "X-Launchpad-Export-Date: 2013-02-07 04:44+0000\n"
433 "X-Generator: Launchpad (build 16477)\n"
434+=======
435+"X-Launchpad-Export-Date: 2013-02-08 05:22+0000\n"
436+"X-Generator: Launchpad (build 16482)\n"
437+>>>>>>> MERGE-SOURCE
438
439 #. module: base
440 #: model:ir.module.module,description:base.module_account_check_writing
441@@ -2225,7 +2234,7 @@
442 #. module: base
443 #: model:ir.module.module,shortdesc:base.module_account_chart
444 msgid "Template of Charts of Accounts"
445-msgstr "Grootboekschema template"
446+msgstr "Grootboekschema sjabloon"
447
448 #. module: base
449 #: field:res.partner,type:0
450@@ -7428,7 +7437,7 @@
451 #. module: base
452 #: model:ir.actions.server,name:base.action_server_module_immediate_install
453 msgid "Module Immediate Install"
454-msgstr "Module directie installatie"
455+msgstr "Directe installatie"
456
457 #. module: base
458 #: view:ir.actions.server:0
459
460=== modified file 'openerp/addons/base/i18n/ro.po'
461--- openerp/addons/base/i18n/ro.po 2013-02-07 04:53:20 +0000
462+++ openerp/addons/base/i18n/ro.po 2013-02-12 10:27:26 +0000
463@@ -7,14 +7,25 @@
464 "Project-Id-Version: OpenERP Server 5.0.4\n"
465 "Report-Msgid-Bugs-To: support@openerp.com\n"
466 "POT-Creation-Date: 2012-12-21 17:04+0000\n"
467+<<<<<<< TREE
468 "PO-Revision-Date: 2013-01-05 18:18+0000\n"
469 "Last-Translator: Fekete Mihai <mihai@erpsystems.ro>\n"
470 "Language-Team: \n"
471+=======
472+"PO-Revision-Date: 2013-02-10 10:25+0000\n"
473+"Last-Translator: Fekete Mihai <mihai@erpsystems.ro>\n"
474+"Language-Team: Romanian <ro@li.org>\n"
475+>>>>>>> MERGE-SOURCE
476 "MIME-Version: 1.0\n"
477 "Content-Type: text/plain; charset=UTF-8\n"
478 "Content-Transfer-Encoding: 8bit\n"
479+<<<<<<< TREE
480 "X-Launchpad-Export-Date: 2013-02-07 04:49+0000\n"
481 "X-Generator: Launchpad (build 16477)\n"
482+=======
483+"X-Launchpad-Export-Date: 2013-02-11 05:34+0000\n"
484+"X-Generator: Launchpad (build 16482)\n"
485+>>>>>>> MERGE-SOURCE
486
487 #. module: base
488 #: model:ir.module.module,description:base.module_account_check_writing
489@@ -11497,11 +11508,12 @@
490 msgstr ""
491 "Stimate Domn/Doamna,\n"
492 "\n"
493-"Inregistrarile noastre indica faptul ca unii parametrii din contul "
494-"dumneavoastra sunt inca scadente. Aveti toate detaliile mai jos.\n"
495-"Daca suma a fost deja platita, va rugam sa ignorati acest aviz. In cazul in "
496-"care nu a fost platita inca, va rugam sa efectuati plata restanta.\n"
497-"Daca aveti intrebari in legatura cu acest cont, va rugam sa ne contactati.\n"
498+"Inregistrarile noastre indica faptul ca aveti unele plati inca scadente. "
499+"Gasiti toate detaliile mai jos.\n"
500+"Daca suma a fost deja platita, va rugam sa ignorati acest aviz. In cazul "
501+"contrar, va rugam sa efectuati plata restanta descrisa mai jos.\n"
502+"Daca aveti intrebari in legatura cu contul dumneavoastra, va rugam sa ne "
503+"contactati.\n"
504 "\n"
505 "Va multumim anticipat pentru cooperarea dumneavoastra.\n"
506 "Cu stima,"
507
508=== modified file 'openerp/addons/base/i18n/tr.po'
509--- openerp/addons/base/i18n/tr.po 2013-02-07 04:53:20 +0000
510+++ openerp/addons/base/i18n/tr.po 2013-02-12 10:27:26 +0000
511@@ -7,14 +7,25 @@
512 "Project-Id-Version: OpenERP Server 5.0.4\n"
513 "Report-Msgid-Bugs-To: support@openerp.com\n"
514 "POT-Creation-Date: 2012-12-21 17:04+0000\n"
515+<<<<<<< TREE
516 "PO-Revision-Date: 2012-11-28 08:41+0000\n"
517 "Last-Translator: Ahmet Altınışık <Unknown>\n"
518 "Language-Team: \n"
519+=======
520+"PO-Revision-Date: 2013-02-06 22:07+0000\n"
521+"Last-Translator: Ediz Duman <neps1192@gmail.com>\n"
522+"Language-Team: Turkish <tr@li.org>\n"
523+>>>>>>> MERGE-SOURCE
524 "MIME-Version: 1.0\n"
525 "Content-Type: text/plain; charset=UTF-8\n"
526 "Content-Transfer-Encoding: 8bit\n"
527+<<<<<<< TREE
528 "X-Launchpad-Export-Date: 2013-02-07 04:50+0000\n"
529 "X-Generator: Launchpad (build 16477)\n"
530+=======
531+"X-Launchpad-Export-Date: 2013-02-07 05:40+0000\n"
532+"X-Generator: Launchpad (build 16477)\n"
533+>>>>>>> MERGE-SOURCE
534
535 #. module: base
536 #: model:ir.module.module,description:base.module_account_check_writing
537@@ -15500,6 +15511,7 @@
538 #. module: base
539 #: model:ir.module.module,shortdesc:base.module_auth_signup
540 msgid "Signup"
541+<<<<<<< TREE
542 msgstr "Bağlanma"
543
544 #~ msgid "Contact Name"
545@@ -17625,3 +17637,6 @@
546 #~ "\n"
547 #~ "Banka tipi IBAN hesaplarına geçerli ödeme yapabilmek için lütfen bankanın "
548 #~ "BIC/SWIFT kodunu tanımlayın"
549+=======
550+msgstr "Bağlanma"
551+>>>>>>> MERGE-SOURCE
552
553=== modified file 'openerp/netsvc.py'
554--- openerp/netsvc.py 2013-02-06 14:07:40 +0000
555+++ openerp/netsvc.py 2013-02-12 10:27:26 +0000
556@@ -317,7 +317,11 @@
557 post_mortem(e.traceback)
558 raise
559 except Exception, e:
560- _logger.exception(tools.exception_to_unicode(e))
561+ message = tools.exception_to_unicode(e)
562+ query = getattr(getattr(e, 'cursor', None), 'query', None)
563+ if query is not None:
564+ message = "%s\n%s" % (message, query)
565+ _logger.exception(message)
566 post_mortem(sys.exc_info())
567 raise
568
569
570=== modified file 'openerp/osv/orm.py'
571--- openerp/osv/orm.py 2013-01-16 16:40:25 +0000
572+++ openerp/osv/orm.py 2013-02-12 10:27:26 +0000
573@@ -1077,7 +1077,7 @@
574
575 # Validate rec_name
576 if self._rec_name is not None:
577- assert self._rec_name in self._columns.keys() + ['id'], "Invalid rec_name %s for model %s" % (self._rec_name, self._name)
578+ assert self._rec_name in self._all_columns.keys() + ['id'], "Invalid rec_name %s for model %s" % (self._rec_name, self._name)
579 else:
580 self._rec_name = 'name'
581
582@@ -1362,11 +1362,9 @@
583 noupdate=noupdate, res_id=id, context=context))
584 cr.execute('RELEASE SAVEPOINT model_load_save')
585 except psycopg2.Warning, e:
586- _logger.exception('Failed to import record %s', record)
587 messages.append(dict(info, type='warning', message=str(e)))
588 cr.execute('ROLLBACK TO SAVEPOINT model_load_save')
589 except psycopg2.Error, e:
590- _logger.exception('Failed to import record %s', record)
591 messages.append(dict(
592 info, type='error',
593 **PGERROR_TO_OE[e.pgcode](self, fg, info, e)))
594@@ -5327,11 +5325,28 @@
595 'message': message,
596 'field': field_name,
597 }
598+def convert_pgerror_23505(model, fields, info, e):
599+ m = re.match(r'^duplicate key (?P<field>\w+) violates unique constraint',
600+ str(e))
601+ field_name = m.group('field')
602+ if not m or field_name not in fields:
603+ return {'message': unicode(e)}
604+ message = _(u"The value for the field '%s' already exists.") % field_name
605+ field = fields.get(field_name)
606+ if field:
607+ message = _(u"%s This might be '%s' in the current model, or a field "
608+ u"of the same name in an o2m.") % (message, field['string'])
609+ return {
610+ 'message': message,
611+ 'field': field_name,
612+ }
613
614 PGERROR_TO_OE = collections.defaultdict(
615 # shape of mapped converters
616 lambda: (lambda model, fvg, info, pgerror: {'message': unicode(pgerror)}), {
617 # not_null_violation
618 '23502': convert_pgerror_23502,
619+ # unique constraint error
620+ '23505': convert_pgerror_23505,
621 })
622 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
623
624=== modified file 'openerp/osv/osv.py'
625--- openerp/osv/osv.py 2012-12-09 03:49:10 +0000
626+++ openerp/osv/osv.py 2013-02-12 10:27:26 +0000
627@@ -153,9 +153,6 @@
628 netsvc.abort_response(1, _('Integrity Error'), 'warning', msg)
629 else:
630 netsvc.abort_response(1, _('Integrity Error'), 'warning', inst[0])
631- except Exception:
632- _logger.exception("Uncaught exception")
633- raise
634
635 return wrapper
636
637
638=== modified file 'openerp/report/report_sxw.py'
639--- openerp/report/report_sxw.py 2013-01-02 16:40:57 +0000
640+++ openerp/report/report_sxw.py 2013-02-12 10:27:26 +0000
641@@ -189,6 +189,8 @@
642 return newtag, attrs
643
644 def _ellipsis(self, char, size=100, truncation_str='...'):
645+ if not char:
646+ return ''
647 if len(char) <= size:
648 return char
649 return char[:size-len(truncation_str)] + truncation_str
650
651=== modified file 'openerp/service/workers.py'
652--- openerp/service/workers.py 2012-12-29 13:36:16 +0000
653+++ openerp/service/workers.py 2013-02-12 10:27:26 +0000
654@@ -319,7 +319,13 @@
655 fcntl.fcntl(client, fcntl.F_SETFD, flags)
656 # do request using WorkerBaseWSGIServer monkey patched with socket
657 self.server.socket = client
658- self.server.process_request(client,addr)
659+ # tolerate broken pipe when the http client closes the socket before
660+ # receiving the full reply
661+ try:
662+ self.server.process_request(client,addr)
663+ except IOError, e:
664+ if e.errno != errno.EPIPE:
665+ raise
666 self.request_count += 1
667
668 def process_work(self):
669
670=== modified file 'openerp/sql_db.py'
671--- openerp/sql_db.py 2012-12-14 12:43:10 +0000
672+++ openerp/sql_db.py 2013-02-12 10:27:26 +0000
673@@ -225,13 +225,9 @@
674 try:
675 params = params or None
676 res = self._obj.execute(query, params)
677- except psycopg2.ProgrammingError, pe:
678- if self._default_log_exceptions if log_exceptions is None else log_exceptions:
679- _logger.error("Programming error: %s, in query %s", pe, query)
680- raise
681- except Exception:
682- if self._default_log_exceptions if log_exceptions is None else log_exceptions:
683- _logger.exception("bad query: %s", self._obj.query or query)
684+ except psycopg2.Error, e:
685+ if e.cursor.query is None:
686+ e.cursor.query = query
687 raise
688
689 if self.sql_log:
690
691=== modified file 'openerp/tests/addons/test_impex/ir.model.access.csv'
692--- openerp/tests/addons/test_impex/ir.model.access.csv 2012-11-16 10:05:05 +0000
693+++ openerp/tests/addons/test_impex/ir.model.access.csv 2013-02-12 10:27:26 +0000
694@@ -23,3 +23,4 @@
695 access_export_many2many_other,access_export_many2many_other,model_export_many2many_other,,1,1,1,1
696 access_export_selection_withdefault,access_export_selection_withdefault,model_export_selection_withdefault,,1,1,1,1
697 access_export_one2many_recursive,access_export_one2many_recursive,model_export_one2many_recursive,,1,1,1,1
698+access_export_unique,access_export_unique,model_export_unique,,1,1,1,1
699
700=== modified file 'openerp/tests/addons/test_impex/models.py'
701--- openerp/tests/addons/test_impex/models.py 2012-11-06 08:42:06 +0000
702+++ openerp/tests/addons/test_impex/models.py 2013-02-12 10:27:26 +0000
703@@ -144,3 +144,13 @@
704 'value': fields.integer(),
705 'child': fields.one2many('export.one2many.multiple', 'parent_id')
706 }
707+
708+class OnlyOne(orm.Model):
709+ _name = 'export.unique'
710+
711+ _columns = {
712+ 'value': fields.integer(),
713+ }
714+ _sql_constraints = [
715+ ('value_unique', 'unique (value)', "The value must be unique"),
716+ ]
717
718=== modified file 'openerp/tests/addons/test_impex/tests/test_load.py'
719--- openerp/tests/addons/test_impex/tests/test_load.py 2012-11-28 17:43:18 +0000
720+++ openerp/tests/addons/test_impex/tests/test_load.py 2013-02-12 10:27:26 +0000
721@@ -1149,3 +1149,29 @@
722 self.assertEqual(
723 values(self.read(domain=[('id', 'in', result['ids'])])),
724 ['2012-02-03 11:11:11'])
725+
726+class test_unique(ImporterCase):
727+ model_name = 'export.unique'
728+
729+ @mute_logger('openerp.sql_db')
730+ def test_unique(self):
731+ result = self.import_(['value'], [
732+ ['1'],
733+ ['1'],
734+ ['2'],
735+ ['3'],
736+ ['3'],
737+ ])
738+ self.assertFalse(result['ids'])
739+ self.assertEqual(result['messages'], [
740+ dict(message=u"The value for the field 'value' already exists. "
741+ u"This might be 'unknown' in the current model, "
742+ u"or a field of the same name in an o2m.",
743+ type='error', rows={'from': 1, 'to': 1},
744+ record=1, field='value'),
745+ dict(message=u"The value for the field 'value' already exists. "
746+ u"This might be 'unknown' in the current model, "
747+ u"or a field of the same name in an o2m.",
748+ type='error', rows={'from': 4, 'to': 4},
749+ record=4, field='value'),
750+ ])