From 69e6a7a80876f01d7fd12d95053d5b333a41d747 Mon Sep 17 00:00:00 2001 From: "Parth Gajjar (Open ERP)" Date: Mon, 24 Mar 2014 16:42:53 +0530 Subject: [PATCH] [IMP] send source url in gengo comment, and save page on gengo post bzr revid: pga@tinyerp.com-20140324111253-xts034vw3rjjl1cb --- addons/base_gengo/wizard/base_gengo_translations.py | 2 +- addons/website/controllers/main.py | 1 + addons/website_gengo/static/src/js/website_gengo.js | 4 +++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/addons/base_gengo/wizard/base_gengo_translations.py b/addons/base_gengo/wizard/base_gengo_translations.py index 57c20d47a20..faac0725d95 100644 --- a/addons/base_gengo/wizard/base_gengo_translations.py +++ b/addons/base_gengo/wizard/base_gengo_translations.py @@ -202,7 +202,7 @@ class base_gengo_translations(osv.osv_memory): 'lc_src': 'en', 'lc_tgt': translation_pool._get_gengo_corresponding_language(term.lang), 'auto_approve': auto_approve, - 'comment': user.company_id.gengo_comment, + 'comment': user.company_id.gengo_comment and "%s %s"%(user.company_id.gengo_comment,term.gengo_comment) or term.gengo_comment } return {'jobs': jobs} diff --git a/addons/website/controllers/main.py b/addons/website/controllers/main.py index 7e4b8f3b15f..76907faec3c 100644 --- a/addons/website/controllers/main.py +++ b/addons/website/controllers/main.py @@ -242,6 +242,7 @@ class Website(openerp.addons.web.controllers.main.Home): } if t.get('gengo_translation'): new_trans['gengo_translation'] = t.get('gengo_translation') + new_trans['gengo_comment'] = t.get('gengo_comment') irt.create(request.cr, request.uid, new_trans) return True diff --git a/addons/website_gengo/static/src/js/website_gengo.js b/addons/website_gengo/static/src/js/website_gengo.js index 9107335ca66..65e6f83bf6f 100644 --- a/addons/website_gengo/static/src/js/website_gengo.js +++ b/addons/website_gengo/static/src/js/website_gengo.js @@ -47,7 +47,8 @@ initial_content: self.getInitialContent(this), new_content:self.getInitialContent(this), translation_id: data.oeTranslationId || null, - gengo_translation: gengo_service_level + gengo_translation: gengo_service_level, + gengo_comment:"Original page:" + document.URL }); }); openerp.jsonRpc('/website/set_translations', 'call', { @@ -57,6 +58,7 @@ $('.oe_translatable_todo').addClass('oe_translatable_inprogress').removeClass('oe_translatable_todo'); self.$el.find('.gengo_wait').addClass("hidden"); self.$el.find('.gengo_inprogress,.gengo_discard').removeClass("hidden"); + self.save(); }).fail(function () { alert("Could not Post translation"); });