From b6c578d54ec73ea82fbad0e4ff0266f34f65589d Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Fri, 4 Apr 2014 10:55:04 +0200 Subject: [PATCH 1/5] [IMP] web_graph: when exporting to xls, export float data as raw instead of string lp bug: https://launchpad.net/bugs/1279803 fixed bzr revid: mat@openerp.com-20140404085504-t9np8xok33rb0mow --- addons/web_graph/static/src/js/graph_widget.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/addons/web_graph/static/src/js/graph_widget.js b/addons/web_graph/static/src/js/graph_widget.js index 3f6acdf87a7..bb87e172718 100644 --- a/addons/web_graph/static/src/js/graph_widget.js +++ b/addons/web_graph/static/src/js/graph_widget.js @@ -381,11 +381,11 @@ openerp.web_graph.Graph = openerp.web.Widget.extend({ // Convert Pivot data structure into table structure : // compute rows, cols, colors, cell width, cell height, ... // ---------------------------------------------------------------------- - build_table: function() { + build_table: function(raw) { return { headers: this.build_headers(), measure_row: this.build_measure_row(), - rows: this.build_rows(), + rows: this.build_rows(raw), nbr_measures: this.pivot.measures.length, title: this.title, }; @@ -435,8 +435,8 @@ openerp.web_graph.Graph = openerp.web.Widget.extend({ return result; }, - make_cell: function (row, col, value, index) { - var formatted_value = openerp.web.format_value(value, {type:this.pivot.measures[index].type}), + make_cell: function (row, col, value, index, raw) { + var formatted_value = raw ? value : openerp.web.format_value(value, {type:this.pivot.measures[index].type}), cell = {value:formatted_value}; if (this.heatmap_mode === 'none') { return cell; } @@ -450,7 +450,7 @@ openerp.web_graph.Graph = openerp.web.Widget.extend({ return cell; }, - build_rows: function () { + build_rows: function (raw) { var self = this, pivot = this.pivot, m, cell; @@ -460,13 +460,13 @@ openerp.web_graph.Graph = openerp.web.Widget.extend({ _.each(pivot.get_cols_leaves(), function (col) { var values = pivot.get_values(row.id,col.id); for (m = 0; m < pivot.measures.length; m++) { - cells.push(self.make_cell(row,col,values[m], m)); + cells.push(self.make_cell(row,col,values[m], m, raw)); } }); if (pivot.get_cols_leaves().length > 1) { var totals = pivot.get_total(row); for (m = 0; m < pivot.measures.length; m++) { - cell = self.make_cell(row, pivot.main_col(), totals[m], m); + cell = self.make_cell(row, pivot.main_col(), totals[m], m, raw); cell.is_bold = 'true'; cells.push(cell); } @@ -743,7 +743,7 @@ openerp.web_graph.Graph = openerp.web.Widget.extend({ openerp.web.blockUI(); this.session.get_file({ url: '/web_graph/export_xls', - data: {data: JSON.stringify(this.build_table())}, + data: {data: JSON.stringify(this.build_table(true))}, complete: openerp.web.unblockUI, error: c.rpc_error.bind(c) }); From 28f0649a7181272b528216d854c8e7438ff65aa9 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Fri, 4 Apr 2014 17:17:39 +0200 Subject: [PATCH 2/5] [FIX] skip undefined and keep formating as empty string bzr revid: mat@openerp.com-20140404151739-u61resk70xoih5he --- addons/web_graph/static/src/js/graph_widget.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web_graph/static/src/js/graph_widget.js b/addons/web_graph/static/src/js/graph_widget.js index bb87e172718..3d8d8fa2d98 100644 --- a/addons/web_graph/static/src/js/graph_widget.js +++ b/addons/web_graph/static/src/js/graph_widget.js @@ -436,7 +436,7 @@ openerp.web_graph.Graph = openerp.web.Widget.extend({ }, make_cell: function (row, col, value, index, raw) { - var formatted_value = raw ? value : openerp.web.format_value(value, {type:this.pivot.measures[index].type}), + var formatted_value = raw && !_.isUndefined(value) ? value : openerp.web.format_value(value, {type:this.pivot.measures[index].type}), cell = {value:formatted_value}; if (this.heatmap_mode === 'none') { return cell; } From 1d965535b0c30cc5d53260bc4bd53a3dd77fd050 Mon Sep 17 00:00:00 2001 From: Launchpad Translations on behalf of openerp <> Date: Sat, 5 Apr 2014 05:30:45 +0000 Subject: [PATCH 3/5] Launchpad automatic translations update. bzr revid: launchpad_translations_on_behalf_of_openerp-20140405053045-3cts3jqyeqsu0x57 --- addons/account/i18n/pl.po | 10 ++++++---- addons/account_followup/i18n/pl.po | 29 ++++++++++++++++------------- addons/auth_signup/i18n/pl.po | 14 +++++++------- addons/hr_holidays/i18n/pl.po | 8 ++++---- addons/mail/i18n/pl.po | 12 ++++++------ addons/procurement/i18n/pl.po | 20 +++++++++++--------- addons/stock/i18n/pl.po | 10 +++++----- 7 files changed, 55 insertions(+), 48 deletions(-) diff --git a/addons/account/i18n/pl.po b/addons/account/i18n/pl.po index ef2849cd444..ef779200db0 100644 --- a/addons/account/i18n/pl.po +++ b/addons/account/i18n/pl.po @@ -7,14 +7,14 @@ msgstr "" "Project-Id-Version: OpenERP Server 6.0dev\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2012-12-21 17:04+0000\n" -"PO-Revision-Date: 2012-12-22 12:46+0000\n" -"Last-Translator: Grzegorz Grzelak (OpenGLOBE.pl) \n" +"PO-Revision-Date: 2014-04-04 19:18+0000\n" +"Last-Translator: Dariusz Żbikowski \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-27 06:26+0000\n" -"X-Generator: Launchpad (build 16967)\n" +"X-Launchpad-Export-Date: 2014-04-05 05:30+0000\n" +"X-Generator: Launchpad (build 16976)\n" #. module: account #: model:process.transition,name:account.process_transition_supplierreconcilepaid0 @@ -989,6 +989,8 @@ msgid "" " opening/closing fiscal " "year process." msgstr "" +"Nie możesz anulować uzgodnień pozycji dziennika jeśli zostały one " +"wygenerowane procesem zamykania/otwierania roku." #. module: account #: model:ir.actions.act_window,name:account.action_subscription_form_new diff --git a/addons/account_followup/i18n/pl.po b/addons/account_followup/i18n/pl.po index b851b85d5df..1a37b819f02 100644 --- a/addons/account_followup/i18n/pl.po +++ b/addons/account_followup/i18n/pl.po @@ -7,14 +7,14 @@ msgstr "" "Project-Id-Version: OpenERP Server 6.0dev\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2012-12-21 17:05+0000\n" -"PO-Revision-Date: 2012-12-12 17:49+0000\n" -"Last-Translator: Grzegorz Grzelak (OpenGLOBE.pl) \n" +"PO-Revision-Date: 2014-04-04 19:44+0000\n" +"Last-Translator: Dariusz Żbikowski \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-27 06:16+0000\n" -"X-Generator: Launchpad (build 16967)\n" +"X-Launchpad-Export-Date: 2014-04-05 05:30+0000\n" +"X-Generator: Launchpad (build 16976)\n" #. module: account_followup #: model:email.template,subject:account_followup.email_template_account_followup_default @@ -109,7 +109,7 @@ msgstr "Kroki monitowania płatności" #. module: account_followup #: field:account_followup.print,email_body:0 msgid "Email Body" -msgstr "" +msgstr "Treść email" #. module: account_followup #: model:ir.actions.act_window,name:account_followup.action_account_followup_print @@ -403,7 +403,7 @@ msgstr "Monity o płatność" #. module: account_followup #: field:account_followup.followup.line,delay:0 msgid "Due Days" -msgstr "" +msgstr "Dni zwłoki" #. module: account_followup #: field:account.move.line,followup_line_id:0 @@ -419,7 +419,7 @@ msgstr "Ostatni monit o płatność" #. module: account_followup #: model:ir.ui.menu,name:account_followup.menu_manual_reconcile_followup msgid "Reconcile Invoices & Payments" -msgstr "" +msgstr "Uzgadnianie Faktur i Płatności" #. module: account_followup #: model:ir.ui.menu,name:account_followup.account_followup_s @@ -429,7 +429,7 @@ msgstr "Wykonaj manualnie monit o płatność" #. module: account_followup #: report:account_followup.followup.print:0 msgid "Li." -msgstr "" +msgstr "Sp." #. module: account_followup #: field:account_followup.print,email_conf:0 @@ -499,6 +499,7 @@ msgstr "Monitowanie płatności" #, python-format msgid "Email not sent because of email address of partner not filled in" msgstr "" +"Email nie został wysłany ponieważ adres email partnera nie został wypełniony" #. module: account_followup #: model:ir.model,name:account_followup.model_account_followup_followup @@ -511,6 +512,8 @@ msgid "" "Optionally you can assign a user to this field, which will make him " "responsible for the action." msgstr "" +"Opcjonalnie możesz przypisać użytkownika do tego pola, który stanie się " +"odpowiedzialny za tę akcję." #. module: account_followup #: model:ir.model,name:account_followup.model_account_followup_sending_results @@ -528,7 +531,7 @@ msgstr "" #: code:addons/account_followup/wizard/account_followup_print.py:172 #, python-format msgid " manual action(s) assigned:" -msgstr "" +msgstr " ręczna akcja przypisana do:" #. module: account_followup #: view:res.partner:0 @@ -548,13 +551,13 @@ msgstr "Przeszukaj monity o płatność" #. module: account_followup #: view:res.partner:0 msgid "Account Move line" -msgstr "" +msgstr "Pozycja zapisu" #. module: account_followup #: code:addons/account_followup/wizard/account_followup_print.py:237 #, python-format msgid "Send Letters and Emails: Actions Summary" -msgstr "" +msgstr "Listy i Email: Podsumowanie akcji" #. module: account_followup #: view:account_followup.print:0 @@ -916,7 +919,7 @@ msgstr "" #. module: account_followup #: view:res.partner:0 msgid "Responsible" -msgstr "" +msgstr "Odpowiedzialny" #. module: account_followup #: model:ir.ui.menu,name:account_followup.menu_finance_followup @@ -945,7 +948,7 @@ msgstr "Działanie monitowania płatności" #. module: account_followup #: view:account_followup.stat:0 msgid "Including journal entries marked as a litigation" -msgstr "" +msgstr "Załącz pozycje dziennika oznaczone jako sporne" #. module: account_followup #: report:account_followup.followup.print:0 diff --git a/addons/auth_signup/i18n/pl.po b/addons/auth_signup/i18n/pl.po index ebbff79b333..a95f5b3738f 100644 --- a/addons/auth_signup/i18n/pl.po +++ b/addons/auth_signup/i18n/pl.po @@ -8,14 +8,14 @@ msgstr "" "Project-Id-Version: openobject-addons\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2012-12-21 17:05+0000\n" -"PO-Revision-Date: 2012-12-12 18:01+0000\n" -"Last-Translator: Grzegorz Grzelak (OpenGLOBE.pl) \n" +"PO-Revision-Date: 2014-04-04 19:12+0000\n" +"Last-Translator: Dariusz Żbikowski \n" "Language-Team: Polish \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-27 07:32+0000\n" -"X-Generator: Launchpad (build 16967)\n" +"X-Launchpad-Export-Date: 2014-04-05 05:30+0000\n" +"X-Generator: Launchpad (build 16976)\n" #. module: auth_signup #: field:res.partner,signup_type:0 @@ -80,7 +80,7 @@ msgstr "Wprowadź hasło o potwierdź je" #. module: auth_signup #: view:res.users:0 msgid "Send an email to the user to (re)set their password." -msgstr "" +msgstr "Wyślij email do użytkownika w celu zresetowania hasła" #. module: auth_signup #. openerp-web @@ -99,7 +99,7 @@ msgstr "Nowy" #: code:addons/auth_signup/res_users.py:258 #, python-format msgid "Mail sent to:" -msgstr "" +msgstr "Mail wysłano do:" #. module: auth_signup #: field:res.users,state:0 @@ -191,7 +191,7 @@ msgstr "Proszę wprowadź nazwę użytkownika lub adres email." #. module: auth_signup #: selection:res.users,state:0 msgid "Resetting Password" -msgstr "" +msgstr "Resetowane hasło" #. module: auth_signup #. openerp-web diff --git a/addons/hr_holidays/i18n/pl.po b/addons/hr_holidays/i18n/pl.po index 180ca272e3b..8473fa6ee49 100644 --- a/addons/hr_holidays/i18n/pl.po +++ b/addons/hr_holidays/i18n/pl.po @@ -7,14 +7,14 @@ msgstr "" "Project-Id-Version: OpenERP Server 6.0dev\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2012-12-21 17:04+0000\n" -"PO-Revision-Date: 2013-06-22 10:54+0000\n" +"PO-Revision-Date: 2014-04-04 19:21+0000\n" "Last-Translator: Dariusz Kubiak \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-27 06:53+0000\n" -"X-Generator: Launchpad (build 16967)\n" +"X-Launchpad-Export-Date: 2014-04-05 05:30+0000\n" +"X-Generator: Launchpad (build 16976)\n" #. module: hr_holidays #: selection:hr.holidays.status,color_name:0 @@ -680,7 +680,7 @@ msgstr "Podsumowanie" #. module: hr_holidays #: model:hr.holidays.status,name:hr_holidays.holiday_status_unpaid msgid "Unpaid" -msgstr "Bezpłatny" +msgstr "Urlop bezpłatny" #. module: hr_holidays #: xsl:holidays.summary:0 diff --git a/addons/mail/i18n/pl.po b/addons/mail/i18n/pl.po index e44e0a315b4..051e5bad35f 100644 --- a/addons/mail/i18n/pl.po +++ b/addons/mail/i18n/pl.po @@ -8,14 +8,14 @@ msgstr "" "Project-Id-Version: openobject-addons\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2012-12-21 17:04+0000\n" -"PO-Revision-Date: 2012-12-17 19:55+0000\n" -"Last-Translator: Grzegorz Grzelak (OpenGLOBE.pl) \n" +"PO-Revision-Date: 2014-04-04 19:25+0000\n" +"Last-Translator: Dariusz Żbikowski \n" "Language-Team: Polish \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-27 07:26+0000\n" -"X-Generator: Launchpad (build 16967)\n" +"X-Launchpad-Export-Date: 2014-04-05 05:30+0000\n" +"X-Generator: Launchpad (build 16976)\n" #. module: mail #: view:mail.followers:0 @@ -1363,7 +1363,7 @@ msgstr "Wiadomość Rich-text/HTML" #. module: mail #: view:mail.mail:0 msgid "Creation Month" -msgstr "Miesiąc tworzenia" +msgstr "Miesiąc utworzenia" #. module: mail #. openerp-web @@ -1509,7 +1509,7 @@ msgstr "" #: code:addons/mail/static/src/xml/mail.xml:213 #, python-format msgid "Please, wait while the file is uploading." -msgstr "" +msgstr "Poczekaj, aż plik zostanie załadowany." #. module: mail #: view:mail.group:0 diff --git a/addons/procurement/i18n/pl.po b/addons/procurement/i18n/pl.po index b503cce0ce3..8cb301665df 100644 --- a/addons/procurement/i18n/pl.po +++ b/addons/procurement/i18n/pl.po @@ -8,14 +8,14 @@ msgstr "" "Project-Id-Version: openobject-addons\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2012-12-21 17:06+0000\n" -"PO-Revision-Date: 2012-12-16 20:56+0000\n" -"Last-Translator: Grzegorz Grzelak (OpenGLOBE.pl) \n" +"PO-Revision-Date: 2014-04-04 19:08+0000\n" +"Last-Translator: Dariusz Żbikowski \n" "Language-Team: Polish \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-27 07:18+0000\n" -"X-Generator: Launchpad (build 16967)\n" +"X-Launchpad-Export-Date: 2014-04-05 05:30+0000\n" +"X-Generator: Launchpad (build 16976)\n" #. module: procurement #: model:ir.ui.menu,name:procurement.menu_stock_sched @@ -493,7 +493,7 @@ msgstr "Nieprzeczytane wiadomości" #. module: procurement #: selection:mrp.property,composition:0 msgid "plus" -msgstr "" +msgstr "plus" #. module: procurement #: help:procurement.order,state:0 @@ -515,6 +515,8 @@ msgid "" "If the active field is set to False, it will allow you to hide the " "orderpoint without removing it." msgstr "" +"Jeśli pole nie jest aktywne, pozwoli ci ukryć punkt zamawiania bez jego " +"kasowania." #. module: procurement #: view:product.product:0 @@ -547,8 +549,8 @@ msgid "" "You have to select a product unit of measure in the same category than the " "default unit of measure of the product" msgstr "" -"Musisz wybrać jednostkę miary z tej samej kategorii do domyślna jednostka " -"produktu." +"Musisz wybrać jednostkę miary z tej samej kategorii, co domyślna jednostka " +"produktu" #. module: procurement #: view:procurement.order:0 @@ -589,7 +591,7 @@ msgstr "Projekt" #: model:ir.ui.menu,name:procurement.menu_stock_proc_schedulers #: view:procurement.order.compute.all:0 msgid "Run Schedulers" -msgstr "uruchom planowanie" +msgstr "Uruchom planowanie" #. module: procurement #: view:procurement.order.compute:0 @@ -1027,7 +1029,7 @@ msgstr "Zapotrzbowanie uruchomione późno" #. module: procurement #: selection:mrp.property,composition:0 msgid "min" -msgstr "" +msgstr "min." #. module: procurement #: view:make.procurement:0 diff --git a/addons/stock/i18n/pl.po b/addons/stock/i18n/pl.po index 46fc140db91..66cb0cb868c 100644 --- a/addons/stock/i18n/pl.po +++ b/addons/stock/i18n/pl.po @@ -7,14 +7,14 @@ msgstr "" "Project-Id-Version: OpenERP Server 6.0dev\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2012-12-21 17:04+0000\n" -"PO-Revision-Date: 2012-12-22 15:56+0000\n" -"Last-Translator: Grzegorz Grzelak (OpenGLOBE.pl) \n" +"PO-Revision-Date: 2014-04-04 19:47+0000\n" +"Last-Translator: Dariusz Żbikowski \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-27 05:52+0000\n" -"X-Generator: Launchpad (build 16967)\n" +"X-Launchpad-Export-Date: 2014-04-05 05:30+0000\n" +"X-Generator: Launchpad (build 16976)\n" #. module: stock #: field:stock.inventory.line.split,line_exist_ids:0 @@ -1420,7 +1420,7 @@ msgstr "Zapas fizyczny" #: code:addons/stock/wizard/stock_move.py:214 #, python-format msgid "Processing Error!" -msgstr "" +msgstr "Błąd przetwarzania!" #. module: stock #: help:stock.location,chained_company_id:0 From de380aa914588a9c81fc1ef3e083ec42d8c84fd5 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Sun, 6 Apr 2014 15:25:19 +0200 Subject: [PATCH 4/5] [IMP] button snippet bzr revid: fp@tinyerp.com-20140406132519-eookdnec20c6sg20 --- addons/website/views/snippets.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/website/views/snippets.xml b/addons/website/views/snippets.xml index 0df57080b99..3e27ffb227f 100644 --- a/addons/website/views/snippets.xml +++ b/addons/website/views/snippets.xml @@ -511,13 +511,13 @@ Button -
+
-
+

