From bef70dd63854791f3137ae4908f18889543c6f33 Mon Sep 17 00:00:00 2001 From: Tejas Tank Date: Thu, 25 Oct 2012 13:08:34 +0530 Subject: [PATCH] [FIX] Document name and google doc index. bzr revid: tta@openerp.com-20121025073834-0tcjrqe8p7n3m2yx --- addons/document/static/src/js/document.js | 2 +- addons/google_docs/google_docs.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/document/static/src/js/document.js b/addons/document/static/src/js/document.js index e4bce2da76e..23f1375e8c8 100644 --- a/addons/document/static/src/js/document.js +++ b/addons/document/static/src/js/document.js @@ -9,7 +9,7 @@ openerp.document = function (instance) { on_attachments_loaded: function(attachments) { //to display number in name if more then one attachment which has same name. var self = this; - _.chain(attachments) + _.chain(attachments.reverse()) .groupBy(function(attachment) { return attachment.name}) .each(function(attachment){ if(attachment.length > 1) diff --git a/addons/google_docs/google_docs.py b/addons/google_docs/google_docs.py index 5d6db04e309..60d6446c8ee 100644 --- a/addons/google_docs/google_docs.py +++ b/addons/google_docs/google_docs.py @@ -90,7 +90,7 @@ class google_docs_ir_attachment(osv.osv): try: original_resource = client.get_resource_by_id(gdoc_template_id) #copy the document you choose in the configuration - copy_resource = client.copy_resource(original_resource, 'copy_%s' % original_resource.title.text) + copy_resource = client.copy_resource(original_resource, name_gdocs) except: raise osv.except_osv(_('Google Docs Error!'), _("Your resource id is not correct. You can find the id in the google docs URL.")) # create an ir.attachment