From bd92c1282bab819d05f5020d25b72cd19d7ccf37 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Fri, 9 Sep 2011 15:42:44 +0200 Subject: [PATCH] [REV] base.xml changes of xmo@openerp.com-20110908125510-fb7vcjsixj5sqhpz: new version was simpler, it was also completely broken issue here is that element bears a foreach, which we have to keep, so can't just insert new tds in the row (they'll get repeated), we can't remove the tr (not without grafting the old attributes), etc... it's really kind-of a pain. Basically, the replaceAll() is used to make the just created replace the matched, the unwrapAll removes the around it all, resulting in a with the buttons inserted before and after it, all landed in the editable-listview-generated-row bzr revid: xmo@openerp.com-20110909134244-mbf5sf4to09fvsyi --- addons/web/static/src/xml/base.xml | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 385d7bfd48b..8b0fda2b83f 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -1211,11 +1211,21 @@ - - - - - + + $(document.createElement('t')) + .append(this.contents()) + .attr({ + 't-foreach': this.attr('t-foreach'), + 't-as': this.attr('t-as') + }) + .replaceAll(this) + .after($(document.createElement('td')).append( + $(document.createElement('button')).attr({ + 'class': 'oe-edit-row-save', 'type': 'button'}).text('Save'))) + .before($(document.createElement('td')).append( + $(document.createElement('button')).attr({ + 'class': 'oe-edit-row-cancel', 'type': 'button'}).text('Cancel'))) + .unwrap();