50,000+ companies run Odoo to grow their businesses. -

+

Join us and make your company a better place.

From 9c1debf7d9b29ce31f3a126961c47fde9763568d Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Thu, 3 Apr 2014 17:17:46 +0200 Subject: [PATCH 5/5] [FIX] base_gengo: don't wait another cron job execution to ask translation for the next n words bzr revid: qdp-launchpad@openerp.com-20140403151746-znoheqb8scjmudct --- .../wizard/base_gengo_translations.py | 86 ++++++++++--------- 1 file changed, 47 insertions(+), 39 deletions(-) diff --git a/addons/base_gengo/wizard/base_gengo_translations.py b/addons/base_gengo/wizard/base_gengo_translations.py index ecfb696fddc..b044b929c65 100644 --- a/addons/base_gengo/wizard/base_gengo_translations.py +++ b/addons/base_gengo/wizard/base_gengo_translations.py @@ -71,7 +71,7 @@ class base_gengo_translations(osv.osv_memory): gengo = MyGengo( public_key=user.company_id.gengo_public_key.encode('ascii'), private_key=user.company_id.gengo_private_key.encode('ascii'), - sandbox = user.company_id.gengo_sandbox, + sandbox=user.company_id.gengo_sandbox, ) gengo.getAccountStats() return (True, gengo) @@ -83,7 +83,7 @@ class base_gengo_translations(osv.osv_memory): ''' Function called by the wizard. ''' - if context == None: + if context is None: context = {} flag, gengo = self.gengo_authentication(cr, uid, context=context) @@ -99,16 +99,16 @@ class base_gengo_translations(osv.osv_memory): ctx['gengo_language'] = wizard.lang_id.id if wizard.sync_limit > 200 or wizard.sync_limit < 1: raise osv.except_osv(_("Warning"), _('Sync limit should between 1 to 200 for Gengo translation services.')) - if wizard.sync_type in ['send','both']: + if wizard.sync_type in ['send', 'both']: self._sync_request(cr, uid, wizard.sync_limit, context=ctx) - if wizard.sync_type in ['receive','both']: - self._sync_response( cr, uid, wizard.sync_limit, context=ctx) + if wizard.sync_type in ['receive', 'both']: + self._sync_response(cr, uid, wizard.sync_limit, context=ctx) return {'type': 'ir.actions.act_window_close'} def _sync_response(self, cr, uid, limit=GENGO_DEFAULT_LIMIT, context=None): """ This method will be called by cron services to get translations from - Gengo. It will read translated terms and comments from Gengo and will + Gengo. It will read translated terms and comments from Gengo and will update respective ir.translation in openerp. """ translation_pool = self.pool.get('ir.translation') @@ -116,31 +116,36 @@ class base_gengo_translations(osv.osv_memory): if not flag: _logger.warning("%s", gengo) else: - translation_id = translation_pool.search(cr, uid, [('state', '=', 'inprogress'), ('gengo_translation', 'in', ('machine','standard','pro','ultra')), ('job_id', "!=",False)], limit=limit, context=context) - translation_terms = translation_pool.browse(cr, uid, translation_id, context=context) - gengo_job_id = [term.job_id for term in translation_terms] - if gengo_job_id: - gengo_ids = ','.join(gengo_job_id) - job_response = gengo.getTranslationJobBatch(id=gengo_ids) - if job_response['opstat'] == 'ok': - job_response_dict = dict([(job['job_id'],job) for job in job_response['response']['jobs']]) - for term in translation_terms: - up_term = up_comment = 0 - vals={} - if job_response_dict[term.job_id]['status'] == 'approved': - vals.update({'state': 'translated', - 'value': job_response_dict[term.job_id]['body_tgt']}) - up_term += 1 - job_comment = gengo.getTranslationJobComments(id=term.job_id) - if job_comment['opstat']=='ok': - gengo_comments="" - for comment in job_comment['response']['thread']: - gengo_comments += _('%s\n-- Commented on %s by %s.\n\n') % (comment['body'], time.ctime(comment['ctime']), comment['author']) - vals.update({'gengo_comment': gengo_comments}) - up_comment += 1 - if vals: - translation_pool.write(cr, uid, term.id, vals) - _logger.info("Successfully Updated `%d` terms and %d Comments." % (up_term, up_comment )) + offset = 0 + while True: + translation_ids = translation_pool.search(cr, uid, [('state', '=', 'inprogress'), ('gengo_translation', 'in', ('machine','standard','pro','ultra')), ('job_id', "!=",False)], limit=limit, offset=offset, context=context) + if not translation_ids: + break + offset += limit + translation_terms = translation_pool.browse(cr, uid, translation_ids, context=context) + gengo_job_id = [term.job_id for term in translation_terms] + if gengo_job_id: + gengo_ids = ','.join(gengo_job_id) + job_response = gengo.getTranslationJobBatch(id=gengo_ids) + if job_response['opstat'] == 'ok': + job_response_dict = dict([(job['job_id'],job) for job in job_response['response']['jobs']]) + for term in translation_terms: + up_term = up_comment = 0 + vals={} + if job_response_dict[term.job_id]['status'] == 'approved': + vals.update({'state': 'translated', + 'value': job_response_dict[term.job_id]['body_tgt']}) + up_term += 1 + job_comment = gengo.getTranslationJobComments(id=term.job_id) + if job_comment['opstat']=='ok': + gengo_comments="" + for comment in job_comment['response']['thread']: + gengo_comments += _('%s\n-- Commented on %s by %s.\n\n') % (comment['body'], time.ctime(comment['ctime']), comment['author']) + vals.update({'gengo_comment': gengo_comments}) + up_comment += 1 + if vals: + translation_pool.write(cr, uid, term.id, vals) + _logger.info("Successfully Updated `%d` terms and %d Comments." % (up_term, up_comment )) return True def _update_terms(self, cr, uid, response, context=None): @@ -187,7 +192,7 @@ class base_gengo_translations(osv.osv_memory): return {'jobs': jobs} - def _send_translation_terms(self, cr, uid, term_ids, context=None): + def _send_translation_terms(self, cr, uid, term_ids, context=None): """ Send a request to Gengo with all the term_ids in a different job, get the response and update the terms in database accordingly. @@ -223,13 +228,16 @@ class base_gengo_translations(osv.osv_memory): #but if this specific key is given, then we restrict the request on terms of this language only lang_ids = [context.get('gengo_language')] langs = [lang.code for lang in language_pool.browse(cr, uid, lang_ids, context=context)] - #search for the n first terms to translate - term_ids = translation_pool.search(cr, uid, [('state', '=', 'to_translate'), ('gengo_translation', 'in', ('machine','standard','pro','ultra')), ('lang', 'in', langs),('job_id',"=",False)], limit=limit, context=context) - if term_ids: - self._send_translation_terms(cr, uid, term_ids, context=context) - _logger.info("%s Translation terms have been posted to Gengo successfully", len(term_ids)) - else: - _logger.info('No Translation terms to process.') + offset = 0 + while True: + #search for the n first terms to translate + term_ids = translation_pool.search(cr, uid, [('state', '=', 'to_translate'), ('gengo_translation', 'in', ('machine','standard','pro','ultra')), ('lang', 'in', langs),('job_id',"=",False)], limit=limit, offset=offset, context=context) + if term_ids: + self._send_translation_terms(cr, uid, term_ids, context=context) + offset += limit + _logger.info("%s Translation terms have been posted to Gengo successfully", len(term_ids)) + else: + break except Exception, e: _logger.error("%s", e)