From cce70fd4c9e281245fceff5d9275770dfa30d29a Mon Sep 17 00:00:00 2001 From: Somesh Khare Date: Tue, 26 Aug 2014 11:55:23 +0530 Subject: [PATCH 1/2] [FIX] document: display Attachment(s) menu only on form view The attachment menu (list and add) has no effect in tree view (not supporting multi-items upload and display), the menu should then only be displayed in these view (opw 612534) --- addons/document/static/src/js/document.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/addons/document/static/src/js/document.js b/addons/document/static/src/js/document.js index e4bce2da76e..5b353d5b0dd 100644 --- a/addons/document/static/src/js/document.js +++ b/addons/document/static/src/js/document.js @@ -3,8 +3,10 @@ openerp.document = function (instance) { instance.web.Sidebar.include({ init : function(){ this._super.apply(this, arguments); - this.sections.splice(1, 0, { 'name' : 'files', 'label' : _t('Attachment(s)'), }); - this.items['files'] = []; + if (this.getParent().view_type == "form"){ + this.sections.splice(1, 0, { 'name' : 'files', 'label' : _t('Attachment(s)'), }); + this.items['files'] = []; + } }, on_attachments_loaded: function(attachments) { //to display number in name if more then one attachment which has same name. From 59b76ee92701a28032822f6f3a45b7939255bb02 Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 21 Aug 2014 18:25:49 +0530 Subject: [PATCH 2/2] [FIX] sale: keep page when confirming a sale order To keep the pager and view changer after confirmation of a sale order, do not reload the view (quotation and sale order view are the same anyway) Fixes #250 --- addons/sale/sale.py | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/addons/sale/sale.py b/addons/sale/sale.py index 264c2d9650f..1244cf09f5f 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -581,22 +581,8 @@ class sale_order(osv.osv): assert len(ids) == 1, 'This option should only be used for a single id at a time.' wf_service = netsvc.LocalService('workflow') wf_service.trg_validate(uid, 'sale.order', ids[0], 'order_confirm', cr) - - # redisplay the record as a sales order - view_ref = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'sale', 'view_order_form') - view_id = view_ref and view_ref[1] or False, - return { - 'type': 'ir.actions.act_window', - 'name': _('Sales Order'), - 'res_model': 'sale.order', - 'res_id': ids[0], - 'view_type': 'form', - 'view_mode': 'form', - 'view_id': view_id, - 'target': 'current', - 'nodestroy': True, - } - + return True + def action_wait(self, cr, uid, ids, context=None): context = context or {} for o in self.browse(cr, uid, ids):