[IMP] send source url in gengo comment, and save page on gengo post

bzr revid: pga@tinyerp.com-20140324111253-xts034vw3rjjl1cb
This commit is contained in:
Parth Gajjar (Open ERP) 2014-03-24 16:42:53 +05:30
parent bf0d35dbdd
commit 69e6a7a808
3 changed files with 5 additions and 2 deletions

View File

@ -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}

View File

@ -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

View File

@ -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");
});